Tuesday, October 18, 2011

Performing a rescan of the storage on vSphere


Here you can find a VMware's Knowledge Base article that explains how to perform a rescan of the storage on vSphere.
This is a copy of this article:

Performing a rescan of the storage

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 Hardware 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 ESXESXi 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 Host Bus Adapter (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.






No comments:

Post a Comment