ESXi vSphere mount LUN problems

From VI-Toolkit
Jump to navigation Jump to search

cannot connect to LUN

Sometimes the correct LUN does not show up and trying to mount it only gives an option to format the LUN.

  • 1. Log in as root to the ESX host which cannot mount the datastore using an SSH client.
  • 2. Run the command:
esxcfg-volume -l

The results appear similar to:

VMFS3 UUID/label: 4b057ec3-6bd10428-b37c-005056ab552a/ TestDS
Can mount: Yes
Can resignature:  No (the volume is being actively used)
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.

  • 3. Run the command:
esxcfg-volume -M <UUID>

Where the <UUID> is the value recorded in step 2.

or you can just use the label:

esxcfg-volume -M TestDS

adding a new NFS LUN from the CLI

First list what is there:

esxcli storage nfs list

Then add:

 esxcli storage nfs add -v NEWLUN -H -s /mnt/newstorage

where NEWLUN is the label, -H is the host

adding iSCSI LUN back

disable snapshot LUN

# esxcfg-advcfg -s 0 /LVM/DisallowSnapshotLun
Value of DisallowSnapshotLun is 0

Then rescan the lot

# esxcli storage core adapter rescan --all
# vmkfstools -V
# esxcli storage vmfs snapshot list

restore the default for your snapshot

# esxcfg-advcfg -s 1 /LVM/DisallowSnapshotLun
Value of DisallowSnapshotLun is 1
# esxcfg-volume -l
# df -h

The snapshot list and volumes show no results for me, but on df -h after the above commands, the ISCSI mount now shows up at the host.

vSAN handling of devices detected as snapshots (2129058)

Adding a host to an NFS datastore in the VCSA errors out

Trying to add another host to a NFS datastore errors out and generates the error "Failed: An error occurred during host configuration". The host should be able to connect to the NFS storage as it is allowed from the NFS server.

Digging deeper on this error gives "Operation failed, diagnostics report: Unable to get console path for volume"

In my case the host had mounted this NFS LUN before under a slightly different name and as such a now obsolete pointer somewhere was preventing the host from connecting to the LUN.

You can fix it from the CLI as follows:

First make sure the LUN isn't in the output of the following command:

# esxcfg-nas -l

If that's not the case then proceed and try to add the LUN from the CLI. If your host is and the NFS share on it is /mnt/vol/share which you want to mount as MYLUN then add like

# esxcfg-nas -a -o -s /mnt/vol/share MYLUN
 Error performing operation: Unable to add new NAS, volume with the label MYLUN already exists

Here the vSphere server is indeed complaining that MYLUN exists. Run:

# df -h

and verify that it is NOT in the list. After that test you can remove the LUN

# esxcfg-nas -d MYLUN
IORM: failed to disable IORM: Unable to get console path for volume, MYLUN
NAS volume MYLUN deleted.

Now you can rerun the above command:

# esxcfg-nas -a -o -s /mnt/vol/share MYLUN
Connecting to NAS volume: MYLUN
MYLUN created and connected.

iSCSI shows as normal, degraded

In vSphere 6.5 this happens when you have only 1 uplink.