VMware Cloud Community
spham68
Contributor
Contributor
Jump to solution

How to kill a process on esx host that keeps the vmdk and swap file open

All,

A virtual machine was not deleted in the virtualcenter. Someone delete all the files in the vm directory while it is being powered. Now it becomes orphaned and can not delete the vmdk and swap file because it is being opened.

How would I go about killing this process and sucessful delete vmdk and swap file in that directory? I did a command ps -auxwww |grep -i vvm and it is still showing up. The ESX host is part of a cluster if I failover the other host I would suspect

orphaned vm will also failover.

Running ESX 3.5 with update 1

Any ideas?

Thanks,

Steve

0 Kudos
1 Solution

Accepted Solutions
vmmeup
Expert
Expert
Jump to solution

Do a ps -ax | grep vmname.vmx use the actual filename to the vmx file. Find the PID id and do a kill -9 PID id Just so you know the -9 means kill the process without prejudice. If it still shows up in VC just remove it from inventory if VC barks at you then restart the VC service and try again.

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉

View solution in original post

0 Kudos
4 Replies
vmmeup
Expert
Expert
Jump to solution

Do a ps -ax | grep vmname.vmx use the actual filename to the vmx file. Find the PID id and do a kill -9 PID id Just so you know the -9 means kill the process without prejudice. If it still shows up in VC just remove it from inventory if VC barks at you then restart the VC service and try again.

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
mike_laspina
Champion
Champion
Jump to solution

Hi,

Connect directly to the ESX host with the VI Client using the root user or any authed ID and power off the VM with a rclick on the VM object.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
spham68
Contributor
Contributor
Jump to solution

I was able to kill the process after looking at the PID ID.

Thanks,

Steve

0 Kudos
mike_laspina
Champion
Champion
Jump to solution

FYI,

You could also use the list open files command to find the offending process in the future.

lsof | grep filename

http://blog.laspina.ca/ vExpert 2009