Rescan all vmhba’s at once with the esxcfg-rescan command

Using the console it’s very easy to rescan a specific vmhba which can be useful when you are troubleshooting. For lazy people like me it’s disturbing that you have to type the command twice if you want to rescan both HBA’s. Well, as of version 3.5 VMware introduced a new setting in Advanced configuration section in the VirtualCenter Client:

Go to “Configuration” of the ESX Host
Click on “Advanced”
Click on “Scsi”
Set “Scsi.ScsiRescanAllHbas” to 1

This can also be done from the command line:

esxcfg-advcfg -s 1 /Scsi/ScsiRescanAllHbas

Now you don’t need to type “esxcfg-rescan vmhba1″ and “esxcfg-rescan vmhba2″ anymore, when rescanning an HBA all cards will be rescanned.




You can leave a response, or trackback from your own site.

9 Responses to “Rescan all vmhba’s at once with the esxcfg-rescan command”

  1. Gregory POIROT says:

    Hello,

    This command doesn’t work :

    esxcfg-advcfg -s 1 /SCSI/ScsiRescanAllHhas

    error message :
    Exception occured: Unable to find branch SCSI

    best regards.

    Gregory.

  2. try this one:
    esxcfg-advcfg -s 1 /Scsi/ScsiRescanAllHhas

  3. Gregory POIROT says:

    It doesn’t work :

    esxcfg-advcfg -s 1 /Scsi/ScsiRescanAllHhas

    Exception occured: Unable to find option ScsiRescanAllHhas

  4. which version are you using?

  5. azn2kew says:

    isn’t it AllHBAs instead of AllHhas?

  6. Tyl says:

    yes it’s ScsiRescanAllHbas. This is a mistake in the post.

  7. [...] the esxcfg-advcfg command. Since writing that post at the end of 2008, I found Duncan Epping used esxcfg-advcfg in 3.5 to set the option rescan all the Hba’s. I thought this was a great shortcut and decided to try [...]

  8. Ruben says:

    On

    # vmware -v
    VMware ESX Server 3.5.0 build-153875

    That setting is default to one (1) and affects the rescan that you do on the GUI, not the command line. You can verify that doing a rescan on the command line and you will see an error

    —— Setting

    # esxcfg-info | grep -i -C5 rescanall
    \==+Advanced Integer Option :
    |—-Option Name…………………………….ScsiRescanAllHbas
    |—-Current Value…………………………..1
    |—-Default Value…………………………..1
    |—-Min Value………………………………0
    |—-Max Value………………………………1
    |—-Hidden…………………………………false
    |—-Parent…………………………………/Scsi/
    |—-Path…………………………………../Scsi/ScsiRescanAllHbas

    ——– Command
    # esxcfg-rescan
    Incorrect number of arguments.
    Usage: /usr/sbin/esxcfg-rescan

    # esxcfg-rescan -h
    Usage: /usr/sbin/esxcfg-rescan

    Ruben

    Note: You can use the GUI to set up advanced options.

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!