PowerCLI

 View Only
Expand all | Collapse all

ESXi host boot delay - RDMs

  • 1.  ESXi host boot delay - RDMs

    Posted Oct 01, 2020 05:47 AM

    Hi Team,

    ESXi host reboot taking a very long time and stuck with vmw_vaaip_hds (around 30 to 40 minutes) may be due to the host attached with multiple RDMs.

    Please help to suggest if we have any remediation/workaround to fix the issue without any impact.

    Searched and found below the blog but few of them highlighted as the potential impact to the virtual machines in migration if we set it to perennial reserved.

    https://vcloudvision.com/2019/07/26/slow-boot-times-esxi-with-p-vrdms-easy-fix/

    Do we have an option to run powercli command to set perennially reserved to all the attached RDMs for one single ESXi host instead of cluster.

    Thank you

    Regards

    Narayanan.



  • 2.  RE: ESXi host boot delay - RDMs

    Posted Oct 01, 2020 05:56 AM

    Hi,

    Please check this KB, you can find the powercli commands to modify the settings at individual host level.

    VMware Knowledge Base

    Regards,

    Suresh



  • 3.  RE: ESXi host boot delay - RDMs

    Posted Oct 01, 2020 07:15 AM

    thanks for the reply suresh.

    Even i also came across this KB article also but I am looking for a script to set perennially-reserved=true for all the RDM LUNs (almost 200 RDMs) attached to the host instead of going one by one.

    Thank you

    Regards

    Narayanan.



  • 4.  RE: ESXi host boot delay - RDMs

    Posted Oct 01, 2020 08:17 AM

    That might be possible with PowerCLI, I can move this thread to that area if you wish?



  • 5.  RE: ESXi host boot delay - RDMs

    Posted Oct 01, 2020 09:00 AM

    Thanks Scott. Please do the needful

    Regards

    Narayanan.



  • 6.  RE: ESXi host boot delay - RDMs

    Posted Oct 01, 2020 09:05 AM

    Moderator: Thread moved to the PowerCLI area, user looking for a script to update close to 200 RDMs.



  • 7.  RE: ESXi host boot delay - RDMs
    Best Answer

    Posted Oct 01, 2020 09:14 AM

    You could do something like this

    $esxName = 'MyEsx'

    $esx = Get-VMHost -Name $esxName

    $vms = Get-VM -Location $esx

    $rdms = $vms | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select -Unique ScsiCanonicalName


    $esxcli = Get-EsxCli -VMHost $esx -V2

    foreach($rdm in $rdms){

        $naaid = $rdm.ScsiCanonicalName

        $esxcli.storage.core.device.setconfig(@{device=$naaid;perenniallyreserved=$true})

        }

    }



  • 8.  RE: ESXi host boot delay - RDMs

    Posted Oct 03, 2020 06:28 AM

    Thanks LuCD for the reply.

    I understand the script will check for the current VMs running on the host and exclude the RDM LUNs which attached to it. Please correct me if I am wrong.

    Actually, the host is part of a cluster and the VMs (attached with RDMs) will get migrated by DRS to other hosts and the VMs will not remains the same.

    Before implementing the script on the cluster level for all the ESXi hosts, need to test the script on a single host to set all the RDMs to perennially reserved (NOT VMFS datastores) and check if it resolves the delay during the reboot.

    Kindly help to suggest your comments if this possible or can we try to give all RDMs in the cluster as input in a file to the script to set perennially reserved for the host.

    Thank you

    Regards

    Narayanan.



  • 9.  RE: ESXi host boot delay - RDMs

    Posted Oct 03, 2020 07:03 AM

    To do this on all ESXi nodes in a cluster and for all LUNs used as RDM, you could do

    $clusterName = 'cluster'

    Get-Cluster -Name $clusterName -PipelineVariable cluster |

        Get-VM |

        Get-HardDisk -DiskType "RawPhysical", "RawVirtual" -PipelineVariable rdm |

        ForEach-Object -Process {

            Get-VMHost -Location $cluster -PipelineVariable esx |

                ForEach-Object -Process {

                    $esxcli = Get-EsxCli -VMHost $esx -V2


                    $naaid = $rdm.ScsiCanonicalName

                    $esxcli.storage.core.device.setconfig.Invoke(@{device = $naaid; perenniallyreserved = $true })

                }

        }



  • 10.  RE: ESXi host boot delay - RDMs

    Posted Oct 03, 2020 08:09 AM

    The cluster is consists of RDMs and VMFS datastores and the script needs to exclude the datastore LUNs from setting perennially reserved.

    Can we able add to get the RDM LUN details from an input file (txt or spreadsheet) and set that LUNs only perennially reserved with Log output (Ex - Setting Perennially Reserved Flag for RDM with naa ID or Already reserved or Skipping as this LUN is used for VMFS datastore).

    thank you

    Regards

    Narayanan.



  • 11.  RE: ESXi host boot delay - RDMs

    Posted Oct 03, 2020 08:13 AM

    The script only handles the RDMs.



  • 12.  RE: ESXi host boot delay - RDMs

    Posted Oct 06, 2020 01:52 PM

    Ok LuCD. Let me test and get back to you soon. Thanks for the update.

    Regards

    Narayanan.



  • 13.  RE: ESXi host boot delay - RDMs

    Posted Oct 13, 2020 02:59 PM

    Thanks LuCD for the script. Really your support appreciated.

    It Works and has one small error due to additional parentheses { at the end of the script.

    regards

    Narayanan



  • 14.  RE: ESXi host boot delay - RDMs

    Broadcom Employee
    Posted May 20, 2021 04:06 PM

    Hi there,

    IHAC who has added a new ESXi host to the cluster, without any VM's running on the host. They would like to set RDMs to perennially reserved on that specific host. Please correct me if the below script would work in case Get-VM details are not called in the below script. 

    $esxName = 'MyEsx'

    $esx = Get-VMHost -Name $esxName

    $rdms = $esx | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select -Unique ScsiCanonicalName

    $esxcli = Get-EsxCli -VMHost $esx -V2

    foreach($rdm in $rdms){

        $naaid = $rdm.ScsiCanonicalName

        $esxcli.storage.core.device.setconfig(@{device=$naaid;perenniallyreserved=$true})

        }

    }



  • 15.  RE: ESXi host boot delay - RDMs

    Posted May 20, 2021 04:40 PM

    That looks to be ok and should work.



  • 16.  RE: ESXi host boot delay - RDMs

    Posted Oct 12, 2020 09:15 AM

    Thank you for reading my blogpost! This script is easily adjustable so that you can use it on a single host instead of the cluster. And like others have said, it will only edit RDM's, no VMFS datastores.

    It seems you have figured it out, but if you still need assistance to adjust the script just let me know!