Removing a Volume from VMWare
How to remove a Volume from VMWare.
There are times when you have a volume that is no longer needed and needs to be permanently removed form VMWare.
You must first make sure the following conditions are true to unmount the datastore:
- No Virutal Machine resides on the datastore
- The datastore is not part of a Datastore Cluster
- The datastore is not managed by Storage DRS
- Storage I/O control is disabled for the datastore
- The datastore is not used for vSphere HA heartbeat
You also need to make sure these are conditions are true to detach the volume
- The device is not used by a datastore (This condition will be true when you unmount it)
- The device is not used by a VM for an RDM disk
- The device does not contain a diagnostic partition.
This tutorial is based on removing a volume (in this case 4 volumes) in a VMWare Cluster that contains 3 Hosts that the volumes are attached to.
I am using VMWare Vsphere5.5
Login to VCenter and select the host you want to start with
- Go to the host. Click on the Configuration Tab and them Storage (under Hardware) on the left.
- At the top Click on the Datastores View Button. ( I then usually click on the identification column so that it puts them in alphabetical order. It makes it easier to find things when you have a lot of datastores.)
- Find the datastore that you want to remove.
- Open Notepad then Right click on the datastore you want to remove and select copy to clip board. Paste that into your notepad file. ( This will come in handy when you need to remove the device in a later step
COMPELNT iSCSI Disk (naa.6000d3100063c80000000000000000cc):1
8/17/2016 9:52:42 AM
- Now Right click the Volume and click Unmount. It will check the following requirements. Make sure none are in red and all are met, and click 0k!
Once it has successfully unmounted. It will be greyed out and say (inactive)(unmounted)
Do steps 2-5 if you are removing more than one datastore.
- Next Click on the devices
- Find the Storage name that you copied to your clipboard. (you should have this in the notepad file ). I like to select the Name Column at the top so that it puts them in alphabetical order. It makes it easier to find when you have a lot of volumes
For example: COMPELNT iSCSI Disk (naa.6000d3100063c80000000000000000cc
Right Click and select Detach. It will check that the following conditions are true. If all is green then select ok.
The device path will then turn to grey and show (unmounted)
Do steps 6-7 if you are removing more than one device.
Now since we are in a cluster and these steps do not propagate to the other hosts you have to perform the same exact steps on each host that your volumes are attached to. So repeat steps 1-7 on each host before you move on. Note your datastore and device name will be the same on each host.
After you have removed the datastore and device from each host we now need to use putty to ssh into each host.
- .Open putty and SSH into your first host
- .Run the following command to show a list of the detached devices
- Esxcli storage core device detached list (They should be the ones that you unmounted/detached.
- We now need to permanently remove the device configuration information from the host. So run the following command.
** Side note if you right click and then highlight the device id and then left click it will place it at the end of your command. This makes it easier than typing it.
So type in esxcli storage core device detached remove –d then go up to the device id you want and right click and highlight it. Then left click and it should add it to the end
- Esxcli storage core device detached remove –d naa.id
- Run the command for each device ID in the list.
- The run the device detached list command again to make sure it is not showing any more devices detached.
- Esxcli storage core device detached list
Do steps 8-10 for each host in your cluster. So if you removed the volume from 3 hosts. You will need to login to each of them individually and permanently detached the device from them
- Once that is complete you can now safety remove the LUN/ VOLUME form the HOSTS ion your SAN.
- Once that is complete do a rescan on your host or cluster and it will automatically remove the LUN that is greyed out from the datastore view and remove the device from the storage adapters.
If all the steps were followed correctly the Volume should no longer be seen and you will not get a cannot connect to storage alert.