Wednesday, March 14, 2012

Force mounting LUNs in ESXi


  • Log in as root to the ESX host which cannot mount the datastore using an SSH client. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
    Note: All of the commands listed are available in ESXi via the vSphere CLI.
  • Run the command:

    # esxcfg-volume -l
    The results appear similar to:


    VMFS3 UUID/label: 4b057ec3-6bd10428-b37c-005056ab552a/ TestDS
    Can mount: Yes
    Can resignature: Yes
    Extent name: naa.6000eb391530aa26000000000000130c:1 range: 0 - 1791 (MB)
    Record the UUID portion of the output. In the above example the UUID is 4b057ec3-6bd10428-b37c-005056ab552a.
    Note: The Can mount value must be Yes to proceed with this workaround.
    Note: The esxcfg-volume command has been depreciated in ESXi 5.0 in favor of the esxclicommand. For more/related information, see vSphere handling of LUNs detected as snapshot (1011387).
     
  • Run the command:

    # esxcfg-volume -M
    Where the  is the value recorded in step 3.

    Note: If you do not wish the volume mount to persist a reboot, the -m switch can be used instead.
  •