Search the VMware Knowledge Base (KB)
View by Article ID

Performing a rescan of the storage on an ESX/ESXi host (1003988)

  • 45 Ratings

Purpose

This article explains how to perform a rescan of storage devices. A rescan of storage devices is needed when a storage device has been added, removed, or changed from the array.

Resolution

You can perform a rescan in these ways:
Note: Performing a rescan does not cause a service interruption.

Using the VMware vSphere or VI Client to perform a rescan

To rescan using the vSphere or VI Client:
  1. Log in to the client and select an ESX/ESXi host in your inventory.
  2. Click the Configuration tab.
  3. Click Storage Adapters.
  4. Click the Rescan link.
  5. Click OK to begin the rescan.

    Note: This performs a rescan of every installed Host Bus Adapter (HBA), regardless of the HBA that is selected in the Storage Adapters view.

    The progress of the rescan can be monitored from the ESX/ESXi host console in the /var/log/vmkernel (for ESX hosts) or /var/log/messages (for ESXi) logfiles.
Note: The Rescan in the VI Client, by default, combines the rescan for new LUNs (and removal of retired ones) with the detection of new VMFS data stores, depending on which check boxes are selected when the rescan is initiated. The rescan and datastore detection are asynchronous processes. As a result, the detection process for new data stores may complete before the detection process for new LUNs is complete. You may need to perform the rescan twice if the newly added LUN has a VMFS data store on it, or perform an HBA rescan and VMFS rescan in separate tasks. You may select either or both of the two to be performed, per a modal dialog box when initially beginning a rescan.

Using the VMware vSphere Web Client to perform a rescan

To rescan using the vSphere Web Client:
  1. Open the vSphere Web Client.
  2. Select a host, cluster, datacenter or a folder that contains ESXi/ESX hosts.
  3. Right-click and select Actions > All vCenter Actions > Rescan Storage.
  4. Specify the extent of the rescan, the options are:

    Scan for New Storage Devices - Rescan all adapters to discover new storage devices.
    Scan for New VMFS Volumes - Rescan all storage devices to discover new datastores that have been added since the last scan.

  5. Monitor the progress of the rescan task in the Work In Progress tab on the right.

Using the ESX/ESXi 4.x and earlier host command line

To perform a rescan from the ESX/ESXi host command-line:
  1. Log in to the ESX/ESXi host console.

  2. Run the command:

    esxcfg-rescan <vmkernel SCSI adapter name>

    Where <vmkernel SCSI adapter name> is the vmhba# to be rescanned.

    Note: The rescan must be performed on each HBA that is attached to the storage that changed. In ESX 4.x, there may not be any output if there are no changes.

    When rescanning a fibre channel HBA or local storage, you see an output similar to:

    Rescanning vmhba2...done.
    On scsi3, removing: 0:0 1:0 1:1 1:2 1:3 1:4.
    On scsi3, adding: 0:0 1:0 1:1 1:2 1:3 1:4.


    When rescanning an iSCSI HBA, you see an output similar to:

    Doing iSCSI discovery. This can take a few seconds ...
    Rescanning vmhba1...done.
    On scsi2, removing: 0:0 0:10 1:0.
    On scsi2, adding: 0:0 0:10 1:0
    .

    Note: You do not need to rescan local storage.

    Although the first pass states that it is removing LUNs, no LUN is removed until after the adding phase is complete. Any LUN that was not marked as adding is removed.

  3. To search for new VMFS datastores, run this command:

    vmkfstools -V

    Note: This command does not generate any output.

    If a new datastore has been detected, it is mounted in /vmfs/volumes/ using its friendly name (if it has one) or its UUID.

Using the ESXi 5.x and later host command line 

To perform a rescan from the ESXi host command-line:
  1. Log in to the ESXi host console. For more information, see Using Tech Support Mode in ESXi 4.1 (1017910).
  2. To rescan, run one of these commands:

    • To rescan all HBAs:
      esxcli storage core adapter rescan --all

    • To rescan a specific HBA:
      esxcli storage core adapter rescan --adapter <vmkernel SCSI adapter name>

      Where <vmkernel SCSI adapter name> is the vmhba# to be rescanned. To get a list of all adapters, run the esxcli storage core adapter list command.

      Note: There may not be any output if there are no changes.

  3. To search for new VMFS datastores, run this command:

    vmkfstools -V

    Note: This command does not generate any output.

    If a new datastore has been detected, it is mounted in /vmfs/volumes/ using its friendly name (if it has one) or its UUID.

      Tags

      lun-paths lun-rescan

      See Also

      Update History

      06/13/2012 - Updated for 5.x 03/12/2015 - Added ESXi 6.0 to Products.

      Request a Product Feature

      To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

      Feedback

      • 45 Ratings

      Did this article help you?
      This article resolved my issue.
      This article did not resolve my issue.
      This article helped but additional information was required to resolve my issue.

      What can we do to improve this information? (4000 or fewer characters)




      Please enter the Captcha code before clicking Submit.
      • 45 Ratings
      Actions
      KB: