Menu
Amazon Elastic Compute Cloud
User Guide for Windows Instances

Modifying the Size, IOPS, or Type of an EBS Volume on Windows

If your Amazon EBS volume is attached to a current generation EC2 instance type, you can increase its size, change its volume type, or (for an io1 volume) adjust its IOPS performance, all without detaching it. You can apply these changes to detached volumes as well. For more information about the current generation instance types, see Current Generation Instances.

If you are using a previous generation instance type, or if you encounter an error while attempting a volume modification, follow the procedures in Appendix: Starting and Stopping an Instance to Modify an EBS Volume.

In general, the following steps are involved in modifying a volume:

  1. Issue the modification command. For more information, see Modifying an EBS Volume from the Console and Modifying an EBS Volume from the Command Line.

  2. Monitor the progress of the modification. For more information, see Monitoring the Progress of Volume Modifications.

  3. If the size of the volume was modified, extend the volume's file system to take advantage of the increased storage capacity. For more information, see Extending a Windows File System after Resizing the Volume.

Additionally, you can use Amazon CloudWatch Events and AWS CloudFormation to automate the actions associated with volume modification.

There is no charge to modify the configuration of a volume. You are charged at the new volume configuration price after a modification starts. For more information, see the Amazon Elastic Block Store section on the Amazon EBS Pricing page.

For more information, see Considerations for Modifying EBS Volumes.

Important

Before modifying a volume that contains valuable data, it is a best practice to create a snapshot of the volume in case you need to roll back your changes. For information about EBS snapshots, see Creating an Amazon EBS Snapshot.

Modifying an EBS Volume from the Console

The following procedure shows how to apply available volume modifications from the Amazon EC2 console.

To modify an EBS volume using the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. Choose Volumes, select the volume to modify and then choose Actions, Modify Volume.

  3. The Modify Volume window displays the volume ID and the volume's current configuration, including type, size, and IOPS. You can change any or all of these settings in a single action. Set new configuration values as follows:

    • To modify the type, choose a value for Volume Type.

    • To modify the size, enter an allowed integer value for Size.

    • If you chose Provisioned IOPS (IO1) as your volume type, enter an allowed integer value for IOPS.

  4. After you have specified all of the modifications to apply, choose Modify, Yes.

  5. Modifying volume size has no practical effect until you also extend the volume's file system to make use of the new storage capacity. For more information, see Extending a Windows File System after Resizing the Volume.

Modifying an EBS Volume from the Command Line

The following example demonstrates how an EBS volume can be modified from the command line using the AWS CLI. Depending on your default configuration, you may need to specify information such as region and availability zone. The ID of the source volume being modified is required, and you must have appropriate permissions to carry out the action. When an io1 volume is the modification target, you must specify its level of provisioned IOPS. Multiple modification actions (to change capacity, IOPS, or type) may be performed in a single command.

For example, an EBS volume is configured as follows:

  • Volume ID: vol-11111111111111111

  • Volume size: 100 GiB

  • Volume type: gp2

You can change the volume configuration to the following:

  • Volume size: 200 GiB

  • Volume type: io1

  • Provisioning level: 10,000 IOPS

Apply the above modifications with the following command:

Copy
aws ec2 modify-volume --region us-east-1 --volume-id vol-11111111111111111 --size 200 --volume-type io1 --iops 10000

The command yields output similar to the following:

{
    "VolumeModification": {
        "TargetSize": 200,
        "TargetVolumeType": "io1",
        "ModificationState": "modifying",
        "VolumeId": "vol-11111111111111111",
        "TargetIops": 10000,
        "StartTime": "2017-01-19T22:21:02.959Z",
        "Progress": 0,
        "OriginalVolumeType": "gp2",
        "OriginalIops": 300,
        "OriginalSize": 100
    }
}

Note

Modifying volume size has no practical effect until you also extend the volume's file system to make use of the new storage capacity. For more information, see Extending a Windows File System after Resizing the Volume.

Monitoring the Progress of Volume Modifications

An EBS volume being modified goes through a sequence of states. After you issue a ModifyVolume directive, whether from the console, CLI, API, or SDK, the volume enters first the Modifying state, then the Optimizing state, and finally the Complete state. At this point, the volume is ready to be further modified. Rarely, a transient AWS fault can result in the Failed state. If this occurs, retry the modification.

