VMware Cloud Community
saunders
Contributor
Contributor

"Invalid Arguement" when trying to delete files

Hey everybody, i could use some help..

I am running ESX 3.0.1. The VMFS is mounted on an external SCSI drive (Dell Powervault PV220s). I have created a few VMs, Vmotioned them around, etc. Somehow, the files on the disk have become corrupted, so i choose to "remove from inventory". I then tried to use the VC Client software to browse to the datastore and delete the left over files on the disk. When i try to delete them, i get the error message "Cannot delete file". So, i tried by command line. I tried a "rm -fr *" inside the VM directory (/vmfs/volumes/pv220/myvm/" The command line comes back with an error "rm: cannot remove 'myvm.vmx': Invalid Arguement".

Any ideas? I have several old vm directories that it wont let me delete from with the same issue.

Thanks

0 Kudos
8 Replies
VirtualKenneth
Virtuoso
Virtuoso

Have you tried to reboot the ESX server before deleting?

0 Kudos
saunders
Contributor
Contributor

Yup, tried a reboot. I have also tried other information i have found in the forums here, like the #lsof command. Files are completed unregistered from ESX.

Right now i am trying to do an "rm -fr *" and i get the invalid argument errors.

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

That's odd... I assume that there are "legal" files on the VMFS as well?

I know these scenario's with corrupted NTFS and have seen scenario's in where it was never possible to delete files from there... Only reformatting helped me out in that scenario's.

0 Kudos
saunders
Contributor
Contributor

Yah, the full path for the file is "/vmfs/volumes/pv220/vista/vista.vmx"

(dont hold it to me that i have a vista image, i am having the same trouble with W2k3 images).

Does it have anything do with the VMFS being shared? I read something that said you cant change names of files since they are shared?

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

You can't change names whenever it's in use by one of the other ESX hosts.

Normally this wouldn't cause any problems.

0 Kudos
saunders
Contributor
Contributor

Is there a connection between the file that you see in the command line and the files you see in the Virtual Center? I can move/rename files at the command line, then go to the datastore browser in VC and the files still have their original name. Even after a refresh.

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

Yep there in fact the same file.

Try restarting the mgmt-vmware service, then the file in the datastore will match your filename from commandline

service mgmt-vmware restart[/i]

BTW Don't use this if you use the "Automatic startup option for VM's"

0 Kudos
saunders
Contributor
Contributor

I think this issue might have been related to the setup of my powervault. I went ahead and erased the logical drives and started over. So far, so good.

Thanks

Saunders

0 Kudos