This issue occurs because the ESX host is configured to allow mounting of datastores on snapshot LUNs using the advanced configuration option /LVM/DisallowSnapshotLUN
. In this case, the datastore is successfully unmounted, but a rescan is issued immediately after and the datastore is remounted. This is a hidden setting in ESX 4.x and can only be changed via the command line.
To determine the value of this setting:
- Log in to each of these ESX 4.x hosts via the console or SSH.
- Run the
esxcfg-advcfg
command on each host to determine the current value of the setting:
esxcfg-advcfg -g /LVM/DisallowSnapshotLUN
To unmount all datastores on snapshot LUNs:
- Log in to each of these ESX 4.x hosts via the console or SSH.
- Run this command on each host to determine if it has the datastores to be mounted:
esxcfg-scsidevs -m
- To disallow mounting of snapshot LUNs, run this command to set the default value of 1:
esxcfg-advcfg -s 1 /LVM/DisallowSnapshotLUN
- From the Storage tab in the vSphere Client, rescan the storage on all ESX hosts.
- Review the Storage tab in the vSphere Client to ensure that the datastores have been removed from the inventory.
Caution: If the datastores are still visible, there is active I/O to them that must be stopped before proceeding. Removing access to LUNs with active I/O will result in an All Paths Down condition.
- In the storage array, unpresent the LUN hosting the datastores, so that they are no longer accessible by the ESX hosts. For more information, see Removing a LUN containing a datastore from VMware ESXi/ESX 4.x (1029786),
- Rescan the storage on all ESX hosts.
- Review the Storage tab in the vSphere Client to ensure that the LUNs have been removed from the inventory.
Note: If there are several mounted datastores on snapshot LUNs, changing the value of /LVM/DisallowSnapshotLUN
may unmount other snapshot datastores.
To unmount some, but not all, datastores on snapshot LUNs:
- Log in to each of these ESX hosts via the console or SSH.
- Run this command on each host to determine if it has the datastores to be unmounted:
esxcfg-scsidevs -m
- On each host that has the datastores to be unmounted, run this command to unmount the datastores:
esxcfg-volume -u /vmfs/volumes/<datastore-name>
- From the Storage tab in the vSphere Client, rescan the storage on all ESX hosts.
- Review the Storage tab in the vSphere Client to ensure that the datastores have been removed.
Caution: If the datastores are still visible, there is an active I/O to them that must be stopped before proceeding. Removing access to LUNs with active I/O results in an All Paths Down condition.
- On the storage array, unpresent the LUN hosting the datastores, so that they are no longer accessible by the ESX hosts. For more information, see Removing a LUN containing a datastore from VMware ESXi/ESX 4.x (1029786),
- Rescan the storage on all ESX hosts.
- Review the Storage tab in the vSphere Client to ensure that the LUNs have been removed.