Size changes usually take a few seconds to complete and take effect after a volume is in the Optimizing state.

Performance (IOPS) changes can take from a few minutes to a few hours to complete and are dependent on the configuration change being made.

It may take up to 24 hours for a new configuration to take effect, and in some cases more, such as when the volume has not been fully initialized. Typically, a fully used 1 TiB volume takes about 6 hours to migrate to a new performance configuration.

While the volume is in the optimizing state, your volume performance will be in between the source and target configuration specifications. Transitional volume performance will be no less than the source volume performance. If you are downgrading IOPS, transitional volume performance will be no less than the target volume performance.

You can monitor the progress of a modification by inspecting the AWS Management Console, by querying the volume's state with the AWS EC2 API/CLI, or by accessing metrics sent to Amazon CloudWatch Events. The following procedures demonstrate these approaches.

To monitor progress of a modification from the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. Choose Volumes, and select the volume to inspect. The volume's status is displayed in the State column. In the example below, the modification state is completed. This state information is also displayed in the State field of the details pane.

  3. Open the information icon next to the State field to display complete before and after information about the most recent modification action, as illustrated below.

Example To monitor progress of a modification from the command line

Use describe-volumes-modifications to view the progress of the modifications. In this example, volume vol-11111111111111111 from above and another volume, vol-22222222222222222, are called.

Copy
aws ec2 describe-volumes-modifications --region us-east-1 --volume-id vol-11111111111111111 vol-22222222222222222

The command returns one or more VolumesModification objects. The following is example output. The first object is nearly identical to the original modify-volume command output shown above. No additional modifications have been applied, however.

{
    "VolumesModifications": [
        {
            "TargetSize": 200,
            "TargetVolumeType": "io1",
            "ModificationState": "modifying",
            "VolumeId": "vol-11111111111111111",
            "TargetIops": 10000,
            "StartTime": "2017-01-19T22:21:02.959Z",
            "Progress": 0,
            "OriginalVolumeType": "gp2",
            "OriginalIops": 300,
            "OriginalSize": 100
        },
        {
            "TargetSize": 2000,
            "TargetVolumeType": "sc1",
            "ModificationState": "modifying",
            "VolumeId": "vol-22222222222222222",
            "StartTime": "2017-01-19T22:23:22.158Z",
            "Progress": 0,
            "OriginalVolumeType": "gp2",
            "OriginalIops": 300,
            "OriginalSize": 1000
        }
    ]
}

The next example queries for all volumes in a region with a modification state of either optimizing or completed, and then filters and formats the results to show only modifications that were initiated on or after February 1, 2017:

Copy
aws ec2 describe-volumes-modifications --filters Name=modification-state,Values="optimizing","completed" --region us-east-1 --query "VolumesModifications[?StartTime>='2017-02-01'].{ID:VolumeId,STATE:ModificationState}"

In this case the query returns information about two volumes:

[
    {
        "STATE": "optimizing",
        "ID": "vol-06397e7a0eEXAMPLE"
    },
    {
        "STATE": "completed",
        "ID": "vol-bEXAMPLE"
    }
]

To monitor progress of a modification with CloudWatch Events

With CloudWatch Events, you can create a notification rule for volume modification events to send a text message or execute a Lambda function.

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Choose Events, Create rule.

  3. For Build event pattern to match events by service, choose Custom event pattern.

  4. For Build custom event pattern , replace the contents with the following code:

    Copy
    { "source": [ "aws.ec2" ], "detail-type": [ "EBS Volume Notification" ], "detail": { "event": [ "modifyVolume" ] } }

    Choose Save when done.

    Typical event output should look like the following:

    Body:
    {
       "version": "0",
       "id": "1ea2ace2-7790-46ed-99ab-d07a8bd68685",
       "detail-type": "EBS Volume Notification",
       "source": "aws.ec2",
       "account": "065441870323",
       "time": "2017-01-12T21:09:07Z",
       "region": "us-east-1",
       "resources": [
          "arn:aws:ec2:us-east-1:065441870323:volume/vol-03a55cf56513fa1b6"
       ],
       "detail": {
          "result": "optimizing",
          "cause": "",
          "event": "modifyVolume",
          "request-id": "auto-58c08bad-d90b-11e6-a309-b51ed35473f8"
       }
    }

