Hyper-V: Shared Nothing Live Migration between clusters

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.”

SN-Error-Clustered

In Failover Cluster Manager, expand the Cluster, click on Roles.

Find the appropriate VM, right click on the VM, click Remove.

SN-RemoveFromClusterMgr1

Click Yes to acknowledge the warning.

SN-RemoveFromClusterMgr2

Step 2: Move VM

In Hyper-V Manager, right click the source VM, click Move.

SN-Move-01

If you get the ‘Before You Begin’ page click Next

SN-Move-02

Check ‘Move the virtual machine’.  Click Next.

SN-Move-03

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.

SN-Move-04

Check ‘Move the virtual machine’s data to a single location.’  Click Next.

SN-Move-05

On the destination computer, select a destination location for the VM files.  Click Next.

SN-Move-06

Review the ‘Summary’ page.  If all is ok, click Finish.

SN-Move-07

Monitor the move status.

SN-Move-08

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s