VMware Cloud Community
vmthunder
Contributor
Contributor

Can't delete remaining files from deleted VM..

Hello. I had an old VM that wouldn't boot, so I just did the "Delete from Disk" option to delete the VM because I didn't need it. It no longer shows up in VC, but the flat.vmdk and .vswp files are still showing on the storage drive and will not let me delete them. Oddly enough the .vswp file has a modified date of the present time and is consistently updating. Is it possible something else is using the swap file from that old VM? Any suggestion on how to delete the files? All is on a FC SAN. Thanks!

Tags (1)
0 Kudos
5 Replies
nick_couchman
Immortal
Immortal

I assume that if you have a SAN you have multiple ESX hosts - make sure none of them is running the VM and that it is removed from inventory on all of the hosts. Also, you might log in to the service console on the host that was last running the VM and see if there's still a process related to that VM. You can also reboot the ESX host that was running the VM and see if that clears it out.

0 Kudos
mike_laspina
Champion
Champion

If you don't see it in VC you can run the following at each console to find where it's locked

lsof -g

It may require a host restart.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
vmthunder
Contributor
Contributor

Pardon my Linux ignorance. I ran the lsof -g and piped it to a log file and there are about 1700 lines of text. What am I looking for exactly? the file name?

A little more info: This is the last 2 files on this LUN (migrated other VM's to different LUN) and we are ready do delete the LUN, but kinda relunctant if something is hitting that vswp file.

I checked the settings of the other VM's and none of them are using the VMDK file - and the HA cluster settings is set to "Store swapfile in same directory...". I have a good idea which host the VM was running on before the delete, but restarting the host is the last resort if I can help it.

0 Kudos
nick_couchman
Immortal
Immortal

Yes, you're looking for the file name. You can also "lsof -g | grep -i <filename>" which should output only the lines of lsof that match that filename.

0 Kudos
vmthunder
Contributor
Contributor

The log reports do not show the files being locked - or show up at all for

that matter. Weird. Anyone ever deleted a LUN at the SAN level without

first removing it from ESX? I'm to that point, but would rather not freak

out my hosts. Thanks!

0 Kudos