You can use your rule to generate a notification message with Amazon SNS or to invoke an AWS Lambda function in response to matching events.

Extending a Windows File System after Resizing the Volume

Use the Windows Disk Management utility to extend the disk size to the new size of the volume. You can begin resizing the file system as soon as the volume enters the Optimizing state.

Important

Before extending a file system that contains valuable data, it is a best practice to create a snapshot of the volume that contains it in case you need to roll back your changes. For information about EBS snapshots, see Creating an Amazon EBS Snapshot.

To extend a Windows file system

  1. Log in to your Windows instance using Remote Desktop.

  2. In the Run dialog, type diskmgmt.msc and press Enter. The Disk Management utility opens.

    
            Windows Server Disk Management Utility
  3. On the Disk Management menu, choose Action, Rescan Disks.

  4. Open the context (right-click) menu for the expanded drive and choose Extend Volume.

    
            Windows Server Disk Management Utility
  5. In the Extend Volume wizard, choose Next. For Select the amount of space in MB, enter the number of megabytes by which to extend the volume. Normally, you set this to the maximum available space. Note that the highlighted text under Selected is the amount of space that will be added, not the final size the volume will have.

    Complete the wizard.

    
            Windows Server Extend Volume Wizard
  6. Reboot the system from inside Windows.

Tip

If the increased available space on your volume remains invisible to the system, try re-initializing the volume as described in Initializing Amazon EBS Volumes.

Appendix: Starting and Stopping an Instance to Modify an EBS Volume

If you are using a previous generation Amazon EC2 instance and you need to modify the root (boot) volume, you must stop the instance, apply the modifications, and then restart the instance. The procedure described here can be used to modify any EBS volume on any instance type.

When you stop and start an instance, be aware of the following:

  • If your instance is running in a VPC and has a public IPv4 address, we release the address and give it a new public IPv4 address. The instance retains its private IPv4 addresses and any Elastic IP addresses.

  • If your instance is running in EC2-Classic, we give it new public and private IPv4 addresses, and disassociate any Elastic IP address that's associated with the instance. You must re-associate any Elastic IP address after you restart your instance.

  • If your instance is in an Auto Scaling group, Auto Scaling marks the stopped instance as unhealthy, and may terminate it and launch a replacement instance. To prevent this, you can temporarily suspend the Auto Scaling processes for the group. For more information, see Suspend and Resume Auto Scaling Processes in the Auto Scaling User Guide.

To modify the root volume of an instance

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Instances and select the instance with the volume to expand.

  3. Verify that Shutdown Behavior is set to Stop and not Terminate.

    1. Select the instance.

    2. From the context (right-click) menu, choose Instance Settings, Change Shutdown Behavior.

    3. If Shutdown behavior is set to Terminate, choose Stop, Apply.

      If Shutdown behavior is already set to Stop, choose Cancel.

  4. Stop the instance. For more information, see Stopping and Starting Your Instances.

    Warning

    When you stop an instance, the data on any instance store volumes is erased. Therefore, if you have any data on instance store volumes that you want to keep, be sure to back it up to persistent storage.

  5. Modify your EBS volume as described in Modifying an EBS Volume from the Console or Modifying an EBS Volume from the Command Line.

  6. Restart the instance.

    1. In the navigation pane, choose Instances and then select the instance to restart.

    2. From the context (right-click) menu, choose Instance State, Start.

    3. In the Start Instances dialog box, choose Yes, Start. If the instance fails to start, and the volume being expanded is a root volume, verify that you attached the expanded volume using the same device name as the original volume, for example /dev/sda1.

After the instance has started, you can check the file system size to see if your instance recognizes the larger volume space.

If the size does not reflect your newly expanded volume, you must extend the file system of your device so that your instance can use the new space. For more information, see Extending a Windows File System after Resizing the Volume.

You may have to bring the volume online in order to use it. For more information, see Making an Amazon EBS Volume Available for Use. You do not need to reformat the volume.