From ed8063c9d371b4abe90eb52af2b7ff65d72a7263 Mon Sep 17 00:00:00 2001
From: Angelo Marletta <angelo.marletta@gmail.com>
Date: Wed, 3 Jul 2013 12:37:11 +0100
Subject: [PATCH] increased iops limit to 4000.
 http://aws.typepad.com/aws/2013/05/provision-up-to-4k-iops-per-ebs-volume.html

---
 lib/fog/aws/requests/compute/create_volume.rb | 6 +++---
 tests/aws/requests/compute/volume_tests.rb    | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/fog/aws/requests/compute/create_volume.rb b/lib/fog/aws/requests/compute/create_volume.rb
index adcd2a841..f11e7386e 100644
--- a/lib/fog/aws/requests/compute/create_volume.rb
+++ b/lib/fog/aws/requests/compute/create_volume.rb
@@ -13,7 +13,7 @@ module Fog
         # * options<~Hash>
         #   * 'SnapshotId'<~String> - Optional, snapshot to create volume from
         #   * 'VolumeType'<~String> - Optional, volume type. standard or io1, default is standard.
-        #   * 'Iops'<~Integer> - Number of IOPS the volume supports. Required if VolumeType is io1, must be between 1 and 1000.
+        #   * 'Iops'<~Integer> - Number of IOPS the volume supports. Required if VolumeType is io1, must be between 1 and 4000.
         #
         # ==== Returns
         # * response<~Excon::Response>:
@@ -83,8 +83,8 @@ module Fog
                 raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too low; minimum is 100.")
               end
 
-              if iops > 2000
-                raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 2000.")
+              if iops > 4000
+                raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 4000.")
               end
             end
 
diff --git a/tests/aws/requests/compute/volume_tests.rb b/tests/aws/requests/compute/volume_tests.rb
index 6da7b358e..f050d4a7a 100644
--- a/tests/aws/requests/compute/volume_tests.rb
+++ b/tests/aws/requests/compute/volume_tests.rb
@@ -192,9 +192,9 @@ Shindo.tests('Fog::Compute[:aws] | volume requests', ['aws']) do
       Fog::Compute[:aws].create_volume(@server.availability_zone, 10, 'VolumeType' => 'io1', 'Iops' => 99)
     end
 
-    # iops invalid value (greater than 2000)
-    tests("#create_volume('#{@server.availability_zone}', 1024, 'VolumeType' => 'io1', 'Iops' => 2001)").raises(Fog::Compute::AWS::Error) do
-      Fog::Compute[:aws].create_volume(@server.availability_zone, 1024, 'VolumeType' => 'io1', 'Iops' => 2001)
+    # iops invalid value (greater than 4000)
+    tests("#create_volume('#{@server.availability_zone}', 1024, 'VolumeType' => 'io1', 'Iops' => 4001)").raises(Fog::Compute::AWS::Error) do
+      Fog::Compute[:aws].create_volume(@server.availability_zone, 1024, 'VolumeType' => 'io1', 'Iops' => 4001)
     end
 
     @volume.destroy