AWS is the leading Infrastructure as a service (IaaS) provider. As such, one of its key advantages is that AWS infrastructure is readily available across the globe. This spread of AWS data centers is divided into regions and zones, that aid in achieving availability and disaster recovery capability. One component of AWS’ IaaS is Amazon Elastic Block Store (Amazon EBS), which provides persistent block storage and is used with Amazon Elastic Compute Cloud (Amazon EC2) instances. EBS also provides an option to create point-in-time snapshots. Snapshots are ideally suited to back up and restore data to achieve DR capabilities. Additionally, the snapshot copy feature allows you to copy data to a different AWS region. This is very helpful if your current region is unreachable or there is a need to create an instance in another region; you can use this option to start your application from the added region. You can then make your application highly available by setting the failover to another region. This article demonstrates how you can copy a snapshot across different regions to reduce downtime. After taking a snapshot of your existing volume, you can then copy the volume to a separate region and attach it to a new instance, increasing the availability of the data.
- Launch an EC2 instance. In this example, we launched a Windows 2012 based EC2 instance with an EBS volume as the root device.
- The EC2 instance contains the following data: Go to the AWS management console and select ‘EC2’. Go to ‘Volumes’ and select the volume attached to the instance. Take a snapshot of the volume. Using CLI: aws ec2 describe-snapshots –snapshot-id snap-a67fd02b
- Select the snapshot you’d like to copy to another region.
- Copy the selected snapshot from US-East-1 to Asia Pacific (Sydney). Using CLI: aws –region ap-southeast-2 ec2 copy-snapshot –source-region us-east-1 –source-snapshot-id snap-a67fd02b –description “This is my copied snapshot.”
- Change the region from US East (N. Virginia) to Asia Pacific (Sydney) in the AWS Management Console to determine whether or not the snapshot was successfully copied to the Sydney region. You can check and set the current region with the CLI command aws configure If you do not want to change your access and secret access keys in the command above, press ‘Enter’ and provide your new region name in place of the default region name.
- The copy of the US-East-1 snapshot is visible in the following wizard under the snapshot area of the EC2 dashboard in the Sydney region. Using CLI: aws ec2 describe-snapshots –snapshot-id snap-699fc27f
- Create a volume from the snapshot in the Sydney region and attach it to the EC2 instance that is running in the same Availability Zone (AZ). With the help of the snapshot copy utility, we can verify that the data that was available in the N.Virginia region is now available in the Sydney region.