VMware Cloud Community
hugor99
Contributor
Contributor

Deleting vmdk file throws "No such file or directory" error

Hi all,

I've tried everything to delete one particular VMDK file and had no success. It was created during a failed cloning operation and now I cannot delete it.

Here is what I've tried so far:

Deleting from datastore browser: This changed the file size down to 7GB but I got "error caused by file"

Rename the file: This created a new file with the new name, and now I have 2 files I can't delete!

Adding the vmdk to a new VM and deleting the VM from disk: The wizard did not find the .vmdk file, so I couldn't do this.

Deleting the file manually from console: I get the error "No such file or directory"

Using chmod 777: ls -la shows that the permissions are changed, but I still cannot delete the file

Reset the LUN: the file is on an iSCSI target, so I've tried resetting the lun in vmware and I've also manually reset the iSCSI connections on the iSCSI target

Use vmkfstools: When I try this I get "failed to delete virtual disk: the file specified is not a virtual disk (15)"

lsof | grep vmdk: there are no open vmdk files on the host, and there is only one host

touch : no results

So it looks like there is a lock from an unknown host (owner 00000000-00000000-0000-000000000000), how do I remove this lock so I can delete these two files?

0 Kudos
6 Replies
Troy_Clavell
Immortal
Immortal

restart the management agents on the ESXi Host and then try again.

http://kb.vmware.com/kb/1003490

0 Kudos
hugor99
Contributor
Contributor

Hi Troy,

I just ran services.sh restart and tried again, but I am still getting:

rm: cannot remove "badfile.vmdk": No such file or directory

Thanks for th suggestion tho.

0 Kudos
Troy_Clavell
Immortal
Immortal

you have restarted the management agents on all the hosts that have access to the datastore in question?

0 Kudos
hugor99
Contributor
Contributor

Hi Troy,

I only have one host that is accessing this datastore. I did have another host, but it is powered down.

0 Kudos
EdBrenton
Contributor
Contributor


I had this same issue.

I could successfully "touch" the file, but rm returned a "No such file or directory" error.

The only way I could get rid of it was to remove all other files from the datastore and then delete the datastore from within vCenter.

Make sure you are not accessing the volume on the console or it wont let you delete it. (This got me.)

Then on the SAN I deleted the volume and created a new one.

I'm not sure what would have happened if I readded the datastore to the same volume, didn't try that.

0 Kudos
continuum
Immortal
Immortal

This sounds familiar - with one type of vmdk corruption (AIOMgr type 3 I/O error) this is what I would expect.

Whenever I get this error I recommed to complete wipe the volume with zeroes before you try to recreate the datastore.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos