How to Migrate an Amazon AWS Machine to Azure
March 20, 2014 5 Comments
This post will show how to move a VM from just about anywhere including Amazon AWS to Microsoft Windows Azure easily and for free using the Windows Azure Migrator tool available here:- http://www.azuremigrator.net
In order to carry out the steps below there must be a VM running in Amazon so you will need an Amazon account and Administrative RDP access. There should also be an Azure account in which to move it to of course.
- Log into the Amazon AWS virtual machine using RDP and open up http://www.azuremigrator.net in the browser.
- Click on install to set up the components or launch if this has already been done previously. Run the setup.exe program.
- Click Install
Once installed select the mode, we are going to Move the VM to Azure so click the second button.
- First a snapshot is created locally, currently only the OS drive is available, select Temp Storage location which has enough space for the VHD (Approx 17GB for a Win 2008, small image without too much installed on it). Click
- and wait for the creation to complete, you will see the drive being created on the Temp Storage location specified.
- This process took around around 10 minutes.
- Click Next and enter the Azure Subscription ID that you wish to move the VM to.
- Click Create Certificate and an Explorer windows will open with a new certificate, copy and paste this onto your own computer ready to upload to Azure.
- Here we see I have copied the file to my desktop (simply right click, copy and paste onto your desktop).
- Log into your Windows Azure account and select Settings and find your subscription as shown here.
Select Management Certificates and click the Upload button.
Browse to the desktop folder or wherever the cert was saved and upload.
Wait for upload to complete.
Once uploaded test the connection from within the AWS machine and you should see a green tick appear .
If not check the correct certificate was upload or create and upload another.
Select the Storage account and container you wish to place the VM in. Pretty cool.
Click upload to send the VHD to Azure.
Once complete it will show “Upload Complete” and you will be able to see your VHD in Azure !
Azure Storage account shows the VHD at the bottom here. Very nice.
Now for some really smart stuff. Select a new cloud service or an existing one, select affinity group, network and machine size ! A suggestion to the developer from me would be to add a subnet selection option in a future release but this is already awesome.
Click “Create VM”
You should see the VM now being created if all parameters such as subscription limits etc are met. Here we see our machine in place and starting up and part of the cloud service (infdpm) specified in the migrator tool.
If we click on Configure once the VM is in the running state we can see the size is correct and the virtual network. We can also now select an availability set if required.
We can also now connect to the VM using RDP.
Note the VM in Amazon still exists so shut down or remove if you want to save costs. To show the successful migration, here is a mess-with-your-head screen shot of a connection to the VM in Azure FROM the original VM in Amazon. It would sound better if I wrote a connection to itself but it’s not strictly true as it’s just a copy of it !
And here is a direct RDP connection to the Azure VM from my desktop just because.
Additional Notes and Reference
Here are the program files with the AWS tools on the machine.
The tools still remain as part of the VM so if the VM will not go back into AWS then it would be best to remove these. Currently Azure has the option to install the Azure (Hyper-V) agent for new VMs but does not provide an installer at the moment for existing ones but I suspect this will be available at some point in the near future.
My Suggestions for future releases the Migrator Tool
Here are just a few suggestions, none of them biggies and the application is perfectly fine without these to get the VM across and any changes can be done afterwards in Azure
- Allow user to specify Subnet for new VM in Azure
- Allow user to specify Availability Set
- Create a a Back Button to use from within the utility
- Allow for multiple drives to be sent across and mounted correctly when new VM is created.
- Option to remove AWS Agent software (when VM is created) if desired.
All in all a very useful tool for those looking to migrate from AWS without significant costs or headaches which we all want to avoid. Thank you for reading. In the next post I will go through moving the Azure VM from one subscription to another. If you have any ideas for the tool do share below.
You can not connect to the VM or it is not created in Azure. Ensure you clicked the CREATE button and CREATE VM buttons in the wizard.
Not enough space error
Add another volume with sufficient space and use that for the temporary location.
Do add another disk volume, from the EC2 dashboard select Volumes and Create Volume
Ensure the disk you create is in the same region as the VM instance ! Here I create a 30GB drive which then presents itself in the AWS machine. You will then need to go into disk manager in Windows and format the drive to make it usable.
Once the new disk status becomes available right click and Attach to your VM instance.
Once the status in your console changes from attaching to attached the disk will be available for use in Windows.
Log into the VM and open Computer Management from the start menu (Windows 2008/R2) For windows 2012 just right click the lower left of the screen to open disk manager directly.
Once in Disk Management the popup will appear as Windows has detected a new disk. format it in your usual way.
Right click format and once complete the drive is available.
Error creating bootable partition.
This error is displayed when you click upload. Press OK and the program will just continue ok.
Unhandled Exception The Subscription Policy limit for ‘cores count’ was exceeded.
Check your “In Use” Core count in Azure and shut down VMs not in use, increase or select appropriate size VM for the new machine.
To check limits in Azure go to Settings, select Usage in the top line of options.