- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It worked!
I modified one line as we're attempting to run this against only 1 host, and set the get-vm to a specific cluster.
I changed the $esxcli= line to use a $vmhost variable which is set to a specific hostname.
$rdmHD = get-cluster "CLUSTER1" | Get-VM | Get-HardDisk -DiskType RawPhysical,RawVirtual
$vmhost = get-vmhost "VMHOST"
foreach($rdm in $rdmHD){
$esxcli = Get-EsxCli -VMHost $vmhost
$esxcli.storage.core.device.list($rdm.ScsiCanonicalName) |
Select @{N="Time";E={"{0:g}" -f (Get-Date).TimeOfDay}},Device,IsPerenniallyReserved
$esxcli.storage.core.device.setconfig($false,$rdm.ScsiCanonicalName,$true)
$esxcli.storage.core.device.list($rdm.ScsiCanonicalName) |
Select @{N="Time";E={"{0:g}" -f (Get-Date).TimeOfDay}},Device,IsPerenniallyReserved
}
Thanks Luc!