Istanbul/Turkey

ESXi Servers reboots too slow because of RDM Disks

This issue occurs when virtual machines participating in a clustering solution such as WSFC, Red Hat High Availability Cluster use shared RDMs and SCSI reservations across hosts, and a virtual machine on the other host is the active cluster node holding a SCSI Reservation.

First Determine RDM LUNs. You can use the script below to list all RDMs in your environment. The script gives you details such as VMName, VMHost, HDDeviceName, HDFileName, HDMode, HDsize, HDDisplayName.

$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") -or

               ($dev.Backing.CompatibilityMode -eq "virtualMode")){

                    $row = "" | select VMName, VMHost, HDDeviceName, HDFileName, HDMode, HDsize, HDDisplayName

                    $row.VMName = $vm.Name

                    $esx = Get-View $vm.Runtime.Host

                    $row.VMHost = ($esx).Name

                    $row.HDDeviceName = $dev.Backing.DeviceName

                    $row.HDFileName = $dev.Backing.FileName

                    $row.HDMode = $dev.Backing.CompatibilityMode

                    $row.HDSize = $dev.CapacityInKB

                    $row.HDDisplayName = ($esx.Config.StorageDevice.ScsiLun | where {$_.Uuid -eq $dev.Backing.LunUuid}).DisplayName

                    $report += $row

               }

          }

     }

}

$report | Export-Csv -Path "C:\scripts\myexport.csv"

 

 

We will need disk id which is labeled as“HDDisplayName” on the csv file.  It is something like naa.6589cfc000000a17ac02aae02067e747

 

Connect ESXi hosts via putty or something similar.   Run this command for each RDM disk (naa.xxx). You need to run this command on all of your ESXi hosts which has access to these RDM disks. (Replace naa.id with your own disk id)

esxcli storage core device setconfig -d <naa.id> --perennially-reserved=true

 

 

 You can check if changes are applied with the command below

esxcli storage core device list -d <naa.id>

"Is Perennially Reserved" flag's value should be  "True".

 

Note: The configuration is permanently stored with the ESXi host and persists across restarts. To remove the perennially reserved flag, run this command:

esxcli storage core device setconfig -d <naa.id> --perennially-reserved=false

 

 

  • Hits: 504