Moving VDI Deployments: Step 1 – Discovery

This one of several posts focused on how you might migrate an existing VDI deployment to Azure Virtual Desktop on Azure Stack HCI. This post is focused on reviewing and collecting some of the necessary information for migrating existing personal desktops from my example RDS deployment to AVD on HCI.

Just to recap, here’s what my “infrastructure” looks like:

My current RDS deployment has all the personal VMs deployed on a single virtualization host:

…which we can see all the VMs in Hyper-V manager as well:

It’s great that we can see all these VMs in the various GUI tools, but what we really need is to access the infrastructure programmatically.

The good news is that all the information you should need is available via PowerShell! Everything I did was able to accomplish by pre-installing the following modules:

Install-Module AZ
Install-Module -Name Microsoft.RDInfra.RDPowerShell
Install-Windowsfeature Hyper-V-PowerShell
Install-Windowsfeature Hyper-V-Tools	

I also needed some Active Directory related PowerShell, but when I ran those commands what I needed auto installed (and I missed what the module was!).

Pulling the necessary RDS info for my deployment was pretty simple, I just needed the name of my RDS Connection broker as an input:


$RDSBroker 	= "RDSInfra.gbbgov.us"

$Collection = Get-RDRemoteDesktop -ConnectionBroker $RDSBroker
# get the User / VM mapping
$Details = Get-RDPersonalVirtualDesktopAssignment -CollectionName $Collection.CollectionName -ConnectionBroker $RDSBroker
Write "VMs to be migrated (with assigned users)"
$details

$details has a wonderfully useful list of assigned RDS Personal VMs along with the corresponding users:

That list will be the gas to run my migration engine – I’ll loop through those VMs to move them from their existing Hyper-V host. I can also get all the Hyper-V hosts in my deployment:

# find the Hyper-V Hosts use for Personal VMs
$Servers = Get-RDServer -Role "RDS-Virtualization" -ConnectionBroker $RDSBroker
#I only have one host... so...
$Server = $Servers[0]

…but as noted in the comments, I only have a single Hyper-V host, so I haven’t bothered with the logic to figure out which VM is on which host.

Grabbing things like VM sizes (cores, RAM, VHDX size, other) could be useful for capacity planning on HCI, but I’ve got LOTS of space on my new HCI cluster… so I’m not going to bother with that.

Speaking of Azure Stack HCI, let’s move on to the next step – Installing Azure Stack HCI.