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.
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).
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
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.
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.
It is very important to note that the snapshot copy functionality follows the incremental backup model of a snapshot. The first snapshot copy of a volume is always a full copy. Each subsequent snapshot copy is incremental. Therefore, only the blocks on the volume that changed since the last snapshot copy to the same destination are transferred. This helps in transfer cost savings and speeds up the process. However, you do also need to consider other cost implications at the same time. Copying a snapshot to another region will not only incur charges for the snapshot cost in the separate region but also charge for the data transfer between the regions.
In some cases, when you create an AMI of your application and due to certain application requirements, no further data backups may be required (such as app/web server which are not regularly updated). In that case, you can use the copy AMI function to copy an instance to a separate region.
This article demonstrates how to copy a snapshot to a separate region for DR. However, if a service could do this for you automatically, wouldn’t it make your life easier? N2WS Backup & Recovery (CPM) does just this. N2WS Backup & Recovery is an enterprise-class backup, recovery and disaster recovery solution for the EC2 compute cloud. It allows you to backup objects from multiple regions in a single CPM backup policy and choose a target region for DR. That way, all of the objects from the policy will be copied to your designated target region, unless they already exist there, during DR. You should define your recovery objectives in your local backup as well as DR according to your business needs. Additionally, CPM allows you to configure your policy so that data is copied once a day to another region, rather than every time a backup is run. As a result, CPM not only helps manage snapshots via its flexible policies, but also helps enhance DR.