2017/02/14 - Amazon Elastic Compute Cloud - 2 new api methods
Changes Update ec2 client to latest version
You can modify several parameters of an existing EBS volume, including volume size, volume type, and IOPS capacity. If your EBS volume is attached to a current-generation EC2 instance type, you may be able to apply these changes without stopping the instance or detaching the volume from it. For more information about modifying an EBS volume running Linux, see Modifying the Size, IOPS, or Type of an EBS Volume on Linux. For more information about modifying an EBS volume running Windows, see Expanding the Storage Space of an EBS Volume on Windows.
When you complete a resize operation on your volume, you need to extend the volume's file-system size to take advantage of the new storage capacity. For information about extending a Linux file system, see Extending a Linux File System. For information about extending a Windows file system, see Extending a Windows File System.
You can use CloudWatch Events to check the status of a modification to an EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch Events User Guide. You can also track the status of a modification using the DescribeVolumesModificationsAPI. For information about tracking status changes using either method, see Monitoring Volume Modifications".
Note
With previous-generation volumes and instance types, resizing an EBS volume may require detaching and reattaching the volume or stopping and restarting the instance. For more information about modifying an EBS volume running Linux, see Modifying the Size, IOPS, or Type of an EBS Volume on Linux. For more information about modifying an EBS volume running Windows, see Modifying the Size, IOPS, or Type of an EBS Volume on Windows.
Note
If you reach the maximum volume modification rate per volume limit, you will need to wait at least six hours before applying further modifications to the affected EBS volume.
See also: AWS API Documentation
Request Syntax
client.modify_volume( DryRun=True|False, VolumeId='string', Size=123, VolumeType='standard'|'io1'|'gp2'|'sc1'|'st1', Iops=123 )
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .
string
[REQUIRED]
integer
Target size in GiB of the volume to be modified. Target volume size must be greater than or equal to than the existing size of the volume. For information about available EBS volume sizes, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html.
Default: If no size is specified, the existing size is retained.
string
Target EBS volume type of the volume to be modified
Valid values are io1 | gp2 | sc1 | st1
The API does not support modifications for volume type standard . You also cannot change the type of a volume to standard .
integer
Target IOPS rate of the volume to be modified.
Only valid for Provisioned IOPS SSD ( io1 ) volumes. For more information about io1 IOPS configuration, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops.
dict
Response Syntax
{ 'VolumeModification': { 'VolumeId': 'string', 'ModificationState': 'modifying'|'optimizing'|'completed'|'failed', 'StatusMessage': 'string', 'TargetSize': 123, 'TargetIops': 123, 'TargetVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1', 'OriginalSize': 123, 'OriginalIops': 123, 'OriginalVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1', 'Progress': 123, 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1) } }
Response Structure
(dict) --
VolumeModification (dict) --
A VolumeModification object.
VolumeId (string) --
ID of the volume being modified.
ModificationState (string) --
Current state of modification. Possible values are modifying | optimizing | complete | failed . Modification state is null for unmodified volumes.
StatusMessage (string) --
Generic status message on modification progress or failure.
TargetSize (integer) --
Target size of the volume being modified.
TargetIops (integer) --
Target IOPS rate of the volume being modified.
TargetVolumeType (string) --
Target EBS volume type of the volume being modified.
OriginalSize (integer) --
Original size of the volume being modified.
OriginalIops (integer) --
Original IOPS rate of the volume being modified.
OriginalVolumeType (string) --
Original EBS volume type of the volume being modified.
Progress (integer) --
Modification progress from 0 to 100%.
StartTime (datetime) --
Modification start time
EndTime (datetime) --
Modification completion or failure time.
Reports the current modification status of EBS volumes.
Current-generation EBS volumes support modification of attributes including type, size, and (for io1 volumes) IOPS provisioning while either attached to or detached from an instance. Following an action from the API or the console to modify a volume, the status of the modification may be modifying , optimizing , completed , or failed . If a volume has never been modified, then certain elements of the returned VolumeModification objects are null.
You can also use CloudWatch Events to check the status of a modification to an EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch Events User Guide. For more information, see Monitoring Volume Modifications".
See also: AWS API Documentation
Request Syntax
client.describe_volumes_modifications( DryRun=True|False, VolumeIds=[ 'string', ], Filters=[ { 'Name': 'string', 'Values': [ 'string', ] }, ], NextToken='string', MaxResults=123 )
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .
list
One or more volume IDs for which in-progress modifications will be described.
(string) --
list
One or more filters. Supported filters: volume-id , modification-state , target-size , target-iops , target-volume-type , original-size , original-iops , original-volume-type , start-time .
(dict) --
A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.
Name (string) --
The name of the filter. Filter names are case-sensitive.
Values (list) --
One or more filter values. Filter values are case-sensitive.
(string) --
string
The nextToken value returned by a previous paginated request.
integer
The maximum number of results (up to a limit of 500) to be returned in a paginated request.
dict
Response Syntax
{ 'VolumesModifications': [ { 'VolumeId': 'string', 'ModificationState': 'modifying'|'optimizing'|'completed'|'failed', 'StatusMessage': 'string', 'TargetSize': 123, 'TargetIops': 123, 'TargetVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1', 'OriginalSize': 123, 'OriginalIops': 123, 'OriginalVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1', 'Progress': 123, 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
VolumesModifications (list) --
A list of returned VolumeModification objects.
(dict) --
Describes the modification status of an EBS volume.
If the volume has never been modified, some element values will be null.
VolumeId (string) --
ID of the volume being modified.
ModificationState (string) --
Current state of modification. Possible values are modifying | optimizing | complete | failed . Modification state is null for unmodified volumes.
StatusMessage (string) --
Generic status message on modification progress or failure.
TargetSize (integer) --
Target size of the volume being modified.
TargetIops (integer) --
Target IOPS rate of the volume being modified.
TargetVolumeType (string) --
Target EBS volume type of the volume being modified.
OriginalSize (integer) --
Original size of the volume being modified.
OriginalIops (integer) --
Original IOPS rate of the volume being modified.
OriginalVolumeType (string) --
Original EBS volume type of the volume being modified.
Progress (integer) --
Modification progress from 0 to 100%.
StartTime (datetime) --
Modification start time
EndTime (datetime) --
Modification completion or failure time.
NextToken (string) --
Token for pagination, null if there are no more results