When migrating from Hyper-V to Azure Stack HCI, it's important to gather the right kind of information to support migration strategy moving forward. I created a short script to help with this process. When migrating, we need to know lots of information so we can ensure the correct settings are migrated, VMs are distributed to the correct target hosts & also plan how long it will take to migrate VMs. It will only gather all the data for Windows-based VMs and a subset for linux-based VMs.
I could have broken the script down into just 2 functions, but I left it at what it is now - it's easier to understand and very easy to add columns to the export by adding functions, then array members.
The script uses the VirtualMachineManager PowerShell module to gather information, so System Centre VMM is a requirements. The script will;
Create a list of the running VMs
Gather the VM data we need (listed below)
Prompt for a CSV file to save.
It gathers the following information;
The name of the VM
The number of CPUs assigned to the VM
The amount of Memory (in GB) that's assigned to the VM
Here's the script - hope it's useful..
What IP addresses are assigned to the VM
The ID of the VM (used if running the compare-vm or import-vm cmdlets and specifying the export xml file)
Whether it's a Generation 1 or 2 VM
The host that the VM is currently located on
The volume(s) that the disks are located
Number of Disks
The number of disks attached to the VM
Total Storage Size
The total size of all the VHDX files
Number of Checkpoints
Have any checkpoints been created?
Does it have a replica?
Whether therethere are any replicas of this VM on other hosts
Mac Address Type
Is the MAC address dynamic or static (may need remediation)
The assigned VLAN ID
Here's the script - you can download it here: Gather-VMData.ps1