Friday, January 15, 2016

Move any physical/virtual servers to Azure with free tools

Below are steps which can be taken to move physical/virtual servers to Azure. All tools used are freely available.


 Depending which architecture is being moved (physical/virtual) you might start on any of the steps below bypassing some of earlier steps (for example if you want to move Hyper-V managed server). I assume we are moving either from Vmware or physical machine for this flow.

1. Download disk2vhd tool and run on your target machine. Uncheck "VHDx" since Azure supports only VHD files.



2. Create new Virtual Machine and attach generated VHD file to it (Generation 1). Boot machine and uninstall any software which will not be needed in Azure. (Vmware tools for example)



3. Enable firewall for all networks and make exception for remote desktop


4.  If you have system reserved partition then delete it using instructions available on this link


5.  Install or update Hyper-V Integration services components and Azure VM agent (https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-extensions-agent-about/)



6. Make sure you HDD is not bigger then it needs to be once it'll be in Azure. For this to happen you need to defrag disk and move all the files to the start of HDD so you can shrink it to desired size. You will have to do offline defrag in some cases to move all the files to start of HDD. I used Puran Defrag for this purposes.


7. After resize you need to shrink OS partition in Windows to desired final size. 


8. Final 2 steps for VHD is to shrink it and convert it to Fixed size. I used VHDResizer for this purpose.

9. Upload your VHD to Azure storage. I use CloudBerry Explorer. For this you need to register account in Cloudberry by providing account name and key which you can find in Azure portal.
10. Upload your VHD file as Page Blob


11. After upload is complete, go to classic portal and add VHD like below


12. The last step is to create VM based on this VHD


If everything was done right then you will have exact image of you machine running in Azure cloud