AWS migration using the VM Import/Export service Part-3 Hyper-V VMs

Overview

In Part-1 we looked at the set-up required on AWS to prepare for the import of a VM. In part-3 we look at the steps required to be carried out locally at your site to export an Hyper-V VM to AWS ready for import. You need to have carried out the set-up tasks outlined in Part-1 for the process shown in this article to work.

 

Recap

From a migration standpoint probably the most common use case for migrating servers into AWS using these tools is the migration of test and development servers. I say that because the technique takes a view of a server at a point in time and the server should not be in active use. Often that is not so easy to do with production servers. As you will see from this article the initial process is somewhat long winded. Having said that quite a few of the steps only need to be done once.  There are a number of different ways of achieving the same goal. In my example here, I make use of the AWS CLI. Doing this gives some scope for scripting some of the process. Notwithstanding all that if you are going to migrate a reasonable number of VMs into AWS you should check out Amazon’s Server Migration Service (SMS). SMS provides a much greater degree of automation and it is a (semi) on-line migration method. You can read my article about SMS here.

How does it work?

You create an export of your source VM as an OVA, VHD etc. You then upload the server image to one or more Amazon S3 storage objects. Note AWS has a variety of different storage technologies. S3 (Simple Storage Service) is an object-based (file) storage repository. This is distinct from the Block level storage (EBS) that you will typically use as virtual disk images for your AWS virtual machines. It is not my intention to provide an S3 tutorial within this article, there is a lot of information about S3 available from AWS and other sources . However, one thing to note is that S3 objects are addressable via a Web URL (subject to you setting the appropriate permissions) You could even host a serverless Website with static pages on S3. Once you have you VM export file sitting on S3 you can then use the AWS VM Import/Export service to migrate it to an EC2 instance. The process flow is shown below

Setting up

As I said the initial process is quite long-winded. Here is a road-map of the steps. Some steps do not have to be done in the order I specify but you might as well stick to the ordering given here.

      1. Create a migration user in the AWS IAM console. You can use an existing user but I think it is neater to create a specific user for the import tasks
      2. Install the AWS CLI software on the system you will use to manage the migration (I am using a Windows 10 desktop)
      3. Create an S3 bucket to hold the source VM export (Again you can use an existing S3 bucket if you have one but it is cleaner to create one specifically for Import/Export use)
      4. Grant the migration user permissions for the S3 bucket and EC2 (including Import/Export) service
      5. Create your export file in the source environment
      6. Upload the source VM export to your S3 Bucket
      7. Create configuration JSON file as input to the Import service
      8. Tell the Import service to import the VM image
      9. Wait while it does it !
      10. Launch the AMI created as a result of the import
      11. Carry out any required VM reconfiguration

Create a Migration service user

You can, of course, use an existing AWS user but I think it is cleaner to create a user specifically for migration activities. Users are created using the AWS IAM console (Identity and Access Management) This article is not the place for an IAM tutorial. Some basic information can be found here https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorials.html

Also note that when you create the user you need to save the Access Key and Secret Access key that are generated when you create a user as you will need them for AWS CLI configuration.  These Keys are only used for API access and not for human logon to AWS. They can be down loaded as a csv file for later reference.

 

AWS CLI configure command

block level storage such as you would use with an AWS virtual server. If you

  •