Highlighted
Contributor
Contributor

Unable to Kill VM from ESXI using Putty

Hi All,

I have encountered a strange case while trying to fix my Vdi environment.

From vCenter I'm unable to power off /suspend/reset the vm which is triggering alert " Another task is already running". Then I came to know that particular VM is not installed with VMware tools and got failed to install throwing the same error.

Below are the troubleshooting steps I tried,

1. Remove the NIC card and reassign.

2. Login to esxi and kill the vm using world ID. "Something strange happened here as I could find the world ID but while running the command to kill the vm it displays "couldn't find the world ID number"

3. Again I tried to get the vm list using ESXCLI vm process list and then I am unable to find the particular VM. (Stil the VM is pingable)

4. Taking RDP console I shutdown the VM but still from Vcenter it is showing as VM running status. (VM not pinging)

Note: Cannot restart Management agents as there is some dependency on monitoring that triggers alerts.

5 Replies
Highlighted
Champion
Champion

If you powered off VM and you still ping it you likely have IP address conflict.

However can you show outputs from your troubleshooting? maybe you are looking for incorrect IDs?

0 Kudos
Highlighted
Hot Shot
Hot Shot

The brute force is with you

This is the crudest method used to terminate a VM I can think of. It’s actually documented on the VMware site albeit slightly differently. A VM is invariably a series of processes running on ESXi. Using the ps command below, I can list the processes associated, say, with a VM called Centos 7 Web Server.

1

ps | grep "Centos 7 Web Server"

Listing the processes associated with a VMListing the processes associated with a VM

If you look closely, you’ll see that the value in the second column is identical to all processes. This is the VMX Cartel ID value which, although different from the World ID value, can still be targeted to terminate a VM as follows:

1

kill 797300

If the processes persist in running, try kill -9 <process id>.

Shell

1

kill -9 797300

Thanks

Vmwarediary.com/vmwarediary.in

Highlighted
Contributor
Contributor

Hi,

The VM is not pinging after power down but the status in VC showing as like the VM is running.(Options I see is Power off, Suspend, Reset VM)

Now in this case the vm is not pining and I wont be able to find the world ID (Since it is Powered off)

Please suggest me some steps to troubleshoot.

0 Kudos
Highlighted
Champion
Champion

You are probably looking on wrong VM with same display name as VM which you powered off.

Can you post some screenshots about running VM in question, on which host is it running? Can you check on this host output of the following command 'vim-cmd vmsvc/getallvms' and try find the running VM.

0 Kudos
Highlighted
Enthusiast
Enthusiast

See if you are able to see the specific VM with this command:

vim-cmd vmsvc/getallvms

If you are able to see that specific VM, that must be having some numeric ID.

Get the status of VM is its Power ON or not:

vim-cmd vmsvc/power.getstate vmid

If its on please power off with below command:

vim-cmd vmsvc/power.off vmid

Use restart if you need to restart in place of power.off

×××××××××××××××××××××××××××××××××××××××××××××××

And if you want to remove this VM permanently, please run below commands as well:

First of all Unregister the VM using VIM command:

vim-cmd vmsvc/unregister vmid

Then Delete the VM using destroy command:

vim-cmd vmsvc/destroy vmid.

Hope that will help 🙂

0 Kudos