6.5

Table Of Contents
n
Print HBA devices with identifying information.
vicfg-scsidevs <conn_options> --hbas
The return value includes the adapter ID, driver ID, adapter UID, PCI, vendor, and model.
n
Print a mapping between HBAs and the devices it provides paths to.
vicfg-scsidevs <conn_options> --hba-device-list
Detach a Device and Remove a LUN
Before you can remove a LUN, you must detach the corresponding device by using the vSphere Web Client,
or the esxcli storage core device set command.
Detaching a device brings a device oine. Detaching a device does not impact path states. If the LUN is still
visible, the path state is not set to dead.
Prerequisites
n
Make sure you are familiar with virtual machine migration. See the vCenter Server and Host Management
documentation.
n
Make sure you are familiar with datastore mounting and unmounting. See “Mount a Datastore with
ESXCLI,” on page 32.
Procedure
1 Migrate virtual machines from the device you plan to detach.
2 Unmount the datastore deployed on the device.
If the unmount fails, ESXCLI returns an error. If you ignore that error, you will get an error when you
aempt to detach a device with a VMFS partition still in use.
3 If the unmount failed, check whether the device is in use.
esxcli storage core device world list -d <device>
If a VMFS volume is using the device indirectly, the world name includes the string idle0. If a virtual
machine uses the device as an RDM, the virtual machine process name is displayed. If any other process
is using the raw device, the information is displayed.
4 Detach the storage device.
esxcli storage core device set -d naa.xxx... --state=off
Detach is persistent across reboots and device unregistration. Any device that is detached remains
detached until a manual aach operation. Rescan does not bring persistently detached devices back
online. A persistently detached device comes back in the o state.
ESXi maintains the persistent information about the device’s oine state even if the device is
unregistered. You can remove the device information by running esxcli storage core device
detached remove -d naa.12.
5 (Optional) To troubleshoot the detach operation, list all devices that were detached manually.
esxcli storage core device detached list
6 Perform a rescan.
esxcli <conn_options> storage core adapter rescan
vSphere Command-Line Interface Concepts and Examples
48 VMware, Inc.