hongedit
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.
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.
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
~coolsport00
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?
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!
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.
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.
ASKER
Ok.
I downloaded the .vmx file and I found this line:
sched.swap.derivedName = "/vmfs/volumes/4dd54b7b-0c 9419b8-767 f-00259033 dd4c/Serve r 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...
I downloaded the .vmx file and I found this line:
sched.swap.derivedName = "/vmfs/volumes/4dd54b7b-0c
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To answer your "B" question. Not sure...only you can ;) This is a manual process so someone had to configure it...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
**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.
ASKER
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.
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!
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!
lsof | grep<name of locked file>
I have personally download file to my workstation before deleting just in case I missed something & they were then needed post-deletion....
ASKER
Hmm. Rebooted.
Nothing seems to have changed??
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
lsof | grep<name of locked file>
check which process has the file opened
ASKER
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)
Logged in via SSH.
lsof | grep <filename>
Just returns the bash prompt again...(i.e no result)
ASKER
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.
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...
ASKER
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...
So currently I still have 1 vswp file which wont go away, and some random old snapshot files which I cant delete...
ASKER
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Wow..that was fast! Sorry...was on a call with someone. Well, glad you're good to go now...
ASKER
No Comment