modify_volume - Boto3 1.34.75 documentation

Publish date: 2024-06-18

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 might be able to apply these changes without stopping the instance or detaching the volume from it. For more information about modifying EBS volumes, see Amazon EBS Elastic Volumes in the Amazon EBS User Guide.

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 more information, see Extend the 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 DescribeVolumesModifications. For information about tracking status changes using either method, see Monitor the progress of volume modifications.

With previous-generation instance types, resizing an EBS volume might require detaching and reattaching the volume or stopping and restarting the instance.

After modifying a volume, you must wait at least six hours and ensure that the volume is in the in-use or available state before you can modify the same volume. This is sometimes referred to as a cooldown period.

See also: AWS API Documentation

Request Syntax

response = client.modify_volume( DryRun=True|False, VolumeId='string', Size=123, VolumeType='standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3', Iops=123, Throughput=123, MultiAttachEnabled=True|False ) 
Parameters:Return type:

dict

Returns:

Response Syntax

{ 'VolumeModification': { 'VolumeId': 'string', 'ModificationState': 'modifying'|'optimizing'|'completed'|'failed', 'StatusMessage': 'string', 'TargetSize': 123, 'TargetIops': 123, 'TargetVolumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3', 'TargetThroughput': 123, 'TargetMultiAttachEnabled': True|False, 'OriginalSize': 123, 'OriginalIops': 123, 'OriginalVolumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3', 'OriginalThroughput': 123, 'OriginalMultiAttachEnabled': True|False, 'Progress': 123, 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1) } } 

Response Structure

ncG1vNJzZmian6m8dHrAppizp56WxLR6wqikaK5hZLGwr9SmnKeskam2sLqOmqeiZ5yWwaa%2F02ipnp6Vp7Kvr8Roqp6qpp6wpr%2BOnpprZ5Ohtqa602ikqJyZm8agws6lrKadXp3Brrg%3D