Thursday, 15 April 2021

Force kill a VM in EXSi

2 commands refer: Unable to Power off a Virtual Machine in an ESXi host (1014165) (vmware.com)


Using the ESXi esxcli command to power off a virtual machine

The esxcli command can be used locally or remotely to power off a virtual machine running on ESXi 5.x or later.

  1. Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file by running this command:

    esxcli vm process list
     
  2. Power off the virtual machine from the list by running this command:

    esxcli vm process kill --type= [soft,hard,force] --world-id= WorldNumber

    Notes:
    • Three power-off methods are available. Soft is the most graceful, hard performs an immediate shutdown, and force should be used as a last resort.
  3. Repeat Step 2 and validate that the virtual machine is no longer running.

 


[root@ESXi01:~] esxcli vm process list

pfSense

   World ID: 1051128

   Process ID: 0

   VMX Cartel ID: 1051127

   UUID: 56 4d df ac 10 5b db 2f-ac b1 35 b6 0e 8f 27 94

   Display Name: pfSense

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/pfSense/pfSens                                                                                                                                                             e.vmx


okd4-control-plane-1

   World ID: 1051325

   Process ID: 0

   VMX Cartel ID: 1051319

   UUID: 56 4d d7 00 05 94 43 e6-20 49 b7 0d cd 1f d4 91

   Display Name: okd4-control-plane-1

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-p                                                                                                                                                             lane-1/okd4-control-plane-1.vmx


okd4-control-plane-2

   World ID: 1051326

   Process ID: 0

   VMX Cartel ID: 1051320

   UUID: 56 4d 47 7f ff 36 07 68-9b 88 17 5a f7 53 d5 80

   Display Name: okd4-control-plane-2

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-p                                                                                                                                                             lane-2/okd4-control-plane-2.vmx


okd4-services

   World ID: 1051330

   Process ID: 0

   VMX Cartel ID: 1051317

   UUID: 56 4d 98 40 1a ac 88 ff-f0 4d e8 84 29 31 04 1c

   Display Name: okd4-services

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-services/                                                                                                                                                             okd4-services.vmx


okd4-control-plane-3

   World ID: 1051331

   Process ID: 0

   VMX Cartel ID: 1051318

   UUID: 56 4d 48 7c 89 01 58 9a-12 44 bf 54 a0 4a 61 2d

   Display Name: okd4-control-plane-3

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-p                                                                                                                                                             lane-3/okd4-control-plane-3.vmx


okd4-compute-1

   World ID: 1051332

   Process ID: 0

   VMX Cartel ID: 1051321

   UUID: 56 4d 61 ba 77 36 bb 6f-ec 88 25 ee 69 be 0c 22

   Display Name: okd4-compute-1

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-compute-1                                                                                                                                                             /okd4-compute-1.vmx


database

   World ID: 1051551

   Process ID: 0

   VMX Cartel ID: 1051550

   UUID: 56 4d 57 81 ce 26 3c d9-26 18 b8 1f 79 f7 d1 a3

   Display Name: database

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/database/datab                                                                                                                                                             ase.vmx


okd4-compute-2

   World ID: 1155186

   Process ID: 0

   VMX Cartel ID: 1155185

   UUID: 56 4d 1a 5c ce ef ea d0-8d eb 37 8a bb d6 1b 9f

   Display Name: okd4-compute-2

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-compute-2                                                                                                                                                             /okd4-compute-2.vmx

[root@ESXi01:~] esxcli vm process list

pfSense

   World ID: 1051128

   Process ID: 0

   VMX Cartel ID: 1051127

   UUID: 56 4d df ac 10 5b db 2f-ac b1 35 b6 0e 8f 27 94

   Display Name: pfSense

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/pfSense/pfSense.vmx


okd4-control-plane-1

   World ID: 1051325

   Process ID: 0

   VMX Cartel ID: 1051319

   UUID: 56 4d d7 00 05 94 43 e6-20 49 b7 0d cd 1f d4 91

   Display Name: okd4-control-plane-1

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-plane-1/okd4-control-plane-1.vmx


