I have a request to identify in our environment what dependency is conflicting with VMotion move in clusters. If somebody has any knowledge of such a script, which can be executed to the VCenter and identify VM's which will have conditions and limitations to migrate on different nods in the cluster during a maintenance mode stage, please share.
Need to validate this before patching using VUM process
Thanks in advance for your help.
Cheers,
Moderator: Moved to PowerCLI (which is the most likely solution)
There currently isn't a cmdlet for that, but there is the QueryVMotionCompatibilityEx_Task method.
You can run these tests with something like this.
Note that this method might be very verbose, especially in the Warnings section with missing guest OS heartbeats.
You might start by only looking at the Error section.
$si = Get-View ServiceInstance
$checkMgr = Get-View -Id $si.Content.VmProvisioningChecker
$cluster = Get-Cluster -Name $clusterName
$vmMoRef = (Get-VM -Location $cluster).ExtensionData.MoRef
$esxMoRef = (Get-VMHost -Location $cluster).ExtensionData.MoRef
$checkMgr.QueryVMotionCompatibilityEx($vmMoRef,$esxMoRef) |
ForEach-Object -Process {
$vm = Get-View -Id $_.VM -Property Name
$esx = Get-View -Id $_.Host -Property Name
if($_.Warning){
$_.Warning | ForEach-Object -Process {
[PSCustomObject]@{
VMHost = $esx.Name
VM = $vm.Name
Type = 'Warning'
Message = $_.LocalizedMessage
}
}
}
if($_.Error){
$_.Error | ForEach-Object -Process {
[PSCustomObject]@{
VMHost = $esx.Name
VM = $vm.Name
Type = 'Error'
Message = $_.LocalizedMessage
}
}
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks, LucD. Let me test the result and get back.
Cheers,