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:

  1. PS C:\> (Get-VMHost savdalhv01).VirtualMachineMigrationEnabled
  2. True

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:

  1. PS C:\> (Get-VMHost savdalhv01).VirtualMachineMigrationEnabled = $true
  2. 'VirtualMachineMigrationEnabled' is a ReadOnly property.
  3. At line:1 char:1
  4. + (Get-VMHost savdalhv01).VirtualMachineMigrationEnabled = $true
  5. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  7. + 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:

  1. PS C:\> Enable-VMMigration
  2. PS C:\> Set-VMMigrationNetwork
  3. PS C:\> Set-VMHost -VirtualMachineMigrationAuthenticationType Kerberos