Wednesday, April 16, 2014

Setting Perennially Reserved flags for RDM LUNs via PowerCLI

A while back, I blogged about slow ESXi host boot times. After troubleshooting the issue, it was determined that the root cause was caused by a known issue in vSphere 5 and RDM LUN mappings. During the initial boot of an ESXi 5 host, the system attempts to discover all storage devices present to the host. Since these RDMs are likely to be in use by another host, the boot host has to wait for the process to time out as it cannot scan the LUN due to the persistent SCSI reservation. More details can be found here.

In this new vSphere environment, I noticed that the boot times were terribly slow. Some of the symptoms include:

  • boot screen stalls at: vmw_satp_eva loaded successfully
  • boot screen stalls at: vmfs3 loaded successfully. Running usbarbitrator start
  • slow HBA rescan times

Having come across a similar issue before, I immediately checked whether the perennially reserved flags were set to true for all RDM LUNs. As expected, they were set to false so I had to reconfigure them for all the hosts in the cluster. Previously, I was dealing with a small amount of RDM LUNs so it was possible to SSH into each host to reconfigure the perennially reserved flags but due to the large number of hosts in the cluster and the large number of RDM mappings, it was necessary to script it. The following script will set the perennially reserved flag to true for all RDMs in the cluster:

Connect-VIServer -Server "<vcenter name>"

$VMcluster = Get-Cluster "<cluster name>" | Get-VMHost

foreach ($VMHost in $VMcluster)

$myesxcli= get-esxcli -VMHost $VMHost

$$false, "<first>", $true)
$$false, "<second>", $true)
$$false, "<etc etc>", $true)


Disconnect-VIServer -Server "<vcenter name>"

After running the script and setting all the flags, the hosts rebooted much more quickly.

No comments:

Post a Comment