Xen Cheat SheetEdit Cheat Sheet Xen Test if you are running a Xen kernel: cat /sys/hypervisor/properties/capabilities Xen vs. Xen Server Xen - Commands xm list # List all domains xm list vm1 # List status of a single VM xm list vm1 -l # Details for a VM xm create vm1 # Starts/Creates a VM xm reboot vm1 xm shutdown vm1 xm destroy vm1 xm network-list vm1 xm console vm1 # Open console to VM (escape like telnet) xm info # HV infos xm top # Monitor HV and domains xm log # View HV log xm dominfo xm vcpuinfo xm nodeinfo Ensure guest auto start on boot: ln -s /etc/xen/ /etc/xen/auto/ Find out which dom0 you are on: dmesg | grep "command line" # Should give you something like: # # Kernel command line: ro root=/dev/VolGroup00/LogVol00 console=xvc0 hostip=10.0.0.17 # # Where "hostip" is the IP of the hypervisor Find out which IP a VM has: # Grep and resolve MAC: xm list -l | grep mac arp -a | grep -i Xen Server Feature Matrix XenServer Free vs. Enterprise: Whats the difference and what features are provided by "xe" what "xm" doesn't haveā€¦ XenServer GUI Comparison Free vs. Enterprise Xen Server - Hanging Operation on Shutdown: This happens when for example a reboot doesn't work and you want to perform a shutdown to quickly restore an unresponding VM. The first task (reboot) is ineffective and won't complete and thereby will block the second task (the shutdown). Destroying the VM domain solves the issue: xe vm-list # 1. Resolve VM UUID with list_domains | grep # 2. Get Domain Id /opt/xensource/debug/destroy_domain -domid # 3. Kill Domain Id xe vm-reboot uuid= force=true # 4. Force Action An alternative is described here and involves determining the hanging task and cancelling it: xe task-list # Get task uid xe task-cancel uuid= # And cancel it XenServer - Add Another Physical Disk: xe host-list # to get host UUID xe sr-create host-uuid= shared=false type=lvm \ content-type=user device-config:device=/dev/sdb1 name-label="Another disk" XenServer - VM Paravirtualization: How to configure a single VM to be paravirtualized: # Configure boot xe vm-param-set uuid= HVM-boot-policy='' xe vm-param-set uuid= PV-bootloader=pygrub # Configure console to work in XenCenter xe vm-param-set uuid= PV-args="console=tty0 xencons=tty" # Determine boot disk and set it bootable for XenServer xe vbd-list vm-uuid=$VMUUID type=Disk xe vbd-param-set uuid= bootable=true [XenServer - Configure LACP Bonding](): When you want to run your XenServer with interface trunking. # Determine UUIDs of interfaces to add xe pif-list # Create new network (will return network UUID) xe network-create name-label=bond0 # Create bonding (will return bonding UUID) xe bond-create network-uuid= pif-uuids=,[,...] # Set bonding flags for bond0 xe pif-param-set uuid= other-config:bond-mode=802.3ad xe pif-param-set uuid= other-config:bond-mode=lacp # Once your switch is configured check bond0 with cat /proc/net/bonding/bond0 # Also try ovs-appctl bond/show bond0 XenServer - Restore VM from Image: Use "xe vm-import" to create a new VM with a new UUID: xe vm-import filename=image.xva preserve=true