Wednesday , June 10 2020

Perennially Reservation with PowerCLI for RDMs

ESXi/ESX hosts with visibility to RDM LUNs being used by MSCS nodes with RDMs may take a long time to start/reboot or during LUN rescan

Lets see how to set for specific hosts and to all hosts in a cluster.

To see ScsiCanonicalName of a Specific Virtual Machine –

(Get-VM VMNAME | Get-HardDisk -DiskType RawPhysical).ScsiCanonicalName

image

To See current status of “IsPerenniallyReserved”  for a Specific Host –

$myesxcli = get-esxcli -VMHost 10.10.10.10
$myesxcli.storage.core.device.list("naa.6000044444523030303836").IsPerenniallyReserved

image

To Set this for a Specific Host –

$myesxcli = get-esxcli -VMHost 10.10.10.10
$myesxcli.storage.core.device.setconfig($false, "naa.600009444423252523030303836", $true)

To Apply  on a Cluster  –

Enter VMNAME

Enter CLUSTERNAME

First – Remove  Line 10 to See Current Status of all hosts in the Cluster – $myesxcli.storage.core.device.setconfig($false, “$device”, $true)

If you are ok .Then insert line 10 and run the script


$devices = (Get-VM VMNAME | Get-HardDisk -DiskType RawPhysical).ScsiCanonicalName
$Cluster = Get-Cluster CLUSTERNAME
$vmhosts = $Cluster | Get-VMHost
Foreach ($Vmhost in $Vmhosts)
{
$myesxcli = get-esxcli -VMHost $Vmhost.Name
Foreach ($device in $devices)
{
$myesxcli.storage.core.device.setconfig($false, "$device", $true)
$Device
$ReservedStatus = $myesxcli.storage.core.device.list("$device").IsPerenniallyReserved
$ReservedStatus
}
}

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Database availability group must have quorum error

Decommissioning set of old Exchange 2013 servers had to export few mailboxes and decommission them.But …

One comment

  1. Great work, simple and usefull

Leave a Reply

Your email address will not be published.