The most important command for managing pretty much anything in Linux is vi. So if you only learn one command, learn that one. But if you want to learn another, the second most important command for managing Xen is then xm (well, once you’ve apt-gotten or yummied up the installation that is). The xm command has a number of easy verbs, each used for managing the Xen environment.
- xm info – Shows information about the Xen host
- xm list – Shows information about doms (states include r for running, b for blocked, c for crashed, p for paused and the worse, d for dying).
- xm network-list – Shows virtual interfaces for doms
- xm log – Shows information from the Xen logs
- xm reboot – Reboots a VM
- xm vcpu-list – Shows dom virtual processors
- xm top – Shows hosts and domains similar to how top works in *nix
- xm uptime – Shows uptime
- xm dmesg – Shows the send message buffer
- xm create https://krypted.com/ – Create a node called krypted.com
- xm console https://krypted.com/ – Switch to that new https://krypted.com/ node
- xm destroy https://krypted.com/ – Deletes that newly created https://krypted.com/ node
- xm shell – Invoke an interactive shell environment of your xend
- xm shutdown – Turn off a VM
- xm pause – Rather than shut the VM down, just pause it (starts back up much faster), but if the host is rebooted then state is lost (otherwise use suspend)
- xm suspend – Suspends a VM, which writes the data to disk, so changes wouldn’t be lost on restart.
- xm rename – Rename installed VMs
- xm resume – If a VM is paused, fire it up
- xm save – Similar to suspend except with user definable state file
- xm restore – Similar to resume except restoreable with exports that used the save verb
- xm dump-core – Dumps core per domain
- xm sysrq – Sends system requests per domain
- xm block-list – Lists block devices per domain
- xm mem-max – Configure the maximum memory for a domain
- xm mem-set – Configure the current memory allowance for a domain
- xm vcpu-set – Configure active processors for a domain
- xm migrate – Move a domain to another server (e.g. using the -l operator to do so live)
Virt-manager and virt-install can be used to manage and create virtual machines for use with Xen.
Virsh can also be of assistance:
- virsh nodeinfo – Shows information about each node
- virsh vcpuinfo – Shows information about virtual processors
- virsh dominfo – Shows information about domains
- virsh dumpxml – Dumps the same information just in parseable XML