Unmounting a LUN using the vSphere Client
To detach a storage device using the vSphere Client, see the
Detach Storage Devices section in the
vSphere 5.0 Storage Guide.
Caution:
You must successfully unmount the datastore using the documented method
prior to completing the steps described below. For more information,
see the
Unmount VMFS or NFS Datastores section in the
vSphere 5.0 Storage Guide.
To unmount a LUN from an ESXi 5.0 host using the vSphere Client:
- If the LUN is an RDM, skip to step 2. Otherwise, in the Configuration tab of the ESXi host, click Storage. Right-click the datastore being removed and click Unmount.
A Confirm Datastore Unmount window appears. When the prerequisite criteria have been passed, click OK.
Note: To unmount a datastore from multiple hosts in the vSphere Client, click Hosts and Clusters > Datastores and Datastore Clusters view (Ctrl+Shift+D). Perform the unmount task and select the appropriate hosts that should no longer access the datastore to be unmounted.
- Click the Devices view (under Configuration > Storage):
- Right-click the NAA ID of the LUN (as noted above) and click Detach. A Confirm Device Unmount window is displayed. When the prerequisite criteria are passed, click OK. Under the Operational State of the Device, the LUN is listed as Unmounted.
Note:
The Detach function must be performed on a per-host basis and does not
propagate to other hosts in vCenter Server. If a LUN is presented to an
initiator group or storage group on the SAN, the Detach function must be
performed on every host in that initiator group before unmapping the
LUN from the group on the SAN. Failing to follow this step results in an
all-paths-down (APD) state for those hosts in the storage group on
which Detach was not performed for the LUN being unmapped.
- Confirm if the LUN is successfully detached. The LUN can then
be safely unpresented from the SAN. For more information, contact your
storage array vendor.
- Perform a rescan on all ESXi hosts which had visibility to the
LUN. The device is automatically removed from the Storage Adapters.
When
the device is detached, it stays in an unmounted state even if the
device is re-presented (that is, the detached state is persistent). To
bring the device back online, the device must be attached.
If you
want the device to permanently decommission from an ESXi host, manually
remove the NAA entries from the host configuration:
- To list the permanently detached devices, run this command:
# esxcli storage core device detached list
You see output similar to:
Device UID State
------------------------------------ -----
naa.50060160c46036df50060160c46036df off
naa.6006016094602800c8e3e1c5d3c8e011 off
- To permanently remove the device configuration information from the system, run this command:
# esxcli storage core device detached remove -d NAA_ID
For example:
# esxcli storage core device detached remove -d naa.50060160c46036df50060160c46036df