Force stop xen vm using command line

Instructions

  1. Disable High Availability (HA) so you don’t run into issues.
  2. Log into the Xenserver host that is running your VM with issues via ssh or console via XenCenter. Run the following command to list VMs and their UUIDs
    xe vm-list resident-on=<uuid_of_host>
  3. First you can try just the normal shutdown command with force
    xe vm-shutdown uuid=<UUID from step 3> force=true
  4. If that just hangs, use CONTROL+C to kill it off and try to reset the power state.  The force is required on this command
    xe vm-reset-powerstate uuid=<UUID from step 3> force=true
  5. If the VM is still not shutdown, we may need to destroy the domain.  Run this command to get the domain id of the VM.  It is the number in the first row of output. The list will be the VMs on the host.  Dom0 will be the host itself and all numbers after are running VM
    list_domains

Now run this command using the domain ID from the output of step 7

xl destroy <DOMID from step 7>

To start the VM use-

xe vm-start name-label=$VMN
Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.