How to Back Up VMs to Amazon S3 via Storage Gateway

In our first post in the series on how to back up VMs to Amazon Web Services (AWS), we examined in detail How to Back Up VMs to Amazon EBS in EC2. In this blog post, we are going to describe another method of using Amazon storage services to create an offsite VM backup repository and copy onsite VM backups to Amazon S3 via Storage Gateway using NAKIVO Backup & Replication.

Try NAKIVO Backup & Replication:

“Best of VMworld 2018” Gold Award Winner for Data Protection

To create a repository in Amazon Simple Storage Service (S3), you need to perform the following steps:

  • Deploy AWS Storage Gateway in your local infrastructure;
  • Connect it to an Amazon S3 bucket in the AWS Console;
  • Connect NAKIVO Backup & Replication to Storage Gateway via NFS;
  • Create the S3 repository.

AWS Storage Gateway and How to Deploy It

AWS Storage Gateway is a service that connects on-premises software with Amazon cloud storage to provide seamless integration between your on-premises storage infrastructure and the AWS storage infrastructure. The service supports three storage interfaces: file, volume, and tape, the first of which is just what we need.

File Gateway is a type of AWS Storage Gateway, which combines a service and virtual software appliance and allows storing and retrieving objects in Amazon S3 using file protocols, such as Network File System (NFS). The virtual software appliance (gateway) is deployed in your onsite environment as a virtual machine (VM), enables you to store your data in Amazon S3 via NFS file share, and provides you access to objects in the S3 storage as files. In our case, this virtual appliance will run on VMware ESXi (for this platform, File Gateway is distributed as an OVA image).

Let’s find out how to deploy File Gateway in your onsite environment.

Step 1

