Introduction Got tasked to do an emergency Azure migration from a failing ESX server. Found several ways to do this but the one that ...
Introduction
Got tasked to do an emergency Azure migration from a failing ESX server. Found several ways to do this but the one that worked was Virtual Machine Converter 3.1.
One challenge after another but after getting all the Azure management certificates and the 2012 R2 Server setup to run the VMC 3.1 from it fell in line and worked like a charm.
These are the steps if you want to migrate to Azure VM with your existing 2008 R2, 2012 or 2012 R2 server.
Steps (19 total)
I like to do this from a clean server that is not in anyway production. This way you can limit the load if needed so that production stuff stays as fast as possible.
Install a new VM on the ESX or Hyper-V server you want to convert from for best performance.
If that is not possible getting a 2012 R2 server on the same LAN is fall back option 1.
If that is not possible then you can use Pertino Cloud VPN and spin up a new Azure VM 2012 R2 and attach that to your domain for the convert. Much slower but gets the job done if options 1 and 2 are not available.
If that is not possible getting a 2012 R2 server on the same LAN is fall back option 1.
If that is not possible then you can use Pertino Cloud VPN and spin up a new Azure VM 2012 R2 and attach that to your domain for the convert. Much slower but gets the job done if options 1 and 2 are not available.
Using the Server Manager add the two features for .Net 3 and 4. I installed all the sub-options for those two .net installs.
Latest version is 3.1 located here
https://www.microsoft.com/en-us/download/details.aspx?id=42497
https://www.microsoft.com/en-us/download/details.aspx?id=42497
Now run all available Windows Updates and reboot
Two situations exist.
1) If the Virtual Machine you are converting is attached to a domain then this VMC 2012 R2 server needs to be attached to the same domain. This is to allow the VMC to login and uninstall VMWare Tools. I have not been able to add a local administrator user and get this step to proceed. Adding the 2012 R2 VMC server to the domain worked fine after I logged into the 2012 R2 VMC server as a domain admin.
2) VM is not domain joined and in that case you can leave this 2012 R2 VMC box off the domain and local administrator accounts will work.
1) If the Virtual Machine you are converting is attached to a domain then this VMC 2012 R2 server needs to be attached to the same domain. This is to allow the VMC to login and uninstall VMWare Tools. I have not been able to add a local administrator user and get this step to proceed. Adding the 2012 R2 VMC server to the domain worked fine after I logged into the 2012 R2 VMC server as a domain admin.
2) VM is not domain joined and in that case you can leave this 2012 R2 VMC box off the domain and local administrator accounts will work.
This is the part that I spent over an hour getting right. The basic idea that none of the docs seems to tell you is you can use the Azure PowerShell Module to create, download and import your management certificates without having to create one using MakeCert.exe. Ignore any docs you see related to MakeCert as the PowerShell command does this all for you.
Find the Azure PowerShell Shortcut and pin it to your taskbar.
Right click on Azure PowerShell and choose Run As Administrator
Type the following command and hit enter
Right click on Azure PowerShell and choose Run As Administrator
Type the following command and hit enter
Get-AzurePublishSettingsFile
This will launch a browser and ask you to login to your Azure Portal with Global Administrator creds and then create and download your XML publishsettings file for import in the next step.
When the file downloads the name is very long and I usually just rename it to AzureSettings.publishsettings to make it easy for the import.
Usually the download ends up in your downloads folder so find the file path and make note. Then run the following command replacing the path with the one that is correct.
Import-AzurePublishSettingsFile -PublishSettingsFile "C:\User\Administrator\Downloads\AzureSettings.publishsettings"
*Note- The Azure File name is case sensitive and needs to be spot on for this command.
Open MMC and add the certificates snap in for your local user account (My)
Get into the Personal Store at the top and find the new Azure certificates that just got added. If you have more than one subscription, (i.e. Pay-As-You-Go or Microsft-Partner-Account) be sure to choose the one you want the VM on and then right click and export the cert to .cer. Make note of where you saved it for the next step
In that same MMC / Certificates window drill down to Trusted Root and Import the cert that you just exported from your personal store so it is trusted.
Hit Yes when prompted are you sure you want to do this.
Hit Yes when prompted are you sure you want to do this.
Browse to
https://manage.windowsazure.com
and login as your Global Admin
1) Click Subscriptions in the upper right then click Manage Subscriptions / Directory at the bottom of the flyout menu.
2) Choose Management Certificates at the top bar and you will see your list of management certificates. Find the most resent one by Date stamp and all you need to do is copy the Subscription ID and Thumbprint to a text file for use with VMC 3.1
*Note - Thumbprint is case sensitive and needs to be in all caps to work.
https://manage.windowsazure.com
and login as your Global Admin
1) Click Subscriptions in the upper right then click Manage Subscriptions / Directory at the bottom of the flyout menu.
2) Choose Management Certificates at the top bar and you will see your list of management certificates. Find the most resent one by Date stamp and all you need to do is copy the Subscription ID and Thumbprint to a text file for use with VMC 3.1
*Note - Thumbprint is case sensitive and needs to be in all caps to work.
Using the IP/DNS of your ESX host that is holding the VM you want to convert, open a browser and download then install the VMware Client Console Application.
After install open the app and connect to the ESX host with the Root login.
Find the VM you want to convert and make note of the Total HDD size and resource allocations. It is very important you have enough space on the 2012 R2 VMC machine to hold two copies of the data being migrated.
After install open the app and connect to the ESX host with the Root login.
Find the VM you want to convert and make note of the Total HDD size and resource allocations. It is very important you have enough space on the 2012 R2 VMC machine to hold two copies of the data being migrated.
Now the fun begins and you can get started with your migrations. This is best done afterhours as it will have downtime associated with the VM you are converting. This downtime is only for the snapshot, uninstall VMware tools, transfer / convert the disk to the 2012 R2 server and then restore the snapshot. The tool does all this for you but speed of servers, network activity and physical distance between the VM and the VMC servers will affect time to restore production.
THIS ONLY WORKS FOR 2008 R2, 2012 AND 2012 R2 VERSIONS OF WINDOWS SERVER.
THIS ONLY WORKS FOR 2008 R2, 2012 AND 2012 R2 VERSIONS OF WINDOWS SERVER.
First page is notes hit next
Second Page is your Azure ID and Thumbprint - Copy and paste this from your notepad you created in step 13
Third Page is your storage account. Choose the datacenter closest to the end users that will need this VM. In my case I choose EastUS.
Fourth Page is your ESX host where the VM resides- enter the IP address and root login
Fifth Page is the list of VM's on the ESX host you want to migrate. Choose the one you want and hit next
Sixth Page is where you enter the creds to uninstall VMware tools - if this VM is domain joined you are best to have the VMC 2012 R2 server joined to the same domain for this step to proceed. If not domain joined than you can use a local administrators account.
Seventh Page is the local path you want to store the converted Virtual Disks. Be sure this had enough free space to handle twice the size of the converted VM.
Confirm page then hit start / go
Second Page is your Azure ID and Thumbprint - Copy and paste this from your notepad you created in step 13
Third Page is your storage account. Choose the datacenter closest to the end users that will need this VM. In my case I choose EastUS.
Fourth Page is your ESX host where the VM resides- enter the IP address and root login
Fifth Page is the list of VM's on the ESX host you want to migrate. Choose the one you want and hit next
Sixth Page is where you enter the creds to uninstall VMware tools - if this VM is domain joined you are best to have the VMC 2012 R2 server joined to the same domain for this step to proceed. If not domain joined than you can use a local administrators account.
Seventh Page is the local path you want to store the converted Virtual Disks. Be sure this had enough free space to handle twice the size of the converted VM.
Confirm page then hit start / go
This step will take time wait until you see it at least progress to converting disk and then you can walk away for a break. Size of the VM being converted is directly proportional to the time it will take to complete this task.
The wizard will then analyze the converted disks and if good will then revert the snapshot, putting the old VM back to its original state so you can go back to work if needed while the upload to Azure completes.
If possible leave this old VM offline while your converted one uploads but if you really need to you can bring the old VM back online in a pinch to get back to work. you will need to manually copy any changes or data if you do.
If possible leave this old VM offline while your converted one uploads but if you really need to you can bring the old VM back online in a pinch to get back to work. you will need to manually copy any changes or data if you do.
After the VM Disk is uploaded you need to create the size VM you want and attach the disk.
Go to VM
Click New and choose Gallery
Choose My Disks at the bottom and then set the VM name and size and fire it up.
Endpoints will need to be added as well so be sure to record all the ports need so you can open them up.
Go to VM
Click New and choose Gallery
Choose My Disks at the bottom and then set the VM name and size and fire it up.
Endpoints will need to be added as well so be sure to record all the ports need so you can open them up.
Conclusion
Still refining these steps but this works for me on 10 different VM's to Azure and I hope it gives you the basics to get started
No comments
Post a Comment