Amazon Elastic Compute Cloud
User Guide for Windows Instances

Restoring an Amazon EBS Volume from a Snapshot

You can restore an Amazon EBS volume with data from a snapshot stored in Amazon S3. You need to know the ID of the snapshot you want to restore your volume from and you need to have access permissions for the snapshot. For more information on snapshots, see Amazon EBS Snapshots.

EBS snapshots are the preferred backup tool on Amazon EC2 due to their speed, convenience, and cost. When restoring a volume from a snapshot, you recreate its state at a specific point in the past with all data intact. By attaching a restored volume to an instance, you can duplicate data across regions, create test environments, replace a damaged or corrupted production volume in its entirety, or retrieve specific files and directories and transfer them to another attached volume. For more information, see Amazon EBS Snapshots.

New volumes created from existing EBS snapshots load lazily in the background. This means that after a volume is created from a snapshot, there is no need to wait for all of the data to transfer from Amazon S3 to your EBS volume before your attached instance can start accessing the volume and all its data. If your instance accesses data that hasn't yet been loaded, the volume immediately downloads the requested data from Amazon S3, and then continues loading the rest of the volume data in the background.

EBS volumes that are restored from encrypted snapshots are automatically encrypted. You can also encrypt a volume on-the-fly while restoring it from an unencrypted snapshot. Encrypted volumes can only be attached to selected instance types. For more information, see Supported Instance Types.

Because of security constraints, you cannot directly restore an EBS volume from a shared encrypted snapshot that you do not own. You must first create a copy of the snapshot, which you will own. You can then restore a volume from that copy. For more information, see Amazon EBS Encryption.

New EBS volumes receive their maximum performance the moment that they are available and do not require initialization (formerly known as pre-warming). However, storage blocks on volumes that were restored from snapshots must be initialized (pulled down from Amazon S3 and written to the volume) before you can access the block. This preliminary action takes time and can cause a significant increase in the latency of an I/O operation the first time each block is accessed. Performance is restored after the data is accessed once.

For most applications, amortizing the initialization cost over the lifetime of the volume is acceptable. To ensure that your restored volume always functions at peak capacity in production, you can force the immediate initialization of the entire volume using dd or fio. For more information, see Initializing Amazon EBS Volumes.

