Highlighted
Enthusiast
Enthusiast

ESXi host boot delay - RDMs

Jump to solution

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.

1 Solution

Accepted Solutions
Highlighted
User Moderator
User Moderator

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})

    }

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

13 Replies
Highlighted
Commander
Commander

Hi,

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

VMware Knowledge Base

Regards,

Suresh

Regards, Suresh https://vconnectit.wordpress.com/
0 Kudos
Highlighted
Enthusiast
Enthusiast

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.

0 Kudos
Highlighted
VMware Employee
VMware Employee

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


Forum Usage Guidelines: https://communities.vmware.com/docs/DOC-12286
VMware Training & Certification blog: http://vmwaretraining.blogspot.com
0 Kudos
Highlighted
Enthusiast
Enthusiast

Thanks Scott. Please do the needful

Regards

Narayanan.

0 Kudos
Highlighted
VMware Employee
VMware Employee

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


Forum Usage Guidelines: https://communities.vmware.com/docs/DOC-12286
VMware Training & Certification blog: http://vmwaretraining.blogspot.com
0 Kudos
Highlighted
User Moderator
User Moderator

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})

    }

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Highlighted
Enthusiast
Enthusiast

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.

0 Kudos
Highlighted
User Moderator
User Moderator

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 })

            }

    }


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Enthusiast
Enthusiast

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.

0 Kudos
Highlighted
User Moderator
User Moderator

The script only handles the RDMs.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Enthusiast
Enthusiast

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

Regards

Narayanan.

0 Kudos
Highlighted
Enthusiast
Enthusiast

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!


Please vote my post if it was useful to you!

Visit my blog at https://vcloudvision.com!
0 Kudos
Highlighted
Enthusiast
Enthusiast

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

0 Kudos