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
  6. Now run this command using the domain ID from the output of step 7
    xl destroy <DOMID from step 7>
Share

Running pfSense in a XenServer with xenguest

If you deploy pfSense on a XenServer, you may be shocked at the performance loss-specially on interface speed! But wait, there are some tweaks to make this usable.

Installing pfSense

Go ahead and setup pfSense like normal, and when you are done, perform the following tweaks. (the day till it’s tested on pfsense version 2.5.2 and xen on scp-ng 8.1)

XenServer tweaks

Find UUID for the pfSense VM you just installed.

xe vm-list

You should get something like the following

uuid ( RO) : b435d920-eb22-b45d-5058-091619ed427f
name-label ( RW): pfSense
power-state ( RO): running

uuid ( RO) : 42626f69-6185-4aa6-a125-839700f96828
name-label ( RW): Control domain on host: xenserver-000
power-state ( RO): running

We want the UUID of the instance running pfSense, b435d920-eb22-b45d-5058-091619ed427f in this case. Continue reading “Running pfSense in a XenServer with xenguest” »

Share

Export/ Import VM to/from a backup file using command line on XenServer

Identify VM’s UUID

We start by identifying a virtual machine we would lake to export to as a regular backup file. Run xe vm-list to list all available virtual machines and take a note of the virtual machine in question:

# xe vm-list
uuid ( RO) : 7371124f-7d4d-66b7-cbc7-a98b1457543e
name-label ( RW): Debian Jessie 8.5
power-state ( RO): halted

uuid ( RO) : bad8e456-df88-435d-ba12-3f0f6e54b2c6
name-label ( RW): Control domain on host: xenserver
power-state ( RO): running

Take VM snapshot Continue reading “Export/ Import VM to/from a backup file using command line on XenServer” »

Share

How to Add Additional Physical NICs to XenServer

From the XenServer Command Line Interface (CLI), issue the following command:

xe pif-list

Press Enter.

Note: If you have more than one XenServer in the pool, you must issue the xe host-list command to list all the XenServer hosts and write down the Universally Unique Identifier (UUID) of the host that you added the new NIC, then issue command xe pif-list host-uuid=[uuid of the XenServer host]

The preceding command lists all the physical NICs of that XenServer. If you do not see the additional NIC, you must scan for new physical interface(s) on a XenServer and issue this command:

xe pif-scan host-uuid=[uuid of the XenServer host]

Press Enter. Continue reading “How to Add Additional Physical NICs to XenServer” »

Share