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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
coolsport00Commented:
Try removing the VM from Inventory. If that doesn't work, remove the original VM from Inventory as well, then try.

~coolsport00
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SlavyanAuthor Commented:
That worked and it was easy!

Thanks!
0
loshdogCommented:
Many thanks CoolSport00..  Saved me lots of time
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VMware

From novice to tech pro — start learning today.