Enable Live Migration using PowerShell

Learn the right way to enable Live Migration using PowerShell in Windows Server 2012.

John Savill

May 12, 2013

1 Min Read
Enable Live Migration using PowerShell

Q: I'm trying to use Windows PowerShell to enable a Windows Server 2012 Hyper-V host to be Live Migration-enabled by setting the VirtualMachineMigrationEnabled attribute to $true--so why am I getting an error?

A: If a host is enabled for Live Migration, then its VirtualMachineMigrationEnabled attribute is set to true, for example:

PS C:> (Get-VMHost savdalhv01).VirtualMachineMigrationEnabledTrue

However, if you actually try and enable Live Migration by setting this value, you will get an error message saying that this attribute is read-only:

 

PS C:> (Get-VMHost savdalhv01).VirtualMachineMigrationEnabled = $true'VirtualMachineMigrationEnabled' is a ReadOnly property.At line:1 char:1+ (Get-VMHost savdalhv01).VirtualMachineMigrationEnabled = $true+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidOperation: (:) [], RuntimeException+ FullyQualifiedErrorId : PropertyAssignmentException

 

To enable Live Migration you actually need to use the Enable-VMMigration cmdlet. Also remember you might want to also set the networks that can be used for Live Migration by using the Set-VMMigrationNetwork cmdlet. And you might also want to set the authentication method with the Set-VMHost -VirtualMachineMigrationAuthenticationType. For example:

PS C:> Enable-VMMigrationPS C:> Set-VMMigrationNetwork 10.1.2.1PS C:> Set-VMHost -VirtualMachineMigrationAuthenticationType Kerberos

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like