Adventures of Moving MIM lab to Azure using Nested Virtualization

Hello All today I wanted to share my experience in moving my lab and demo and environment that some might know it is very big and well robust. I use it for a lot of MIM demo and reproducing actual customer issues.  The lab is mix of on-premise and Azure.

image003

The very first thing is to understand what I needed from VM size standpoint. As my demo environment is in azure but I wanted to consolidate to a single VM and data storage

First I downloaded a tool called Microsoft Azure Storage Explorer and Red gate(Azure Explorer) all that are free to look at your blob storage and download the vhd from azure

Once connected with azure Storage Explorer I look at my storage account and click on Folder stats

image

Now know what we need now in storage so then I head over to my azure subscription to get my Hyper-V server created. For more information on the Dv3 and Ev3 VM you can read Microsoft announced the availability of these Azure VMs

Once in Azure I open the New Blade and select ‘Windows Server 2016 Datacenter’  click create

image

Specify the basic information

image

Then Select my server size ‘E16S_V3’. One nice thing is you see the average cost if you leave the machine running. But in my case because it is lab I will have a nightly shutdown to save power and $$. Again I equate it to how much power would I be using if I hosted it in a server in my house ?? Again I will let you do the math.

image

We will select ‘Select’ and then update and confirm the IP doesn’t collide with my current lab IP. Also you can configure optional items like Guest diagnostic and auto shutdown

image

Once build we will need to add more storage disk(Data disks) to the MIMDEMO VM. Navigate to the VM and select Disk and Add what you need. We will use windows storage pools and create pool Mirror

image

Now we created the Disk in azure I logged into the MIMDEMO Machine and added my pool.

image

Now comes the fun part downloading all those vhd from my azure machines. For me I shutdown all them during this copy so that all vhd are not being used. I went back to the Microsoft Azure Storage Explorer and began to download the vhd.

image

Next step after downloading is windows update and then start the Hyper-V configuration. Once logged into the Hyper-V open elevated PowerShell and run the following command

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools –Restart

image

Once restarted you will see the Hyper-V role

image

Next we need to configure the VMSwitch,Network of the VMswitch and Nat and finally the default path to VM to be stored on the pooled storage we created earlier. The four PowerShell is below for more on the PowerShell modules used see reference

New-VMSwitch -SwitchName “NATSwitch” -SwitchType Internal
New-NetIPAddress –IPAddress 10.0.0.1 -PrefixLength 24 -InterfaceAlias “vEthernet (NATSwitch)”
New-NetNat –Name MyNATnetwork –InternalIPInterfaceAddressPrefix 10.0.0.0/24
Set-VMHost -VirtualHardDiskPath V:\VMs -VirtualMachinePath V:\VMs

image

Once complete we then start create the MIM VM and attached existing storage . Lets launch Hyper-V and then create the first machine in this case lets start with the Domain Controller ‘CORPDC’. In the Console select ‘NEW’ enter the name of the VM and select the appropriate VM(vhd). As a note I have I have already moved this VM to the VirtualHardDiskPath location defined in earlier PowerShell.

imageimage

We are not done quite yet as in azure all VM are assigned a DHCP address so you will need to login locally and update the IP address to the VM and then reboot. Also you will need to update the pagefile setting on the machine as well.

image

Now we are ready to do this sever dozen times and the LAB will be complete and hyper-v hosted in azure. fantastic my next article around this is creating a template to host multiple ‘MIMDEMO

Cheers Steady

David Steadman has written 40 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>