6.0

Table Of Contents
VMware, Inc. 43
Chapter 4 Managing Storage
Detaching Devices and Removing a LUN
BeforeyoucanremoveaLUN,youmustdetachthecorrespondingdevicebyusingthevSphereWebClient,
ortheesxcli storage core device setcommand.Detachingadevicebringsadeviceoffline.Detaching
adevicedoesnotimpactpathstates.IftheLUNisstillvisible,thepathstateisnotsettodead.
To detach a device and remove a LUN
1Migratevirtualmachinesfromthedeviceyouplantodetach.
Forinformationonmigratingvirtualmachines,seethevCenterServerandHostManagement
documentation.
2Unmountthedatastoredeployedonthedevice.See“MountingandUnmountingwithESXCLI”on
page 30.
Iftheunmountfails,ESXCLIreturnsanerror.Ifyouignore
thaterror,youwillgetanerrorinstep4when
youattempttodetachadevicewithaVMFSpartitionstillinuse.
3Iftheunmountfailed,checkwhetherthedeviceisinuse.
esxcli storage core device world list -d <device>
IfaVMFSvolumeisusingthedeviceindirectly,theworldnameincludesthestringidle0.Ifavirtual
machineusesthedeviceasanRDM,thevirtualmachineprocessnameisdisplayed.Ifanyotherprocess
isusingtherawdevice,theinformationisdisplayed.
4 Detachthestoragedevice.
esxcli storage core device set -d naa.xxx... --state=off
Detachispersistentacrossrebootsanddeviceunregistration.Anydevicethatisdetachedremains
detacheduntilamanualattachoperation.Rescandoesnotbringpersistentlydetacheddevicesback
online.Apersistentlydetacheddevicecomesbackintheoffstate.
ESXimaintainsthepersistentinformationaboutthedevice’sofflinestateevenif
thedeviceis
unregistered.Youcanremovethedeviceinformationbyrunningesxcli storage core device
detached remove -d naa.12.
5 (Optional)Totroubleshootthedetachoperation,listalldevicesthatweredetachedmanually.
esxcli storage core device detached list
6Performarescan.
esxcli <conn_options> storage core adapter rescan
Whenyouhavecompletedstoragereconfiguration,youcanreattachthestoragedevice,mountthedatastore,
andrestartthevirtualmachines.
To reattach the device
1 (Optional)Checkthatthedeviceisdetached.
esxcli storage core device detached list
2 Attachthedevice.
esxcli storage core device set -d naa.XXX --state=on
3Mountthedatastoreandrestartvirtualmachines.See“MountingDatastoreswithExistingSignatures”on
page 29.
Working with Permanent Device Loss
WithearlierESXireleases,anAPD(AllPathsDown)eventresultswhentheLUNbecomesunavailable.The
eventisdifficultforadministratorsbecausetheydonothaveenoughinformationaboutthestateoftheLUN
toknowwhichcorrectiveactionisappropriate.