Link to home
Start Free TrialLog in
Avatar of hongedit
hongeditFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Unable to remove datastore

ESXi 4.1 u1

I have a datastore I had created a while ago as a dedicated snapshot datastore.

Seems I have no real need for it, so I am trying to delete it to save some space.

It has 4 files in it:

1 x Server-2712244423.vswp
3 x Exchange-_xxx.vmdk

It wont let me delete these files? The last mod time on them was over 1 yeatr ago so I know they are safe.

"Cannot Delete file [Server- Server2712244423.vswp"

If I just try to remove the datastore I get:

The resource 'GUID' is in use.
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

are you sure that your Server-Server is not using the datastore, a VSWP file belongs to a VM, which is Power-ed ON, hence why you cannot delete it.
Your VM's files are using this DS for its VMDK and you may have config'd your host to use this DS for the VM's swap file. If you pwr down the VM, the .vswp file goes away. You should also be able to move the VMDK to another DS while the VM is powered down as well.

~coolsport00
Avatar of hongedit

ASKER

Thats the thing.

I cannot manually delete any of the 4 files left in this datastore, not just the vswp one.

I'll shut the VM down that it belongs to in a couple hours and see if it disappears. But WHY would it be in this datastore?
That's because it's in USE!

be very careful what you delete!
Your VMDK is prob assigned to your VM. You should be able to go into your VM settings and see it, yes? And, you should be able to see what datastore the VM's VMDKs are on.

And, if you redirected your VM's swapfile location...you won't need to delete that, it'll disappear once the VM is powered down.
Ok.

I downloaded the .vmx file and I found this line:

sched.swap.derivedName = "/vmfs/volumes/4dd54b7b-0c9419b8-767f-00259033dd4c/Server 2003-54224000.vswp"

This matches what is in the datastore I want to delete.

Question is,

A) How do I move this back to its default location (same dir the vmx/vmdk resides)
B) How did this happen? I dont remember manually putting this in...
ASKER CERTIFIED SOLUTION
Avatar of coolsport00
coolsport00
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To answer your "B" question. Not sure...only you can ;) This is a manual process so someone had to configure it...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
**NOTE: IF THE HOST OR CLUSTER DEFAULT IS TO STORE THE .VSWP IN AN ANCILLARY DATASTORE, THEN THE .VSWP MAY STILL GET PLACED IN THE ANCILLARY DATASTORE & NOT WITH THE VM. If that is the case, you should select the 2nd option - store with the VM.
Ok, I have done that but the file is still there. Do I need to reboot the VM?

Also, the rest of the files are old snapshot files I think.

I'm pretty sure they are orphaned from a prior incident, as the last modified date on the was over a year ago and the VM they relate to is called something different now.

However still unable to delete them.

Exchange_1-00000007.vmdk
Exchange-0000004.vmdk
Exchange_1-00000008.vmdk

All 2MB in size.
Yes...you more than likely have to restart the VM...
I would move the files, rather than delete, just in case you need them.

you could login at the console or SSH, and check they are not in use, this would be the scientific  way of checking, rather than the just delete them!
I have personally download file to my workstation before deleting just in case I missed something & they were then needed post-deletion....
Hmm. Rebooted.

Nothing seems to have changed??
Refresh your datastore?
login via ssh or on the console, and use

lsof | grep<name of locked file>

check which process has the file opened
Refreshed Datatsore, the vswp file is still there.

Logged in via SSH.

lsof | grep <filename>

Just returns the bash prompt again...(i.e no result)
I noticed as well in SSH there are some delta files there too which dont show in the datastore browser.

One delta file for each vmdk.
?? Wierd! You may be able to take a snap of the VM, wait like 10mins, then go into Snap Mgr and remove the snap. That may take care of those files...
Thats the thing - these snapshot files in this datastore I want to get rid of do not even tie up with any current Live VM...

So currently I still have 1 vswp file which wont go away, and some random old snapshot files which I cant delete...
OK, I think I got rid of the snapshor files and delta files via SSH.

I copied them to a local datastore and then deleted via rm command.

So that just leaves this vswp file which should be with the VM, but isnt.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow..that was fast! Sorry...was on a call with someone. Well, glad you're good to go now...
No Comment