During the migration of digital machines information from an previous HP MSA 2000 storage to a brand new storage system Dell EMC Unity (each related to ESXi hosts over SAN) I’ve come throughout an issue when attempting to take away an empty VMFS Datastore in VMWare vSphere. When attempting to unmount the VMFS Datastore from ESXi hosts, an error message seems saying that the datastore remains to be in use / busy:
Unmount VMFS quantity vmesxi2.woshub.com. The useful resource 'Datastore Name: MSA2000_LUN1 VMFS uuid: xxxxx--xxxxx-x-xxxxx-xxxx' is in use. Cannot unmount quantity Datastore Name VMFS “file system is busy”.
Based on the error, it’s clear that the VMFS datastore can’t be eliminated since ESXi hosts or vSphere are nonetheless utilizing storage to write some knowledge. According to the VMWare documentation, when eradicating LUN from vSphere it is best to examine the next factors:
- There aren’t any digital machine, template, snapshot or ISO picture information on VMFS datastore (you will need to migrate your VMs to one other VMFS Datastore, energy off and take away them, or unregister VMs in vSphere);
- Storage I/O Control is disabled for datastore;
- The datastore just isn’t part of the Datastore Cluster;
- The LUN just isn’t used as an RDM system;
- VMFS datastore just isn’t used to retailer vSphere HA knowledge, Storage DRS, logs, dumps (/vmkdump/), knowledge (/vsantraced/), technical assist knowledge (scratch partition), or digital machine swap information.
The digital machines have already been moved to a brand new datastore utilizing Storage vMotion. Let’s see what different information and folders stay on the VMFS datastorage:
As you’ll be able to see, there are logdir (a listing with logs), sdd.sf (a listing with the outline of SCSI gadgets), dbsData (a listing with the info of the distributed digital swap) and naa… (VMFS metadata) folders remained.
In my case, ESXi host logs are nonetheless situated in the VMFS datastore (Scratch Location). Check out if the datastore is specified as a location of logs in the ESXi host settings. Go to Manage -> Settings -> Advanced System Settings. Find ScratchConfig.PresentScratchLocation and Syslog.international.logDir and in case your VMFS datastore is specified in it, change the trail to the logs listing.
Restart the ESXi host or restart the Syslog Server service on the host.
Let’s strive to unmount the datastore from the ESXi host once more. Go to Manage -> Storage -> Storage Device. Find your LUN in the listing, choose it and click on Detaches the chosen system from the host.
In my case the error occurred once more:
Detach SCSI LUN The useful resource is in use.
Quite for a very long time I used to be attempting to discover out who makes use of this datastore and determined that the best method in my case was to delete the partition desk of VMFS datastore (in fact, it is best to do it very rigorously and just remember to are eradicating the best datastore).
- Connect over SSH to any ESXi host that has VMFS retailer mounted;
- Copy the ID of your datastore in the vSphere interface, and examine on the ESXi host, which system and path to the VMFS retailer it matches:
esxcfg-scsidevs -c | grep naa.6001438005df0dee0000700004be0000
naa.6001438005df0dee0000700004be0000 Direct-Access /vmfs/gadgets/disks/naa. 6001438005df0dee0000700004be0000 512000MB NMP HP Fibre Channel Disk (naa.6001438005df0dee0000700004be0000)
esxcfg-scsidevs -m | grep naa.6001438005df0dee0000700004be0000
naa.6001438005df0dee0000700004be0000:1 /vmfs/gadgets/disks/naa.6001438005df0dee0000700004be0000:1 570e5298-08f4c74e-ca3a-b4b52f5e2b38 zero MSA2000_LUN1
- Let’s see how a lot area is busy on the VMFS datastore (it’s nearly empty):
df -h | grep MSA2000_LUN1
VMFS-5 499.8G 1.4G 498.3G zero% /vmfs/volumes/MSA2000_LUN1
- So we now have made positive that the datastore title and the shop ID match the LUN that we would like to take away;
- Now let’s get examine details about partition desk in your datastore:
partedUtil getptbl /vmfs/gadgets/disks/naa.6001438005df0dee0000700004be0000
gpt 65270 255 63 1048576000 1 2048 1048575966 AA31E02A400F11DB9590000C2911D1B8 vmfs zero
- In this case, the LUN has a single partition with the VMFS file system;
- Delete the VMFS partition with the ID 1 from this disk (LUN). Please, be very attentive!!!
partedUtil delete /vmfs/gadgets/disks/naa.6001438005df0dee0000700004be0000 1
After deleting the partition, you’ll be able to unmount the LUN in vSphere – Unmount Datastore. The ‘datastore is in use’ error gained’t not seem once more.
Select the ESXi hosts to unmount the datastore from.
Or you may make Detach from the listing of related storage gadgets on the ESXi host. The connection state will then change to Detached.
After which you can take away the VMFS retailer (Delete Datastore) and it’ll disappear from vSphere.