VMware Cloud Community
Narayanan_5245
Enthusiast
Enthusiast
Jump to solution

ESXi host boot delay - RDMs

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
LucD
Leadership
Leadership
Jump to solution

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

15 Replies
SureshKumarMuth
Commander
Commander
Jump to solution

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/
Reply
0 Kudos
Narayanan_5245
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

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


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
Narayanan_5245
Enthusiast
Enthusiast
Jump to solution

Thanks Scott. Please do the needful

Regards

Narayanan.

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

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


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
LucD
Leadership
Leadership
Jump to solution

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

Narayanan_5245
Enthusiast
Enthusiast
Jump to solution

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.

LucD
Leadership
Leadership
Jump to solution

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

Narayanan_5245
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

The script only handles the RDMs.


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

Reply
0 Kudos
Narayanan_5245
Enthusiast
Enthusiast
Jump to solution

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

Regards

Narayanan.

Reply
0 Kudos
bryanvaneeden
Hot Shot
Hot Shot
Jump to solution

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!

Visit my blog at https://vcloudvision.com!
Narayanan_5245
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
sbheema
VMware Employee
VMware Employee
Jump to solution

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

    }

}

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That looks to be ok and should work.


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

Reply
0 Kudos