VMware Cloud Community
kunikuman
Contributor
Contributor
Jump to solution

How to delete .vmx file

Capture3.PNG

Reply
0 Kudos
1 Solution

Accepted Solutions
jfene72
Enthusiast
Enthusiast
Jump to solution

SSH to the ESXi host as root and navigate to /vmfs/volumes/<data store guid or name>. Locate the VM folder although from your pic, it seems that the vmx files are under the root of the datastore itself.

Do an ls -l to verify that the files do indeed exist and to check what permissions are currently assigned. If they do exist, change the permissions using something like chmod 755 vmxfile and then try removing then using rm vmxfile.

Something like so:

pastedImage_4.png

View solution in original post

Reply
0 Kudos
8 Replies
AjayChanana
Enthusiast
Enthusiast
Jump to solution

This look that its already been locked by someother host. If that not the case. All you can browse the datastore and delete it.

other possibility to remove all kind of lock is to reboot the host.

see if that help, or let me know if you get any errors ?

Regards,
Ajay Chanana
Reply
0 Kudos
vijayrana968
Virtuoso
Virtuoso
Jump to solution

Have you checked browsing datastore those files exists there ? If not, restart management agent and recheck.

Reply
0 Kudos
hussainbte
Expert
Expert
Jump to solution

check which host is locking the file if the delete from datastore browser fails.

once VM is powered off the delete from datastore for the vmx should succeed .

you can use the command

vmkfstools -D vmname.vmx

to determine the mac address of the hold which is locking the file.

ssh to the hold and if there is any vmx process locking the file , kill the vm-world holding the lock

you should then be able to delete the file.

If you found my answers useful please consider marking them as Correct OR Helpful Regards, Hussain https://virtualcubes.wordpress.com/
Reply
0 Kudos
kunikuman
Contributor
Contributor
Jump to solution

tried but it dosent work with your mention

Thank you so much vijayrana968

Reply
0 Kudos
kunikuman
Contributor
Contributor
Jump to solution

let me try

thank you so much

Reply
0 Kudos
vijayrana968
Virtuoso
Virtuoso
Jump to solution

How did you removed these VMs before it starts showing this status. Did any error shown when you tried to delete ?

Reply
0 Kudos
jfene72
Enthusiast
Enthusiast
Jump to solution

SSH to the ESXi host as root and navigate to /vmfs/volumes/<data store guid or name>. Locate the VM folder although from your pic, it seems that the vmx files are under the root of the datastore itself.

Do an ls -l to verify that the files do indeed exist and to check what permissions are currently assigned. If they do exist, change the permissions using something like chmod 755 vmxfile and then try removing then using rm vmxfile.

Something like so:

pastedImage_4.png

Reply
0 Kudos
kunikuman
Contributor
Contributor
Jump to solution

Thank you so much for your comment this is useful for me

AjayChanana

vijayrana968

hussainbte

jfene72

Reply
0 Kudos