First, you need to download the OVA image.

  1. Sign in to your AWS account using your credentials (if you don’t have an AWS account, create a new one at https://aws.amazon.com).
  2. In the AWS services section of the AWS Console, click Storage Gateway.
  3. Click Get started.
  4. Select File gateway from among the available gateway types and click Next.Select File gateway type
  5. Select VMware ESXi from among the available host platforms and click Download image.Download image for VMware ESXi
  6. Exit the wizard (you will return to it later).

Step 2

Next, you need to deploy File Gateway as a VM from the downloaded OVA image.

  1. Log in to the VMware ESXi web interface. Right-click Virtual Machines and then click Create/Register VM to open the New Virtual Machine wizard.Create/Register VM in VMware ESXi web interface
  2. At the Select creation type step of the wizard, choose Deploy a virtual machine from an OVF or OVA file. Click Next.Select creation type
  3. At the Select OVF and VMDK files step of the wizard, enter the name for your File Gateway VM and then click the Click to select files or drag/drop field.Select OVF and VMDK files
  4. Go to the folder, which contains the AWS-Storage-Gateway-File.zip file downloaded at Step 1, unzip this file, and select the .ova file. Click Open.Open AWS-Storage-Gateway-File.ova file - 1
  5. Click Next.Open AWS-Storage-Gateway-File.ova file – 2
  6. At the Select storage step of the wizard, select the destination datastore where you want to deploy File Gateway.NOTE: The available storage space must be 250+ GB (you need 80 GB for File Gateway VM + 150 GB for future File Gateway cache).

    Click Next.

    Select storage for File Gateway

  7. At the Deployment options step of the wizard, choose Network mappings and Disk provisioning (select Thick). Click Next.Deployment options
  8. At the final – Ready to complete – step of the wizard, check all settings. Click Finish and wait until the deployment process is complete.Final Ready to complete step of the deployment wizard

Step 3

Next, you need to add additional storage, where the future Storage Gateway cache will be stored.

  • When the deployment process is complete, find your AWS-Storage-Gateway VM in the Virtual Machine inventory of the VMware ESXi web interface.AWS-Storage-Gateway VM in the Virtual Machine inventory
  • Right-click the name of your VM (in our case, AWS-Storage-Gateway), and then find and click Edit settingsEdit settings of your AWS-Storage-Gateway VM
  • In the Virtual Hardware tab, click Add hard disk, and then click New hard disk.Add new hard virtual disk
  • Set the capacity of the New Hard disk to 150 GB. Click Save.Set the capacity of New hard disk

How to Create an Amazon S3 Bucket

To keep your backup data in Amazon S3, you need to have an Amazon S3 bucket in place. You can create an Amazon S3 bucket by undertaking the following steps (if you already have one, skip this procedure).

  1. Sign in to the AWS Console using your credentials. In AWS services, find and click S3 (Scalable Storage in the Cloud).Find S3 in AWS services
  2. Click Create bucket.Create bucket
  3. In the Create bucket wizard, enter the unique name of the bucket in the Bucket name field. In our case, it is “nakivo-reposotory”. Click Create.Enter the unique S3 bucket name
  4. Verify that your new S3 bucket is listed among Amazon S3 buckets.The list of Amazon S3 buckets

How to Set an NFS Share Inside the Storage Gateway

Now you will learn how to connect your previously deployed File Gateway VM with the respective AWS Storage Gateway service and set the NFS share.

  1. Go to the AWS Console. Once again, find and click Storage Gateway in the AWS services section.Storage Gateway in AWS services
  2. On the AWS Storage Gateway page, click Get started.Get started with AWS Storage Gateway
  3. Select File gateway in the Select gateway type step of the wizard. Click Next.Select File Gateway type
  4. Select VMware ESXi in the Select host platform step of the wizard. Click Next.Select VMware ESXi host platform
  5. Now you need to connect the File Gateway VM deployed at Step 1 with the AWS Storage Gateway service. To do that, copy the IP address of your File Gateway VM and paste it into the IP address field.NOTE: You can find this IP address in the VMware ESXi web interface.

    Click Connect to gateway.

    Connect to gateway

  6. If the connection was successful, you can enter the name of the gateway into the Gateway name field and click Activate gateway.Activate gateway
  7. After the successful activation, you need to configure local disks for the local file gateway cache. Choose the 150 GB hard disk you previously created and select Cache in the Allocated to column.Click Save and continue.

    Allocate hard disk to cache

  8. Your gateway is successfully created, and you can find it in your Storage Gateway list. Now you need to create a file share. To do that, click Create file share.Create file share
  9. At the File share settings step of the Create file share wizard, you need to configure file share, in particular:
    • Gateway: Choose the Storage Gateway your created (in our case, it is “S3 Storage Gateway”);
    • Amazon S3 bucket name: Enter the name of the S3 bucket you want to use as the backup repository (in our case, it is “nakivo-repository”);
    • Storage class for new objects: Select the S3 storage class you need (in our case, it is “S3 standard”);NOTE: Before selecting the S3 storage class, see the actual pricing for each storage class on the Amazon S3 pricing page.
    • Access to your S3 bucket: Select the IAM role (in our case, it is “Create a new IAM role”).

    Click Next.

    Configure file share settings

  10. At the Review step of the wizard, set the following parameters:
    • Allowed clients: Specify the IP address/addresses that will have access to this share. For example, the zero-address 0.0.0.0/0 allows access from any IP. For security reasons, think twice before choosing this IP address.
    • Squash level: By default, this parameter is set to Root squash. If you leave it as is, you will probably have no access to the NFS share from NAKIVO Backup & Replication. So, choose the All squashes option.

    Click Create file share.

    Set correct security level for the file share

How to Create a New VM Backup Repository in S3 with NAKIVO Backup & Replication

You can store VM backups in Amazon S3 using NAKIVO Backup & Replication. To accomplish this, perform the following:

  1. Log in to the web interface of NAKIVO Backup & Relication and then go to theConfiguration

    dashboard. In the Repositories tab, click Add Backup Repository.

    Add backup repository

  2. Click Create new backup Repository.Create new backup repository
  3. To create a new backup repository in Amazon S3, you need to fill out several fields and configure the following parameters:
    • Name: Enter the name for the S3 repository you prefer;
    • Type: Select Remote NFS share;
    • Path to the share: Enter the path in the format: :/name_of_the_share_in_S3 (in our case, it is “nakivo-repository”).

    Click Create.

    Configure new repository parameters

  4. f the S3 repository creation was successful, you will be able to see and verify its parameters.Successfully created backup repository in S3 via Amazon Storage Gateway

You now have local VM backups for fast recovery and a copy of these VM backups in the cloud for disaster recovery. This approach is more cost-effective and reliable than direct backup to cloud. Moreover, it allows you to reduce WAN bandwidth consumption and needs less I/O operations in your Amazon S3 buckets.

NOTE: The cost of all Amazon AWS Services described in this blog post can be found on the AWS Cloud Services Pricing page.

Concluding Thoughts

As shown in this and related blog posts, NAKIVO Backup & Replication offers you several methods to copy your VM backup data to the AWS cloud. This can cut your costs and save you time building and maintaining an offsite backup infrastructure. With NAKIVO Backup & Replication and AWS cloud services, you can be ready to recover quickly from most disasters.

In the next blog post of this series, we will compare two methods: VM backup to Amazon EBS EC2 and VM backup to Amazon S3 via Storage Gateway with NAKIVO Backup & Replication. So, stay tuned for our Blog updates!

How to Back Up VMs to Amazon S3 via Storage Gateway
Rate this post

Share:

LinkedIn Google+