1.1 xm Commands

The xm command provides a command line interface for managing virtual machines. It can be used to create, pause, and shut down virtual machines. It can also be used to list the current domains, enable or pin virtual CPUs, and attach or detach block devices. For example, the xm list command displays the status of all virtual machines.

Figure 1-1 xm list Command

The syntax of the xm command usually follows the format:

xm  <subcommand> [domain-id] [OPTIONS]

where subcommand is the xm command to run, domain-id is the ID number assigned to a domain or the name of the virtual machine, and OPTIONS indicates subcommand-specific options.

Table 1-1 xm Subcommands

xm Subcommand

Description

help

Displays the list of xm subcommands

console

Attaches to a domain’s console (Paravirtual only).

Virtual machines do not support more than one console connection at a time.

create

Start a new domain using settings from a configuration file. (Deprecated: use xm new)

new

Add a domain to the xend database.

  • xm new -f to specify a configuration file based on Python*.

  • xm new -F to specify an .sxp configuration file

delete

Removes a domain from xend domain management.

destroy

Terminates a domain immediately.

domid

Converts a domain name to domain ID.

domname

Converts a domain ID to a domain name.

dump-core

Dumps a core for a specific domain.

list

Lists information about some or all domains.

mem-max

Sets the maximum amount of memory to reserve for a domain.

mem-set

Sets the current amount of memory usage for a domain.

migrate

Migrates a domain to another host.

pause

Pauses a domain but maintain its current state in memory.

reboot

Reboots a domain.

rename

Renames a domain.

restore

Restores a domain from a saved state.

resume

Resumes a suspended domain.

save

Saves a domain’s entire state, including disk and memory, to a file.

shutdown

Shuts down a domain.

start

Starts a xend managed domain.

suspend

Saves a domain’s current state.

sysrq

Sends a sysrq to a domain.

top

Monitors a host and domains in real time.

unpause

Unpauses a paused domain.

uptime

Prints uptime for a domain.

vcpu-list

Lists the virtual CPUs for a domain or all domains.

vcpu-pin

Specifies which CPUs a virtual CPU can use.

vcpu-set

Sets the number of active virtual CPUs allowed for the domain.

dmesg

Reads and/or clears the xend message buffer.

info

Gets information about the Xen host environment.

log

Prints xend log file.

serve

Proxies xend XMLRPC over stdio.

sched-credit

Gets or sets credit scheduler parameters.

sched-sedf

Gets or sets EDF parameters.

block-attach

Creates a new virtual block device.

block-detach

Destroys a domain’s virtual block device.

block-list

Lists virtual block devices for a domain.

block-configure

Changes block device configuration.

network-attach

Creates a new virtual network device and attach to it.

network-detach

Detaches a domain’s virtual network device.

network-list

Lists virtual network interfaces for a domain.

vtpm-list

Lists virtual TPM devices.

vnet-list

Lists vnets.

vnet-create

Creates a vnet from a configuration file.

vnet-delete

Deletes a vnet.

labels

Lists <type> labels for (active) policy.

addlabel

Adds a security label for domain or resource.

rmlabel

Removes a security label for domain or resource.

getlabel

Shows a security label for domain or resource.

dry-run

Tests if a domain can access its resources.

resources

Shows information for each labeled resource.

makepolicy

Builds a policy and creates .bin and .map files.

loadpolicy

Loads a binary policy into the hypervisor.

cfgbootpolicy

Adds a policy to the boot configuration.

dumppolicy

Prints hypervisor ACM state information.

shell

Launches an interactive shell.