okd4-control-plane-2

   World ID: 1051326

   Process ID: 0

   VMX Cartel ID: 1051320

   UUID: 56 4d 47 7f ff 36 07 68-9b 88 17 5a f7 53 d5 80

   Display Name: okd4-control-plane-2

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-plane-2/okd4-control-plane-2.vmx


okd4-services

   World ID: 1051330

   Process ID: 0

   VMX Cartel ID: 1051317

   UUID: 56 4d 98 40 1a ac 88 ff-f0 4d e8 84 29 31 04 1c

   Display Name: okd4-services

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-services/okd4-services.vmx


okd4-control-plane-3

   World ID: 1051331

   Process ID: 0

   VMX Cartel ID: 1051318

   UUID: 56 4d 48 7c 89 01 58 9a-12 44 bf 54 a0 4a 61 2d

   Display Name: okd4-control-plane-3

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-plane-3/okd4-control-plane-3.vmx


okd4-compute-1

   World ID: 1051332

   Process ID: 0

   VMX Cartel ID: 1051321

   UUID: 56 4d 61 ba 77 36 bb 6f-ec 88 25 ee 69 be 0c 22

   Display Name: okd4-compute-1

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-compute-1/okd4-compute-1.vmx


database

   World ID: 1051551

   Process ID: 0

   VMX Cartel ID: 1051550

   UUID: 56 4d 57 81 ce 26 3c d9-26 18 b8 1f 79 f7 d1 a3

   Display Name: database

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/database/database.vmx


okd4-compute-2

   World ID: 1155186

   Process ID: 0

   VMX Cartel ID: 1155185

   UUID: 56 4d 1a 5c ce ef ea d0-8d eb 37 8a bb d6 1b 9f

   Display Name: okd4-compute-2

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-compute-2/okd4-compute-2.vmx

[root@ESXi01:~] esxcli vm process kill --type=force --world-id=1051551

[root@ESXi01:~] esxcli vm process list

pfSense

   World ID: 1051128

   Process ID: 0

   VMX Cartel ID: 1051127

   UUID: 56 4d df ac 10 5b db 2f-ac b1 35 b6 0e 8f 27 94

   Display Name: pfSense

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/pfSense/pfSense.vmx


okd4-control-plane-1

   World ID: 1051325

   Process ID: 0

   VMX Cartel ID: 1051319

   UUID: 56 4d d7 00 05 94 43 e6-20 49 b7 0d cd 1f d4 91

   Display Name: okd4-control-plane-1

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-plane-1/okd4-control-plane-1.vmx


okd4-control-plane-2

   World ID: 1051326

   Process ID: 0

   VMX Cartel ID: 1051320

   UUID: 56 4d 47 7f ff 36 07 68-9b 88 17 5a f7 53 d5 80

   Display Name: okd4-control-plane-2

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-plane-2/okd4-control-plane-2.vmx


okd4-services

   World ID: 1051330

   Process ID: 0

   VMX Cartel ID: 1051317

   UUID: 56 4d 98 40 1a ac 88 ff-f0 4d e8 84 29 31 04 1c

   Display Name: okd4-services

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-services/okd4-services.vmx


okd4-control-plane-3

   World ID: 1051331

   Process ID: 0

   VMX Cartel ID: 1051318

   UUID: 56 4d 48 7c 89 01 58 9a-12 44 bf 54 a0 4a 61 2d

   Display Name: okd4-control-plane-3

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-control-plane-3/okd4-control-plane-3.vmx


okd4-compute-1

   World ID: 1051332

   Process ID: 0

   VMX Cartel ID: 1051321

   UUID: 56 4d 61 ba 77 36 bb 6f-ec 88 25 ee 69 be 0c 22

   Display Name: okd4-compute-1

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-compute-1/okd4-compute-1.vmx


okd4-compute-2

   World ID: 1155186

   Process ID: 0

   VMX Cartel ID: 1155185

   UUID: 56 4d 1a 5c ce ef ea d0-8d eb 37 8a bb d6 1b 9f

   Display Name: okd4-compute-2

   Config File: /vmfs/volumes/5f1c7304-77d00f04-ad0f-1c697a6ba3e5/okd4-compute-2/okd4-compute-2.vmx


No comments:

Post a Comment