ESXi 4 - cannot delete .vmdk file

Hello,

I've cloned a .vmdk file using vmkfstools -i and now I can't delete the new file. I've tried deleting the new file from the datastore browser and using vmfsktools.

When trying to delete from the datastore browser, I get this message:
"Cannot delete file [DATASTORE] myfile.vmdk"

Using vmfsktools -U to delete gives me this error message:
"Unable to delete virtual disk : Error caused by file /vmfs/volumes/1234567-1234567-424-1234567dfad/myfile.vmdk"

I've restarted the ESXi 4 server which cloned the original file and also restarted the VMware Management Assistant but still could not remove the file.

My setup: vCenter 4 with two ESXi 4 servers connected to a SAN via fibre.

How do I delete this file?
If the file is locked, how can I see what has locked it?

Max
SlavyanAsked:
Who is Participating?
 
coolsport00Commented:
I saw a VMware Community post where someone renamed the folder the VM was in. This is what he said:
"I renamed the containing folder (e.g. folder1 to folder1a) and it created a copy of the vmdk file in that folder. I then proceeded to delete the vmdk file in the new folder (folder1a) and went back to the old offending folder/file and was then able to delete the vmdk file. After this I was able to delete both folders and now the datastore is clean." You should be able to do this within the Datastore Browser window. Let me know if that works.

~coolsport00
0
 
coolsport00Commented:
Is the VM powered on or off? If it's on...try powering it down then delete the vmdk file.

~coolsport00
0
 
SlavyanAuthor Commented:
This was a clone of a vmdk file and the original VM has never been turned on.
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
coolsport00Commented:
Try removing the VM from Inventory. If that doesn't work, remove the original VM from Inventory as well, then try.

~coolsport00
0
 
SlavyanAuthor Commented:
Removed the source VM from Inventory but still can't delete the file using datastore browser or vmkfstools.
0
 
coolsport00Commented:
Hmm...about the only other way I can think of is enable SSH on the host, WinSCP to it, browse to the datastore with the VM files and delete them that way. Do you know how to enable SSH in ESXi?

~coolsport00
0
 
SlavyanAuthor Commented:
Yes I know how to enable SSH on ESXi 4 but I'm a little concerned about the warning message you get:
"WARNING - Tech Support Mode is not supported unless used in consultation with VMware Tech Support."

Will enabling SSH on ESXi 4 void our VMware support agreement?
0
 
coolsport00Commented:
'Officially'...yes; but if you disable SSH when you're done, you will be ok. You just need to get the 'ok' from VMware Support to enable SSH to be able to do what you need to do; in this case, delete a file.
0
 
SlavyanAuthor Commented:
That worked and it was easy!

Thanks!
0
 
loshdogCommented:
Many thanks CoolSport00..  Saved me lots of time
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.