Saturday , April 29 2017

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 Exchange Server MVP , Publisher of CareExchange.in Supporting/Deploying/Designing Microsoft Exchange for some years. Extensive experience on Microsoft Technologies.

Check Also

IIS Installation failed–Reserved for use by another transaction

Installation of Web Server IIS Fails on Windows Server. The Request to add or Remove ...

Leave a Reply

Your email address will not be published.