编辑powerCLI 脚本 ,脚本内容如下 :
$hosts = Get-VMHost foreach ($h in $hosts){ $myesxcli= get-esxcli -VMHost $h $report = @() $vms = Get-VM | Get-View foreach($vm in $vms){ foreach($dev in $vm.Config.Hardware.Device){ if(($dev.gettype()).Name -eq "VirtualDisk"){ if($dev.Backing.CompatibilityMode -eq "physicalMode"){ $report += $dev.Backing.DeviceName } } } } foreach($r in $report){ $device = $myesxcli.storage.core.device.list() | Where-Object {$_.OtherUids -like $r} $myesxcli.storage.core.device.setconfig($false, $device.device, $true) }
参考链接Friendly reminder: set RDMs to perennially reserved for faster boot times:vmware https://www.reddit.com/r/vmware/comments/3a1olh/friendly_reminder_set_rdms_to_perennially/
转载于:https://blog.51cto.com/122269875/1812482