AndyTipton
Contributor
Contributor

Trying to remove fibre attached SAN datastore - resource is in use

Jump to solution

Seen a few similar posts to this prob but so far haven't been able to solve this one...I'm running ESX3.5 with fibre attached storage.

Have cleared one of my old Datastores for deletion but can't remove it from the VI client - says "Resource is in use".

  • Have re-scanned hba's on all hosts and retried it.

  • Ran service mgmt-vmware restart on all hosts from the CLI but didn't help.

  • Have looked at some suggestions to use fdisk from the CLI but I don't now how to identify what partition I'm fdisk'ing.

Some advice on any of the above would be appreciated, esp if someone can assist with fdisk commands.

Thanks, Andy.

0 Kudos
1 Solution

Accepted Solutions
jhanekom
Virtuoso
Virtuoso

The brute-force way would be to just unpresent the LUN and then rescan.

But more than likely there is a template registered to that LUN, or another VM referencing an ISO or floppy image on it. VirtualCenter tracks these registrations and displays them in the Datastores view of the VC console.

Click on the dropdown arrow on the big Inventory button in VC, select Datastores. Then click on your "used" datastore and see which VMs reference it.

View solution in original post

0 Kudos
8 Replies
jhanekom
Virtuoso
Virtuoso

The brute-force way would be to just unpresent the LUN and then rescan.

But more than likely there is a template registered to that LUN, or another VM referencing an ISO or floppy image on it. VirtualCenter tracks these registrations and displays them in the Datastores view of the VC console.

Click on the dropdown arrow on the big Inventory button in VC, select Datastores. Then click on your "used" datastore and see which VMs reference it.

0 Kudos
VMKR9
Expert
Expert

I would just destroy the LUN and re scan...

alecprior
Enthusiast
Enthusiast

I had the same problem deleting a volume last week. It seems that VC still holds an ISO mapping to a volume even if the virtual device isn't connected, also still if the actual ISO is deleted.

0 Kudos
passahobe
Enthusiast
Enthusiast

If Virtual Center 2.5 is used, maybe the datastore view on maps tool brings more information about wich virtual machine can lock the datastore. Then you can remove elements as you need on VM affected and solve the problem. I hope this helps you.

AndyTipton
Contributor
Contributor

Thanks to all who replied. That was very helpful. I knew I'd completely wiped the datastore. There were no vm's present when browsing the datastore via the storage list or doing a ls -l in the CLI.

However, I can't believe I didn't think to look at the Datastore browser as a couple of you suggested (duh),,,sure enough there was a reference to some obsure disk added to an old copy of a server I had previously cloned off to the replacement datastore. Removed that disk and was able to remove the datastore.

Otherwise, I was going to de-zone the LUN and do a rescan but I really wanted to work out what the resource in use was and I was a bit unsure about the impact of a brute force datatsore removal.

Thanks again. Cheers, Andy.

0 Kudos
PLaing
Contributor
Contributor

Excellent advice.

Switching to the "Datastores" view in Virtual Center allowed me to see what was holding on to the datastore I was trying to remove.

Once I cleaned up those references I was able to delete the volume.

Sometimes the obvious becomes obscurred.

Paul

0 Kudos
TXProblemSolver
Contributor
Contributor

Here is what worked for me:

  1. Make sure the datastore is empty
  2. Using the "maps" view see if any machines are still connected to  the datastore. If you ever had iso images or floppy images on that  datastore it is possible that the virtual machines are still pointing to  the images that no longer exist and that will prevent you from being  able to delete the datastore.
  3. After you have checked your virtual machines make sure you have no  templates that have CD drives or floppy drives connected to  non-existant images that used to be on that datastore. To fix this just  convert the template into a VM edit the CD or floppy to remove the  connection and then convert the VM back into a template so the template  is no longer connected to that datastore.

At that point you should be cleared to delete the datastore without error.

Note:  It took me a minute to realize that there were templates with drives  connected to non-existant files that used to be on the datastore I was  trying to delete.

0 Kudos
bcoyxp
Contributor
Contributor

i had this same issue before. in fact my worst scenario encountered is that cluster itself got messed up.

anyways, i am running a 32-node vsphere 4.1 environment. all my datastores were connected thru SAN.

even though that i am not sure whether that this is the right way to do it, but i found it smooth in deleting my datastores. and one thing, i am purely using GUI in this, not a command line.

1. Make sure that the datastore is "literally" empty. This means, delete any existing files or folders [including .vswp, .nvram and .dvsData folder]

     note: files .nvram and .vswp are VM files, make sure that these files were recreated on the folder of the VMs that were moved/migrated from the         datastore.

2. Once the files were deleted, right click on the target datastore and click "refresh".

3. delete the datastore.

been doing these sequence a couple of times without encountering the same isssues again.

Best Regards,

bcoyxp

0 Kudos