VMware vsphere 配置裸盘映射lun 持久化保留
编辑powerCLI 脚本 ,脚本内容如下 :$hosts = Get-VMHostforeach ($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:vmwarehttps://www.reddit.com/r/vmware/comments/3a1olh/friendly_reminder_set_rdms_to_perennially/
页:
[1]