August 4, 2017
How to Back Up VMs to Amazon EBS in EC2
VM backup to cloud is one of the best solutions for a complete data protection cycle. This is where NAKIVO Backup & Replication is of great help, as it supports backing up VMs to clouds, like AWS. A simple scheme of backing up data to the cloud with NAKIVO Backup & Replication looks like this:
There are several ways to perform a backup to AWS cloud using NAKIVO Backup & Replication:
- Backup to Amazon EBS in EC2 with NAKIVO Backup & Replication
- Backup to Amazon S3 via Storage Gateway with NAKIVO Backup & Replication
In this post, let’s consider the first method. Refer to our video tutorial for a full walkthrough:
Backup to Amazon EBS in EC2 with NAKIVO Backup & Replication
Amazon Elastic Block Store (Amazon EBS) is a persistent block storage for Amazon EC2 instances. NAKIVO Backup & Replication can create a backup repository in AWS by using multiple Amazon EBS volumes. The EBS volumes can be attached to any AWS instance and must be in the same zone with this instance. EBS volumes are persisted independently from the life of AWS instance to which they were attached. Thus, Amazon EBS is the best choice, if you need long-term safekeeping and quick access to your data.
So, how do we, actually, create a backup repository in Amazon EBS?
First off, you need to create and download AWS Access Key ID and Secret Access Key. These are used by NAKIVO Backup & Replication to work with your EC2 instances and EBS volumes. To create an AWS Access Key ID and Secret Access Key, do the following:
- If you don't have an AWS account, create a new one at https://aws.amazon.com.
- Open the IAM console.
- In the left pane, click Users.
- Click your IAM user name (not the check box).
- Go to the Security Credentials tab and then click Create Access Key.
- Click Download Credentials, and store the keys in a secure location.
After you have created and downloaded the keys, do the following:
- Log in to the product’s web interface, then go to the Configuration dashboard.
- In the Inventory tab, click Add New...
- Choose AWS account.
- Fill out the fields:
- Display name: Enter the AWS account name, which will be displayed in the Inventory tab;
- Type: Choose AWS account;
- AWS access key ID: Enter the access key ID of your AWS account;
- Secret access key: Enter the secret access key of your AWS account;
- Click Add.
If everything is correct, you will see a new AWS account with the name you have chosen in the Inventory tab. In our case, it is named “AWS”.
In this step, you need to deploy a Transporter in AWS. The Transporter is an application which performs all of the tasks related to data protection and recovery. You can learn more about Transporters in our article NAKIVO Backup & Replication Components: Transporter.
To add a transporter
- Go to the Transporters tab and click Add Transporter.
- Choose Deploy new transporter (AWS EC2).
- Fill out the fields and specify parameters:
- Transporter name: Enter the name of the transporter
- Transporter type: Choose Amazon EC2
- Region: Select the target region for your Amazon AWS instanceNOTE: To select the proper target region, consider the location from which you are going to make backups. Select the closest region, if you need faster data transfer speed, or the furthest region, if you want to protect against potential data loss due to a disaster.
- Instance type: Select an instance type from the list. More powerful instance types, such as t2.medium, can process data faster, but will cost more.
- After filling out the required fields, click More options:
You will see the list of extended options of AWS transporter configuration. These are:
- Allowed traffic from: To improve security, you can specify one or more IP address ranges (CIDR), which will be able to connect to your Amazon instance. (All of the necessary ports will be opened automatically.) If you leave default values, any and all IPs will be allowed, which means anyone will be able to access your transporter. For security purposes, restrict the traffic only to trusted IP addresses.
- Operation mode: Here you need to select a preferable transporter operation mode. Select Always running.
- Click Deploy.
If everything is correct, you will see a new AWS transporter with the name you specified above. In our case, it is EC2 EU (Ireland).
On this step, we will create a new backup repository.
- Go to the Repositories tab and click Add Backup Repository.
- Choose Create new backup repository.
- Fill out the fields and specify parameters:
- Name: Enter the name of the repository;
- Assigned transporter: Choose the previously created AWS transporter (in our case, its EC2 EU (Ireland). The backup repository will be created in the same region where the transporter is located;
- Type: Choose Amazon EBS;
- Volume type: Select a preferable EBS volume typeNOTE: Cold HDD (sc1) is the cheapest volume type. For actual volume capabilities and prices, see Amazon AWS Documentation;
- Storage (GB): Enter the amount of disc space (in GB) to be used for the backup repository.
- Click Create:
If everything is correct, you will see a new backup repository in the Repositories tab, with the name you specified (that is, AWS EC2 repo).
Now you have a backup repository in the cloud. The best practice would be to create VM backups locally, and then set up a Backup Copy job that would copy your local backups to the cloud:
This way you will have a local backup for fast operational recovery and a copy in the cloud for disaster recovery. This approach is also more cost-effective than direct backup to cloud, consumes less WAN bandwidth, and needs less I/O operations in your Amazon AWS account.
Backing up data to AWS cloud cuts your costs and saves your time spent on building and maintaining an offsite backup infrastructure. Moreover, you get all benefits provided by the Amazon cloud, such as high-level security, almost 100% uptime guaranteed by Amazon (which is defined in the SLA), and the exact amount of storage space you need. To save costs and eliminate the need to wait for backups to be performed via a slow WAN, you can choose to copy cumulative weekly backups to AWS instead.
In our next article, we will describe another method to perform backups to AWS cloud with NAKIVO Backup & Replication – VM backup to Amazon S3 via Storage Gateway. So, stay tuned for our Blog updates!