Check for VMotion compatibility
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Check for VMotion compatibility相关的知识,希望对你有一定的参考价值。
Script
-----------------------------------------------------------------------------------------------
#check for VMotion compatibility
# get the ServiceInstance object
$viewSI = Get-View "ServiceInstance"
$viewVmProvChecker = Get-View $viewSI.Content.VmProvisioningChecker
$strMyVMHostNameToCheck = "10.94.174.143"
$VMHost = Get-VMHost -Name $strMyVMHostNameToCheck
$SourceVMs = "C:\report\vmlist.txt"
$list = Get-Content $SourceVMs | Foreach-Object {Get-VM $_ }
& {foreach ($VM in $list)
{
$viewVmProvChecker.QueryVMotionCompatibilityEx($VM.Id, $VMHost.Id)
}
} |
Select-Object @{N="VM";E={($_.Vm | Get-VIObjectByVIView).Name}},
@{N="VMHost";E={($_.Host | Get-VIObjectByVIView).Name}},
# @{N="Warning";E={[string]::Join(‘,‘,$_.Warning)}},
# @{N="Error";E={[string]::Join(‘,‘,$_.Error)}},
@{N="Warning";E={[string]::Join(‘,‘,$_.Warning.LocalizedMessage)}},
@{N="Error";E={[string]::Join(‘,‘,$_.Error.LocalizedMessage)}},
LinkedView,
DynamicType,
DynamicProperty |
Export-Csv -Path "C:\report\VmComp1.csv" -NoTypeInformation -UseCulture
以上是关于Check for VMotion compatibility的主要内容,如果未能解决你的问题,请参考以下文章