Here are some xm and virsh commands for creating, managing, and troubleshooting xen virtual machines.
Staring and Stopping VMs
- xm create – Create a domain based on config file
- xm destroy – Terminate a domain immediately
- xm pause – Pause execution of a domain
- xm reboot – Reboot a domain
- xm shutdown – Shutdown a domain
- xm save – Save a domain state to restore later
- xm restore – Restore a domain from a saved state
Status monitoring
- xm uptime – Displays uptime for a domain
- xm top – Monitors a host and its domains in real time
- xm list – Displays domain information
- xm info – Displays host information
- xm vcpu-list – Lists domain virtual processors
- xm network-list – List virtual network interfaces for a domain.
- virsh nodeinfo – Gives basic information about the node.
- virsh cpuinfo
Troubleshooting
- xm console – Attaches to a domain console
- xm dump-core – Dumps core of a specific domain
- xm dmesg – Reads and/or clears the xend daemon’s message buffer
- xm log – Gives Xend log
- virsh dominfo – Returns basic information about the domain
- virsh dumpxml – Gives domain informations as an XML.
Performance tuning
- xm mem-max – Sets the maximum amount of memory for a domain
- xm mem-set – Sets the current memory usage for a domain
- xm vcpu-set – Sets the number of active processors for a domain
Other commands
- xm rename – Renames a domain
- xm sysrq – Sends a system request to a domain
- xm block-list – Lists virtual block devices for a domain
