Simultaneous Shared-Nothing Live Migration With PowerShell

Hello Folks,

As you know Microsoft introduced Shared-Nothing Live Migration back in Windows Server 2012 Hyper-V.

For those who are new to this feature, shared-nothing live migration allows an administrator to move a running Virtual Machine from Host A to Host B and optionally it’s storage with just an Ethernet cable without the need to have any shared storage, this is awesome!!!

The requirements for enabling Shared-Nothing Live Migration are fairly simple:
  • You need minimum two Server 2012 or 2012 R2 installations with the Hyper-V role enabled or free Microsoft Hyper-V Server 2012/2012 R2 OS.
  • Each server must have access to its own location to store VMs. This location can be local or SAN-attached storage or a Server Message Block (SMB) 3.0 share.
  • Servers must have the same type or family of processor (Intel or AMD) if you’re using the VM’s Processor Compatibility feature.
  • Servers must be part of the same Active Directory domain.
  • Servers must be connected by at least a 1Gbps connection (a separate private network for live migration traffic is recommended but not necessary), over which the two servers can communicate.
  • Each Hyper-V server should have the same virtual switches defined with the same name, to avoid errors and manual steps when performing the migration, and by leveraging the usage of Ethernet Resource Pool you can live migrate without worry about different virtual switch name.
  • VMs that are being migrated must not use pass-through storage.

Let’s assume you meet above requirements, the next step is to enable the Hyper-V hosts for incoming and outgoing live migrations and you are good, but don’t forget the authentication stuff (CredSSP or Kerberos) since we will not cover these here as they are beyond the scope of this post.

More information about Shared-Nothing Live Migration can be found here.

Now if we need to move a VM from host A to host B, how can we accomplish this??? fairly simple using Hyper-V Manager console.

Right click and move…

SN-LM01

Shared Nothing Live Migration through PowerShell

The PowerShell cmdlet to move a VM can be considered one of the easiest options on Hyper-V, because the entire process is just one line of command:

Move-VM –Name VM01 –IncludeStorage –DestinationHost HVSRV02 –DestinationStoragePath D:\Hyper-V\

Let’s assume you need to evacuate all Virtual Machines from one host to another as early as possible.

Unfortunately there is no such a way doing this using the UI, you need to select one VM at a time and then move it to the second node.

What about Live Migrating Multiple Virtual Machines Simultaneously?

PowerShell is the answer…

SN-LM02

SN-LM03

One important note to mention: when you enable Hyper-V hosts for incoming and outgoing live migrations, the default simultaneous migrations is set to 2 by default, you need to maximize that number to meet your requirements, and there is no one stopping you configuring 100 simultaneous live migrations. When you have only one, two or even four 1Gbps NICs available, but you might stick to 2 or 4 migrations per available 1Gbps, and why limit yourself if you have one or multiple 10Gbps, 40Gbps or even 56Gbps Smile, and sure enough bigger pipes are better than smaller ones but your CEO/CIO will be happy paying more $$$  Winking smile.

Until then, enjoy your day!

Cheers,
/Charbel

About Charbel Nemnom 280 Articles
Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

Be the first to comment

Leave a Reply