To restore an EBS volume from a snapshot using the console

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

  2. From the navigation bar, select the region that your snapshot is located in.

    To restore the snapshot to a volume in a different region, you can copy your snapshot to the new region and then restore it to a volume in that region. For more information, see Copying an Amazon EBS Snapshot.

  3. In the navigation pane, choose ELASTIC BLOCK STORE, Volumes.

  4. Choose Create Volume.

  5. For Volume Type, choose a volume type. For more information, see Amazon EBS Volume Types.

    Note

    Some AWS accounts created before 2012 might have access to Availability Zones in us-west-1 or ap-northeast-1 that do not support Provisioned IOPS SSD (io1) volumes. If you are unable to create an io1 volume (or launch an instance with an io1 volume in its block device mapping) in one of these Regions, try a different Availability Zone in the Region. You can verify that an Availability Zone supports io1 volumes by creating a 4 GiB io1 volume in that zone.

  6. For Snapshot ID, start typing the ID or description of the snapshot from which you are restoring the volume, and choose it from the list of suggested options.

    Volumes that are restored from encrypted snapshots can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types.

  7. (Optional) Selecting Encrypted allows you to change the encryption state of your volume.

    You apply encryption to EBS volumes by setting the Encrypted parameter to true. (The Encrypted parameter is optional if encryption by default is enabled).

    Optionally, you can use KmsKeyId to specify a custom key to use to encrypt the volume. (The Encrypted parameter must also be set to true, even if encryption by default is enabled.) If KmsKeyId is not specified, the key that is used for encryption depends on the encryption state of the source snapshot and its ownership. The following table describes the encryption outcome for each possible combination of settings.

    Encryption Outcomes

    Is Encrypted parameter set? Is encryption by default set? Source of volume Default (no CMK specified) Custom (CMK specified)
    No No New (empty) volume Unencrypted N/A
    No No Unencrypted snapshot that you own Unencrypted
    No No Encrypted snapshot that you own Encrypted by same key
    No No Unencrypted snapshot that is shared with you Unencrypted
    No No Encrypted snapshot that is shared with you Encrypted by default CMK*
    Yes No New volume Encrypted by default CMK Encrypted by a specified CMK**
    Yes No Unencrypted snapshot that you own Encrypted by default CMK
    Yes No Encrypted snapshot that you own Encrypted by same key
    Yes No Unencrypted snapshot that is shared with you Encrypted by default CMK
    Yes No Encrypted snapshot that is shared with you Encrypted by default CMK
    No Yes New (empty) volume Encrypted by default CMK
    No Yes Unencrypted snapshot that you own Encrypted by default CMK N/A
    No Yes Encrypted snapshot that you own Encrypted by same key
    No Yes Unencrypted snapshot that is shared with you Encrypted by default CMK
    No Yes Encrypted snapshot that is shared with you Encrypted by default CMK
    Yes Yes New volume Encrypted by default CMK Encrypted by a specified CMK
    Yes Yes Unencrypted snapshot that you own Encrypted by default CMK
    Yes Yes Encrypted snapshot that you own Encrypted by same key
    Yes Yes Unencrypted snapshot that is shared with you Encrypted by default CMK
    Yes Yes Encrypted snapshot that is shared with you Encrypted by default CMK

    * This is the default CMK used for EBS encryption for the AWS account and Region. By default this is a unique AWS managed CMK for EBS, or you can specify a customer managed CMK. For more information, see Encryption Key Management.

    ** This is a customer managed CMK specified for the volume at launch time. This CMK is used instead of the default CMK for the AWS account and Region.

  8. For Size (GiB), type the size of the volume, or verify that the default size of the snapshot is adequate.

    Note

    If you specify both a volume size and a snapshot, the size must be equal to or greater than the snapshot size. When you select a volume type and a snapshot, the minimum and maximum sizes for the volume are shown next to Size. Any AWS Marketplace product codes from the snapshot are propagated to the volume.

    Note

    The following Amazon EBS volume considerations apply to Windows boot volumes:

    • Windows boot volumes must use an MBR partition table, which limits the usable space to 2 TiB, regardless of volume size.

    • Windows boot volumes of 2 TiB (2048 GiB) that have been converted to use a dynamic MBR partition table display an error when examined with Disk Manager.

    The following Amazon EBS volume considerations apply to Windows data (non-boot) volumes:

    • Windows volumes 2 TiB (2048 GiB) or greater must use a GPT partition table to access the entire volume.

    • Amazon EBS volumes over 2048 GiB that are attached to Windows instances at launch are automatically formatted with a GPT partition table.

    • Amazon EBS volumes attached to Windows instances after launch must be manually initialized with a GPT partition table. For more information, see Making an Amazon EBS Volume Available for Use.

  9. With a Provisioned IOPS SSD volume, for IOPS, type the maximum number of input/output operations per second (IOPS) that the volume should support.

  10. For Availability Zone, choose the Availability Zone in which to create the volume. EBS volumes can only be attached to EC2 instances in the same Availability Zone.

  11. (Optional) Choose Create additional tags to add tags to the volume. For each tag, provide a tag key and a tag value.

  12. Choose Create Volume.

  13. After you've restored a volume from a snapshot, you can attach it to an instance to begin using it. For more information, see Attaching an Amazon EBS Volume to an Instance.

  14. If you restored a snapshot to a larger volume than the default for that snapshot, you must extend the file system on the volume to take advantage of the extra space. For more information, see Modifying the Size, Performance, or Type of an EBS Volume.

To restore an EBS volume using the command line

You can use one of the following commands. For more information about these command line interfaces, see Accessing Amazon EC2.