blog menu1

Restore EC2 Instance from Snapshot

Restore EC2 Instance from Snapshot

To restore EC2 Instances from the snapshot(s) in the same or different AWS region follow these steps:
  1. Create a new EC2 Instances with parameters similar to the instance from which the snapshot(s) was taken. If possible, the best practice would be to take an AMI of the existing EC2 and create a new instance based on that AMI. The new instance can be created in any AWS region.
  2. Identify the snapshot that was taken from the root (C: drive) EBS volume
    • To identify root snapshot go to the AWS Management Console
    • Under EC2 section, click “Instances”
    • Select the source instance
    • In the Description section, click “Root device type”
    • Copy or Note EBS ID
    Restore EC2 Instance from Snapshot
    • Go to Snapshots section
    • In the Search field type or paste the EBS ID
    • On the list you should see the snapshots created from the root volume
    Restore EC2 Instance from Snapshot
  3. If the new instance will be launched in different AWS region, copy the root snapshot to destination region, otherwise skip this step.
    • To copy a snapshot to a different region go to the AWS Management Console
    • Under EC2 section go to Snapshots and select the “root snapshot”
    • From the menu, select “Copy”
    Restore EC2 Instance from Snapshot
    • Choose the destination region and click “Copy”
    Restore EC2 Instance from Snapshot
  4. Stop the new EC2 Instance
  5. Detach the root volume from the Instance
    • To identify root volume follow steps [a-d] from #2
    • Go to volumes
    • Type the volume ID in “Search Volumes” field
    Restore EC2 Instance from Snapshot
    • Check the root volume on the list
    • From “Action” select “Force Detach Volume”
    Restore EC2 Instance from Snapshot
  6. Create a new volume based on the snapshot identified in #2
    • Go to snapshots
    • Find the new snapshot
    • From “Actions” select “Create Volume”
    Restore EC2 Instance from Snapshot
    • Select appropriate type of Volume (Standard or IOPS)
    • You can enter the bigger size if needed
    • Availability zone must be the same as the one where a new EC2 instance was launched in
    • Click “Create”
    Restore EC2 Instance from Snapshot
  7. Attach the new volume
    • Go to volumes
    • Select the volume that was created in #6
    • From “Actions” select “Attach volume”
    • Restore EC2 Instance from Snapshot
      • In Instance field select the instance created in #1
      • In Device field type /dev/sda1
      • Click “Attach”
      Restore EC2 Instance from Snapshot
    • Start Instance
Here is much shorter version to achieve the same task using Elastic Cloud Gate console:
  1. Under the EC2 section, expend volumes under the instance from which the root snapshot was taken from. The root volume will be shown in bold.
  2. From the menu select snapshots.

    Restore EC2 Instance from Snapshot
  3. In the new window from the menu select “Create EC2 Instance”.

    Restore EC2 Instance from Snapshot
  4. Set the configuration of the new EC2 Instance as well as what AMI option should be used as the base for the new EC2 Instance.
  5. Click “Launch”.

    Restore EC2 Instance from Snapshot

No comments:

Post a Comment