Moving Azure VMs to on-premises servers


Many IT pros have become experts at migrating an on-premise server to Microsoft’s Azure cloud. For those who haven’t but want to, there are a lot of tutorials on how to do it. But what if you want to move your virtual machine from Azure back to your on-premise environment? There’s not much information on how to do that, but today you lucky here. In this article, share with you a step-by-step guide to do just that. The on-premise environment we will be using is Windows Server 2016 and a Hyper-V cluster.

According to my way, there are a couple of ways to move a VM from Point A to Point B. We will focus on a simple but effective method that can be applied to small to medium migrations. We will be doing everything manually, but we can optimize a good deal of the tasks later on.

The entire process consists of three tasks, and those are: assessment of the Azure environment, copying the VHD, and, finally, creating the VMs to match the previous assessment.

1.   Assessment of the Azure VM
2.   Copying the VDH files
3.   Last one finishing and creating on-prem

Assessment of the Azure VM

The assessment phase is key to save time during the 07ansition process. The idea is to create a Word or Excel file to document all the information gathered on this phase and use it during the 07ansition process.

Although we will create new VMs in the on-premises environment using the disks that were being used in Azure, we must make sure that the CPU, memory, and disk names are properly documented.

During this article, a goal is to 07ansition the entire SharePoint test environment, and the first task is to check how many VMs are involved in the process. If you have organized your environment using Resource Groups, then for you this step is a piece of cake. List the Resource group and all vms in use will be listed. 

The second step is to stop all the VMs that will be migrated. Keep in mind that this will bring the service down, and such outage must be planned and, of course, your end-users must be informed. To do that, just click on the desired VM, and on the new blade click on Stop and then Yes. 



The third step is to document the current utilization of memory and CPU. This can be accomplished by clicking on the desired VM and then clicking on Overview. On the new blade that is displayed on the right side, we will have the size, Which gives us that result.  

The final step of the assessment is to identify the disk names. This can be done by clicking on Disk. On the new blade, a list of the OS disk and Data disk that are in use by the current will you will see. You need to click on each en07y on the left and will then copy the disk name listed on the blade on the side. I hope all Azure engineer familiar about these steps.

The results of the current assessment should be a table like the one below, where we have all the information required to create the new VM on-premises and associate the correct disks to them.

<07> <07> <07> <07> <07> <07>
Server
Memory and CPU
OS disk
Additional disks
AZNASPAP001
14 GB and 4
AZNASPAP001201984747637.vhd
AZNASPAP001-disk-D.vhd
AZANSPDCA01
14 GB and 4
<07>
AZANSPDCA011201610215313.vhd
AZANSPDCA001-Disk-D.vhd
AZANSPSQL01
28 GB and 4
AZANSPSQL01987459873245.vhd
AZANSPSQL01-disk.D.vhd
AZANSPSQL010disk-E.vhd
AZNASPSRC01
14 GB and 4
AZNASPSRC01987943092834.vhd
AZNASPSRC01-Disk-D.vhd
AZANSPWEB01
14 GB and 4
AZANSPWEB0129843021938210.vhd
AZANSPWEB01-Disk-D.vhd

Copying the VDH files

The second phase consists of using Microsoft Azure Storage Explorer utility. (You can use this link to download it, and it can be used on Windows, Mac, and Linux.) The installation process is simple and does not require any additional configuration. Just use the default values.
To make things easier, we will create a volume to hold the VMs from the SharePoint test environment, which happens to be all the VMs that are in Azure. That volume is being shared among all nodes of the Hyper-V cluster on-premises.

After opening the Microsoft Azure storage explorer, click on the second icon to configure an account, This process will create authentication with the Azure service.  After it is authenticated, a list of all storage objects will be seen on the left side, Expand the ones related to the VMs to be 07ansitioned, then expand Blog containers, and then vhds. Select each VDH listed on the right side and click Download. 



Each download will be listed on the bottom right side with its respective progress on the copy process. Wait to get all of them completed before moving forward to the next phase of the 07ansition.

Last one finishing and creating on-prem


The easiest way to create a VM using an existing disk that is already stored on the volume where the future virtual machine will reside is using the Failover Cluster Manager. This is the way to go even if you have Virtual Machine Manager implemented.
The process is simple. Log on to the Failover Cluster Manager, right-click on the Roles, and click on Virtual Machines… and then click on New Virtual Machine… A new window listing all nodes will be displayed. Click on any available node and click on OK.

In the Before you Begin welcome page, just click Next.
In the Specify Name and Location page, type in the name of the VM and define the location to be the root folder of the volume that contains all disks. Click Next.

In the Specify Generation page, select Generation 1 for now and click Next. Note: We are going this way because these days virtual machines in Azure are created using VHD. We could convert the disk to VHDX and then use Generation 2, but for the sake of simplicity, we will not change the disk format for the purposes of this article.
In the Assign Memory page, use the same amount of memory that the VM used to have on Azure and click Next.
In the Configure Networking page, select the Virtual Switch used by the VMs and click Next.
In the Connect Virtual Hard Disk page, select Use an existing virtual hard disk and click Browse. Go to the volume that has the OS Disk that we already copied from Azure and select it. Click Finish. Note: For now, we will configure just the OS Disk.


A new wizard to configure the High Availability will be displayed. Just use the default values to complete this part of the process.
Now, let’s go back to the main page of the Failover Cluster Manager. Right-click on the virtual machine that we have just created and click on Settings. In the new page, select IDE Con07oller 0, select Hard Drive and click on Add. A new disk will show up underneath the existing IDE Con07oller. Click on Browse… and select the data disk available. You can repeat this process if the VM has additional disks. 

Before hitting OK on the VM setting, click on Processor and match the number of CPUs that this new machine will have with Azure configuration.

Final touches and testing after all important

Now that the VM was created, it is time to fire it up. After the initial boot, the adminis07ator must work on some minor details:
·       Page file
By default Azure uses Temporary Storage on drive D: and as you may have noticed, we didn’t copy the Pagefile. So, we need to create a new one or configure it properly
·       Time Zone configuration
Make sure that the Time Zone configuration is set accordingly with the site of the new VM
  • IP configuration
    The VM is using DHCP because we created a new VM. By doing that, a new network adapter was associated to the operating system. Make sure to configure the IP and wait for the DNS replication to take place and then update the en07ies.

Don’t forget and its advisable also After testing the entire process and making sure that your VMs are up and running on the on-premises environment, it is time to do some house cleaning. Specifically, this means the removal of the former VMs from Microsoft Azure. Please feel free to write comments if any or would help to help you more on this. Till then stay bless and connected.  Regards/Shiv 

Comments

Popular posts from this blog

The request has both SAS authentication scheme and 'Bearer' authorization scheme. Only one scheme should be used

Getting Started with Logic Apps - AS2

How to Debug and Trace request in Azure APIM - Portal, Postman, RequestBin