In order to demonstrate the replication of virtual machines between different data center as shown in my post below, I will create therefore in Azure a new Hyper-V server 2022 (virtual machine) for nested virtualization which then will act as a second data center besides my on-premise lab environment.

Create an Azure Hyper-V 2022 Virtual Machine for Nested Virtualization

In the Azure portal we can therefore search in the Marketplace for Hyper-V Server 2022 and select the template as shown below.

With Hyper-V running on Azure, you are now able to replicate Hyper-V virtual machines you have on prem to HyperV running on Azure. This provides full disaster recovery and a backup solution to your physical sites.

Deploy a Dv3 and Ev3 series Windows Server VM in Azure that supports nested virtualization, see article about the VM sizes here…


Create and attach a new disk for the virtual machines and their virtual disks and configuration files to be stored on later.

We also need to configure the virtual network our Hyper-V virtual machine will be placed to.

Configure the Hyper-V and DHCP Server Role

Now after the virtual machine is running we first have to install the Hyper-V role. I will further install the DHCP server role on the server in order to provide dynamic IP addressing for the virtual machines running on this Hyper-V server and virtual network.

Install-WindowsFeature -Name DHCP,Hyper-V –IncludeManagementTools

After a reboot we can start to configure Hyper-V.

The commands below will create a Hyper-V internal switch and set a nat rule and gateway for that virtual switch.


$switchName = "InternalNAT"
New-VMSwitch -Name $switchName -SwitchType Internal
New-NetNat –Name $switchName –InternalIPInterfaceAddressPrefix “”
$ifIndex = (Get-NetAdapter | ? {$ -like "*$switchName)"}).ifIndex
New-NetIPAddress -IPAddress -InterfaceIndex $ifIndex -PrefixLength 24

More details about how to set up a NAT network you can read the following article from Microsoft.
Set up a NAT network

In order new virtual machines using this internal switch getting by DHCP an IP address by default, we will configure below a new DHCP scope.

The commands below will create a DHCP scope for Hyper-V nat, assign gateway IP, DNS IP for that scope on the DHCP service and restart dhcp service.

Add-DhcpServerV4Scope -Name "DHCP-$switchName" -StartRange -EndRange -SubnetMask
Set-DhcpServerV4OptionValue -Router -DnsServer
Restart-service dhcpserver

Configure the dedicated SSD Disk to store Virtual Machines on

We also need to configure our previously added 1 TB SSD as storage for our virtual machines.

Here you can see the 1 TB SSD appearing in the Disk Management console of the virtual machine as Disk 2 below. In order to use it we first need to initialize it and then create a new NTFS volume on it.


How to Setup Nested Virtualization for Azure VM/VHD

Set up a NAT network