Xl (XenServer)
From Christoph's Personal Wiki
xl is a CLI tool that is based on the xenlight library (libxl), a library designed to provide a common "bottom third" for any Xen toolstack. The xl
toolstack is intended to remain backwards compatible with existing `xm`
(for XenClassic) domain configuration files.
Usage
xl [-v] <subcommand> [args]
List of commands
Below is a full list of `xl`
subcommands:
-
create
- Create a domain from config file <filename>
-
list
- List information about all/some domains
-
destroy
- Terminate a domain immediately
-
shutdown
- Issue a shutdown signal to a domain
-
reboot
- Issue a reboot signal to a domain
-
pci-attach
- Insert a new pass-through pci device
-
pci-detach
- Remove a domain's pass-through pci device
-
pci-list
- List pass-through pci devices for a domain
-
pci-list-assignable-devices
- List all the assignable pci devices
-
pause
- Pause execution of a domain
-
unpause
- Unpause a paused domain
-
console
- Attach to domain's console
-
vncviewer
- Attach to domain's VNC server.
-
save
- Save a domain state to restore later
-
migrate
- Save a domain state to restore later
-
dump-core
- Core dump a domain
-
restore
- Restore a domain from a saved state
-
migrate-receive
- Restore a domain from a saved state
-
cd-insert
- Insert a cdrom into a guest's cd drive
-
cd-eject
- Eject a cdrom from a guest's cd drive
-
mem-max
- Set the maximum amount reservation for a domain
-
mem-set
- Set the current memory usage for a domain
-
button-press
- Indicate an ACPI button press to the domain
-
vcpu-list
- List the VCPUs for all/some domains
-
vcpu-pin
- Set which CPUs a VCPU can use
-
vcpu-set
- Set the number of active VCPUs allowed for the domain
-
list-vm
- List the VMs,without DOM0
-
info
- Get information about Xen host
-
sched-credit
- Get/set credit scheduler parameters
-
domid
- Convert a domain name to domain id
-
domname
- Convert a domain id to domain name
-
rename
- Rename a domain
-
trigger
- Send a trigger to a domain
-
sysrq
- Send a sysrq to a domain
-
debug-keys
- Send debug keys to Xen
-
dmesg
- Read and/or clear dmesg buffer
-
top
- Monitor a host and the domains in real time
-
network-attach
- Create a new virtual network device
-
network-list
- List virtual network interfaces for a domain
-
network-detach
- Destroy a domain's virtual network device
-
block-attach
- Create a new virtual block device
-
block-list
- List virtual block devices for a domain
-
block-detach
- Destroy a domain's virtual block device
-
uptime
- Print uptime for all/some domains
-
tmem-list
- List tmem pools
-
tmem-freeze
- Freeze tmem pools
-
tmem-destroy
- Destroy tmem pools
-
tmem-thaw
- Thaw tmem pools
-
tmem-set
- Change tmem settings
-
tmem-shared-auth
- De/authenticate shared tmem pool
-
tmem-freeable
- Get information about how much freeable memory (MB) is in-use by tmem
-
network2-attach
- Create a new version 2 virtual network device
-
network2-list
- list version 2 virtual network interfaces for a domain
-
network2-detach
- destroy a domain's version 2 virtual network device
-
cpupool-create
- Create a CPU pool based an ConfigFile
-
cpupool-list
- List CPU pools on host
-
cpupool-destroy
- Deactivates a CPU pool
-
cpupool-rename
- Renames a CPU pool
-
cpupool-cpu-add
- Adds a CPU to a CPU pool
-
cpupool-cpu-remove
- Removes a CPU from a CPU pool
-
cpupool-migrate
- Moves a domain into a CPU pool
-
cpupool-numa-split
- Splits up the machine into one CPU pool per NUMA node
Examples
- Get a list of all domains on your host:
$ xl list Name ID Mem VCPUs State Time(s) Domain-0 0 752 2 r----- 11335.8
- Below is the output from my XenServer sandbox machine:
$ xl info host : legacy.thirdcraft.com release : 2.6.32.43-0.4.1.xs1.8.0.835.170778xen version : #1 SMP Wed May 29 18:06:30 EDT 2013 machine : i686 nr_cpus : 2 max_cpu_id : 1 nr_nodes : 1 cores_per_socket : 2 threads_per_core : 1 cpu_mhz : 2926 hw_caps : bfebfbff:20100800:00000000:00000940:0008e3bd:00000000:00000001:00000000 virt_caps : hvm total_memory : 3931 free_memory : 3065 free_cpus : 0 xen_major : 4 xen_minor : 1 xen_extra : .5 xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 xen_scheduler : credit xen_pagesize : 4096 platform_params : virt_start=0xff800000 xen_changeset : 23509:aa273b47bcbe, pq 572:5c414f7cb3b1 xen_commandline : mem=1024G dom0_max_vcpus=2 dom0_mem=752M,max:752M watchdog_timeout=300 \ lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 \ console=vga vga=mode-0x0311 cc_compiler : gcc version 4.1.2 20080704 (Red Hat 4.1.2-46) cc_compile_by : root cc_compile_domain : uk.xensource.com cc_compile_date : Fri Jun 14 09:04:06 EDT 2013 xend_config_format : 4
External links
- `xl` information — on the Xen.org wiki
- Choice of Toolstacks — on the Xen.org wiki