Requirement
I needed to move VMs between Hyper-V clusters (Windows Server 2016) with zero downtime and didn’t have the luxury of SCVMM to perform this task.
I used the ‘Shared Nothing Live Migration’ method to do this.
The key requirements are that the Hyper-V servers are joined to the same AD domain, and the virtual switch name is the same on source & target Hyper-V servers.
Step 1: Remove from Source Cluster
The VM needs to be removed from the source cluster, this doesn’t stop the VM running, it simply changes the availability from Highly Available to Standalone. If you attempt moving the VM without doing this, you’ll get the following error:
“The Move wizard cannot be opened because the virtual machine is clustered. To move the virtual machine within the cluster, use the Failover Cluster Manager.”
In Failover Cluster Manager, expand the Cluster, click on Roles.
Find the appropriate VM, right click on the VM, click Remove.
Click Yes to acknowledge the warning.
Step 2: Move VM
In Hyper-V Manager, right click the source VM, click Move.
If you get the ‘Before You Begin’ page click Next.
Check ‘Move the virtual machine’. Click Next.
Type the name of the destination computer, or use Browse to locate it. Click Next.
Note: if you specify the destination cluster computer name the move will fail. It must be the name of the destination Hyper-V host.
Check ‘Move the virtual machine’s data to a single location.’ Click Next.
On the destination computer, select a destination location for the VM files. Click Next.
Review the ‘Summary’ page. If all is ok, click Finish.
Monitor the move status.
PowerShell Method
I’ve used the Hyper-V Manager to perform the VM move. To do this via PowerShell, you’d run the following command:
Move-VM -Name [VM_NAME] -IncludeStorage -DestinationHost [DEST_HOST] -DestinationStoragePath [DEST_STORAGE_PATH]
- -Name: the friendly name of the VM to be moved.
- -IncludeStorage: specifies that both the VM & its storage are to be moved.
- -DestinationHost: the name of the Hyper-V host to which the VM is to be moved.
- -DestinationStoragePath: where all VM data is to be moved.
For example:
Move-VM -Name SteveTest1 -IncludeStorage -DestinationHost X500HV01 -DestinationStoragePath ‘C:\ClusterStorage\HVVMs2\SteveTest1’
Step 3: Add to Target Cluster
Now the VM has been successfully moved it’s necessary to made it Highly Available on the target Hyper-V cluster.
In Failover Cluster Manager, expand the Cluster, click on Roles.
On the Action page, click Configure Role.
If you get the ‘Before You Begin’ page click Next.
On the Select Role page, select Virtual Machines, click Next.
Select the appropriate VM, click Next.
Click Next to confirm.
Review the ‘Summary’ page. If all is ok, click Finish.
One comment