Skip to content
Home » Citrix » Shutdown a hung VM on XenServer

Shutdown a hung VM on XenServer

If you are an IT administrator or a system engineer, and your organization uses Citrix XenServer, it is likely you have encountered a situation where a VM becomes unresponsive or “hangs” while running on XenServer, which prevents you from shutting it down gracefully. In these cases, it is very important to take immediate action to prevent data loss or other issues. Shutting down a hung VM on XenServer is quite easy once you know how to do it. We have 3 different methods for accomplishing this because there are some situations where one method won’t work, so at least one of these should do the trick for you…

Option 1:

The first thing to try is a force shutdown on the VM:

xe vm-shutdown -–force uuid=[UUID for VM]

If this still doesn’t work you can try taking a look in the XenServer pending task queue:

xe task-listxe task-cancel uuid=[task uuid]

Option 2:

  1. get server’s UUID from xencenter
  2. Run the following command:
    list_domains | grep 6915704e-e6c1-9310-3405-0fcda6fded5e

3. Run the following command (replacing the “49” with the domain you received from running the command in step 2):
/opt/xensource/debug/xenops destroy_domain -domid 49

Option 3:

  1. run this: list_domains | grep 6b808153-55ac-5c5b-b778-d596dad8d1a2
  2. run this: /opt/xensource/debug/xenops destroy_domain -domid 162
  3. do an xe-toolstack-restart on the host it was running on
    after that, the server will probably say “vdi unavailable”…
  4. follow these instructions:
  5. run this: xe vm-start vm=DMZwiki
  6. run this: xe vdi-forget uuid=bde9274e-864b-4822-96a7-cd2ed76165f0
  7. run this: xe vdi-param-set uuid=bde9274e-864b-4822-96a7-cd2ed76165f0 name-label=DMZwiki_old

Thank you for visiting our website and we hope that our instructions for shutting down a hung VM on XenServer have been helpful to you. If you found our guide informative and useful, please consider sharing it with your friends and colleagues who might also benefit from this knowledge. Your support in spreading the word about our website is greatly appreciated and will help us continue to provide valuable resources to the world. Thank you again for your time and we look forward to your continued support.