.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "VIRSH 1" .TH VIRSH 1 "2018-03-12" "libvirt-3.0.0" "Virtualization Support" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" virsh \- management user interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBvirsh\fR [\fI\s-1OPTION\s0\fR]... [\fI\s-1COMMAND_STRING\s0\fR] .PP \&\fBvirsh\fR [\fI\s-1OPTION\s0\fR]... \fI\s-1COMMAND\s0\fR [\fI\s-1ARG\s0\fR]... .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \fBvirsh\fR program is the main interface for managing virsh guest domains. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains. Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the \s-1GNU\s0 Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aims at providing a long term stable C \s-1API. \s0 It currently supports Xen, \s-1QEMU, KVM, LXC,\s0 OpenVZ, VirtualBox and VMware \s-1ESX.\s0 .PP The basic structure of most virsh usage is: .PP .Vb 1 \& virsh [OPTION]... [ARG]... .Ve .PP Where \fIcommand\fR is one of the commands listed below; \fIdomain\fR is the numeric domain id, or the domain name, or the domain \s-1UUID\s0; and \fI\s-1ARGS\s0\fR are command specific options. There are a few exceptions to this rule in the cases where the command in question acts on all domains, the entire machine, or directly on the xen hypervisor. Those exceptions will be clear for each of those commands. Note: it is permissible to give numeric names to domains, however, doing so will result in a domain that can only be identified by domain id. In other words, if a numeric value is supplied it will be interpreted as a domain id, not as a name. .PP The \fBvirsh\fR program can be used either to run one \fI\s-1COMMAND\s0\fR by giving the command and its arguments on the shell command line, or a \fI\s-1COMMAND_STRING\s0\fR which is a single shell argument consisting of multiple \fI\s-1COMMAND\s0\fR actions and their arguments joined with whitespace, and separated by semicolons between commands. Within \fI\s-1COMMAND_STRING\s0\fR, virsh understands the same single, double, and backslash escapes as the shell, although you must add another layer of shell escaping in creating the single shell argument. If no command is given in the command line, \fBvirsh\fR will then start a minimal interpreter waiting for your commands, and the \fBquit\fR command will then exit the program. .PP The \fBvirsh\fR program understands the following \fI\s-1OPTIONS\s0\fR. .IP "\fB\-c\fR, \fB\-\-connect\fR \fI\s-1URI\s0\fR" 4 .IX Item "-c, --connect URI" Connect to the specified \fI\s-1URI\s0\fR, as if by the \fBconnect\fR command, instead of the default connection. .IP "\fB\-d\fR, \fB\-\-debug\fR \fI\s-1LEVEL\s0\fR" 4 .IX Item "-d, --debug LEVEL" Enable debug messages at integer \fI\s-1LEVEL\s0\fR and above. \fI\s-1LEVEL\s0\fR can range from 0 to 4 (default). See the documentation of \fB\s-1VIRSH_DEBUG\s0\fR environment variable below for the description of each \fI\s-1LEVEL\s0\fR. .IP "\fB\-e\fR, \fB\-\-escape\fR \fIstring\fR" 4 .IX Item "-e, --escape string" Set alternative escape sequence for \fIconsole\fR command. By default, telnet's \fB^]\fR is used. Allowed characters when using hat notation are: alphabetic character, @, [, ], \e, ^, _. .IP "\fB\-h\fR, \fB\-\-help\fR" 4 .IX Item "-h, --help" Ignore all other arguments, and behave as if the \fBhelp\fR command were given instead. .IP "\fB\-k\fR, \fB\-\-keepalive\-interval\fR \fI\s-1INTERVAL\s0\fR" 4 .IX Item "-k, --keepalive-interval INTERVAL" Set an \fI\s-1INTERVAL\s0\fR (in seconds) for sending keepalive messages to check whether connection to the server is still alive. Setting the interval to 0 disables client keepalive mechanism. .IP "\fB\-K\fR, \fB\-\-keepalive\-count\fR \fI\s-1COUNT\s0\fR" 4 .IX Item "-K, --keepalive-count COUNT" Set a number of times keepalive message can be sent without getting an answer from the server without marking the connection dead. There is no effect to this setting in case the \fI\s-1INTERVAL\s0\fR is set to 0. .IP "\fB\-l\fR, \fB\-\-log\fR \fI\s-1FILE\s0\fR" 4 .IX Item "-l, --log FILE" Output logging details to \fI\s-1FILE\s0\fR. .IP "\fB\-q\fR, \fB\-\-quiet\fR" 4 .IX Item "-q, --quiet" Avoid extra informational messages. .IP "\fB\-r\fR, \fB\-\-readonly\fR" 4 .IX Item "-r, --readonly" Make the initial connection read-only, as if by the \fI\-\-readonly\fR option of the \fBconnect\fR command. .IP "\fB\-t\fR, \fB\-\-timing\fR" 4 .IX Item "-t, --timing" Output elapsed time information for each command. .IP "\fB\-v\fR, \fB\-\-version[=short]\fR" 4 .IX Item "-v, --version[=short]" Ignore all other arguments, and prints the version of the libvirt library virsh is coming from .IP "\fB\-V\fR, \fB\-\-version=long\fR" 4 .IX Item "-V, --version=long" Ignore all other arguments, and prints the version of the libvirt library virsh is coming from and which options and driver are compiled in. .SH "NOTES" .IX Header "NOTES" Most \fBvirsh\fR operations rely upon the libvirt library being able to connect to an already running libvirtd service. This can usually be done using the command \fBinvoke\-rc.d libvirtd start\fR. .PP Most \fBvirsh\fR commands require root privileges to run due to the communications channels used to talk to the hypervisor. Running as non root will return an error. .PP Most \fBvirsh\fR commands act synchronously, except maybe shutdown, setvcpus and setmem. In those cases the fact that the \fBvirsh\fR program returned, may not mean the action is complete and you must poll periodically to detect that the guest completed the operation. .PP \&\fBvirsh\fR strives for backward compatibility. Although the \fBhelp\fR command only lists the preferred usage of a command, if an older version of \fBvirsh\fR supported an alternate spelling of a command or option (such as \fI\-\-tunnelled\fR instead of \fI\-\-tunneled\fR), then scripts using that older spelling will continue to work. .PP Several \fBvirsh\fR commands take an optionally scaled integer; if no scale is provided, then the default is listed in the command (for historical reasons, some commands default to bytes, while other commands default to kibibytes). The following case-insensitive suffixes can be used to select a specific scale: b, byte byte 1 \s-1KB \s0 kilobyte 1,000 k, KiB kibibyte 1,024 \s-1MB \s0 megabyte 1,000,000 M, MiB mebibyte 1,048,576 \s-1GB \s0 gigabyte 1,000,000,000 G, GiB gibibyte 1,073,741,824 \s-1TB \s0 terabyte 1,000,000,000,000 T, TiB tebibyte 1,099,511,627,776 \s-1PB \s0 petabyte 1,000,000,000,000,000 P, PiB pebibyte 1,125,899,906,842,624 \s-1EB \s0 exabyte 1,000,000,000,000,000,000 E, EiB exbibyte 1,152,921,504,606,846,976 .SH "GENERIC COMMANDS" .IX Header "GENERIC COMMANDS" The following commands are generic i.e. not specific to a domain. .IP "\fBhelp\fR [\fIcommand-or-group\fR]" 4 .IX Item "help [command-or-group]" This lists each of the virsh commands. When used without options, all commands are listed, one per line, grouped into related categories, displaying the keyword for each group. .Sp To display only commands for a specific group, give the keyword for that group as an option. For example: .Sp .Vb 1 \& virsh # help host \& \& Host and Hypervisor (help keyword \*(Aqhost\*(Aq): \& capabilities capabilities \& cpu\-models show the CPU models for an architecture \& connect (re)connect to hypervisor \& freecell NUMA free memory \& hostname print the hypervisor hostname \& qemu\-attach Attach to existing QEMU process \& qemu\-monitor\-command QEMU Monitor Command \& qemu\-agent\-command QEMU Guest Agent Command \& sysinfo print the hypervisor sysinfo \& uri print the hypervisor canonical URI .Ve .Sp To display detailed information for a specific command, give its name as the option instead. For example: .Sp .Vb 3 \& virsh # help list \& NAME \& list \- list domains \& \& SYNOPSIS \& list [\-\-inactive] [\-\-all] \& \& DESCRIPTION \& Returns list of domains. \& \& OPTIONS \& \-\-inactive list inactive domains \& \-\-all list inactive & active domains .Ve .IP "\fBquit\fR, \fBexit\fR" 4 .IX Item "quit, exit" quit this interactive terminal .IP "\fBversion\fR [\fI\-\-daemon\fR]" 4 .IX Item "version [--daemon]" Will print out the major version info about what this built from. If \fI\-\-daemon\fR is specified then the version of the libvirt daemon is included in the output. .RS 4 .Sp .RS 4 \&\fBExample\fR .Sp .Vb 5 \& $ virsh version \& Compiled against library: libvirt 1.2.3 \& Using library: libvirt 1.2.3 \& Using API: QEMU 1.2.3 \& Running hypervisor: QEMU 2.0.50 \& \& $ virsh version \-\-daemon \& Compiled against library: libvirt 1.2.3 \& Using library: libvirt 1.2.3 \& Using API: QEMU 1.2.3 \& Running hypervisor: QEMU 2.0.50 \& Running against daemon: 1.2.6 .Ve .RE .RE .RS 4 .RE .IP "\fBcd\fR [\fIdirectory\fR]" 4 .IX Item "cd [directory]" Will change current directory to \fIdirectory\fR. The default directory for the \fBcd\fR command is the home directory or, if there is no \fI\s-1HOME\s0\fR variable in the environment, the root directory. .Sp This command is only available in interactive mode. .IP "\fBpwd\fR" 4 .IX Item "pwd" Will print the current directory. .IP "\fBconnect\fR [\fI\s-1URI\s0\fR] [\fI\-\-readonly\fR]" 4 .IX Item "connect [URI] [--readonly]" (Re)\-Connect to the hypervisor. When the shell is first started, this is automatically run with the \fI\s-1URI\s0\fR parameter requested by the \f(CW\*(C`\-c\*(C'\fR option on the command line. The \fI\s-1URI\s0\fR parameter specifies how to connect to the hypervisor. The documentation page at list the values supported, but the most common are: .RS 4 .IP "xen:///" 4 .IX Item "xen:///" this is used to connect to the local Xen hypervisor .IP "qemu:///system" 4 .IX Item "qemu:///system" connect locally as root to the daemon supervising \s-1QEMU\s0 and \s-1KVM\s0 domains .IP "qemu:///session" 4 .IX Item "qemu:///session" connect locally as a normal user to his own set of \s-1QEMU\s0 and \s-1KVM\s0 domains .IP "lxc:///" 4 .IX Item "lxc:///" connect to a local linux container .RE .RS 4 .Sp To find the currently used \s-1URI,\s0 check the \fIuri\fR command documented below. .Sp For remote access see the documentation page at on how to make URIs. The \fI\-\-readonly\fR option allows for read-only connection .RE .IP "\fBuri\fR" 4 .IX Item "uri" Prints the hypervisor canonical \s-1URI,\s0 can be useful in shell mode. .IP "\fBhostname\fR" 4 .IX Item "hostname" Print the hypervisor hostname. .IP "\fBsysinfo\fR" 4 .IX Item "sysinfo" Print the \s-1XML\s0 representation of the hypervisor sysinfo, if available. .IP "\fBnodeinfo\fR" 4 .IX Item "nodeinfo" Returns basic information about the node, like number and type of \s-1CPU,\s0 and size of the physical memory. The output corresponds to virNodeInfo structure. Specifically, the \*(L"\s-1CPU\s0 socket(s)\*(R" field means number of \s-1CPU\s0 sockets per \s-1NUMA\s0 cell. The information libvirt displays is dependent upon what each architecture may provide. .IP "\fBnodecpumap\fR [\fI\-\-pretty\fR]" 4 .IX Item "nodecpumap [--pretty]" Displays the node's total number of CPUs, the number of online CPUs and the list of online CPUs. .Sp With \fI\-\-pretty\fR the online CPUs are printed as a range instead of a list. .IP "\fBnodecpustats\fR [\fIcpu\fR] [\fI\-\-percent\fR]" 4 .IX Item "nodecpustats [cpu] [--percent]" Returns cpu stats of the node. If \fIcpu\fR is specified, this will prints specified cpu statistics only. If \fI\-\-percent\fR is specified, this will prints percentage of each kind of cpu statistics during 1 second. .IP "\fBnodememstats\fR [\fIcell\fR]" 4 .IX Item "nodememstats [cell]" Returns memory stats of the node. If \fIcell\fR is specified, this will prints specified cell statistics only. .IP "\fBnodesuspend\fR [\fItarget\fR] [\fIduration\fR]" 4 .IX Item "nodesuspend [target] [duration]" Puts the node (host machine) into a system-wide sleep state and schedule the node's Real-Time-Clock interrupt to resume the node after the time duration specified by \fIduration\fR is out. \&\fItarget\fR specifies the state to which the host will be suspended to, it can be \*(L"mem\*(R" (suspend to \s-1RAM\s0), \*(L"disk\*(R" (suspend to disk), or \*(L"hybrid\*(R" (suspend to both \s-1RAM\s0 and disk). \fIduration\fR specifies the time duration in seconds for which the host has to be suspended, it should be at least 60 seconds. .IP "\fBnode-memory-tune\fR [\fIshm-pages-to-scan\fR] [\fIshm-sleep-millisecs\fR] [\fIshm-merge-across-nodes\fR]" 4 .IX Item "node-memory-tune [shm-pages-to-scan] [shm-sleep-millisecs] [shm-merge-across-nodes]" Allows you to display or set the node memory parameters. \&\fIshm-pages-to-scan\fR can be used to set the number of pages to scan before the shared memory service goes to sleep; \fIshm-sleep-millisecs\fR can be used to set the number of millisecs the shared memory service should sleep before next scan; \fIshm-merge-across-nodes\fR specifies if pages from different numa nodes can be merged. When set to 0, only pages which physically reside in the memory area of same \s-1NUMA\s0 node can be merged. When set to 1, pages from all nodes can be merged. Default to 1. .Sp \&\fBNote\fR: Currently the \*(L"shared memory service\*(R" only means \s-1KSM \s0(Kernel Samepage Merging). .IP "\fBcapabilities\fR" 4 .IX Item "capabilities" Print an \s-1XML\s0 document describing the capabilities of the hypervisor we are currently connected to. This includes a section on the host capabilities in terms of \s-1CPU\s0 and features, and a set of description for each kind of guest which can be virtualized. For a more complete description see: The \s-1XML\s0 also show the \s-1NUMA\s0 topology information if available. .IP "\fBdomcapabilities\fR [\fIvirttype\fR] [\fIemulatorbin\fR] [\fIarch\fR] [\fImachine\fR]" 4 .IX Item "domcapabilities [virttype] [emulatorbin] [arch] [machine]" Print an \s-1XML\s0 document describing the domain capabilities for the hypervisor we are connected to using information either sourced from an existing domain or taken from the \fBvirsh capabilities\fR output. This may be useful if you intend to create a new domain and are curious if for instance it could make use of \s-1VFIO\s0 by creating a domain for the hypervisor with a specific emulator and architecture. .Sp Each hypervisor will have different requirements regarding which options are required and which are optional. A hypervisor can support providing a default value for any of the options. .Sp The \fIvirttype\fR option specifies the virtualization type used. The value to be used is either from the 'type' attribute of the top level element from the domain \s-1XML\s0 or the 'type' attribute found within each element from the \fBvirsh capabilities\fR output. The \&\fIemulatorbin\fR option specifies the path to the emulator. The value to be used is either the element in the domain \s-1XML\s0 or the \&\fBvirsh capabilities\fR output. The \fIarch\fR option specifies the architecture to be used for the domain. The value to be used is either the \*(L"arch\*(R" attribute from the domain's \s-1XML\s0 element and subelement or the \*(L"name\*(R" attribute of an element from the \&\fBvirsh capabililites\fR output. The \fImachine\fR specifies the machine type for the emulator. The value to be used is either the \*(L"machine\*(R" attribute from the domain's \s-1XML\s0 element and subelement or one from a list of machines from the \fBvirsh capabilities\fR output for a specific architecture and domain type. .Sp For the qemu hypervisor, a \fIvirttype\fR of either 'qemu' or 'kvm' must be supplied along with either the \fIemulatorbin\fR or \fIarch\fR in order to generate output for the default \fImachine\fR. Supplying a \fImachine\fR value will generate output for the specific machine. .IP "\fBinject-nmi\fR \fIdomain\fR" 4 .IX Item "inject-nmi domain" Inject \s-1NMI\s0 to the guest. .IP "\fBlist\fR [\fI\-\-inactive\fR | \fI\-\-all\fR] [\fI\-\-managed\-save\fR] [\fI\-\-title\fR] { [\fI\-\-table\fR] | \fI\-\-name\fR | \fI\-\-uuid\fR } [\fI\-\-persistent\fR] [\fI\-\-transient\fR] [\fI\-\-with\-managed\-save\fR] [\fI\-\-without\-managed\-save\fR] [\fI\-\-autostart\fR] [\fI\-\-no\-autostart\fR] [\fI\-\-with\-snapshot\fR] [\fI\-\-without\-snapshot\fR] [\fI\-\-state\-running\fR] [\fI\-\-state\-paused\fR] [\fI\-\-state\-shutoff\fR] [\fI\-\-state\-other\fR]" 4 .IX Item "list [--inactive | --all] [--managed-save] [--title] { [--table] | --name | --uuid } [--persistent] [--transient] [--with-managed-save] [--without-managed-save] [--autostart] [--no-autostart] [--with-snapshot] [--without-snapshot] [--state-running] [--state-paused] [--state-shutoff] [--state-other]" Prints information about existing domains. If no options are specified it prints out information about running domains. .Sp An example format for the list is as follows: .Sp \&\fBvirsh\fR list Id Name State \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 Domain\-0 running 2 fedora paused .Sp Name is the name of the domain. \s-1ID\s0 the domain numeric id. State is the run state (see below). .Sp \&\fB\s-1STATES\s0\fR .Sp The State field lists 8 states for a domain, and which ones the current domain is in. .RS 4 .IP "\fBrunning\fR" 4 .IX Item "running" The domain is currently running on a \s-1CPU\s0 .IP "\fBidle\fR" 4 .IX Item "idle" The domain is idle, and not running or runnable. This can be caused because the domain is waiting on \s-1IO \s0(a traditional wait state) or has gone to sleep because there was nothing else for it to do. .IP "\fBpaused\fR" 4 .IX Item "paused" The domain has been paused, usually occurring through the administrator running \fBvirsh suspend\fR. When in a paused state the domain will still consume allocated resources like memory, but will not be eligible for scheduling by the hypervisor. .IP "\fBin shutdown\fR" 4 .IX Item "in shutdown" The domain is in the process of shutting down, i.e. the guest operating system has been notified and should be in the process of stopping its operations gracefully. .IP "\fBshut off\fR" 4 .IX Item "shut off" The domain is not running. Usually this indicates the domain has been shut down completely, or has not been started. .IP "\fBcrashed\fR" 4 .IX Item "crashed" The domain has crashed, which is always a violent ending. Usually this state can only occur if the domain has been configured not to restart on crash. .IP "\fBpmsuspended\fR" 4 .IX Item "pmsuspended" The domain has been suspended by guest power management, e.g. entered into s3 state. .RE .RS 4 .Sp Normally only active domains are listed. To list inactive domains specify \&\fI\-\-inactive\fR or \fI\-\-all\fR to list both active and inactive domains. .Sp To further filter the list of domains you may specify one or more of filtering flags supported by the \fBlist\fR command. These flags are grouped by function. Specifying one or more flags from a group enables the filter group. Note that some combinations of flags may yield no results. Supported filtering flags and groups: .IP "\fBPersistence\fR" 4 .IX Item "Persistence" Flag \fI\-\-persistent\fR is used to include persistent domains in the returned list. To include transient domains specify \fI\-\-transient\fR. .IP "\fBExistence of managed save image\fR" 4 .IX Item "Existence of managed save image" To list domains having a managed save image specify flag \&\fI\-\-with\-managed\-save\fR. For domains that don't have a managed save image specify \fI\-\-without\-managed\-save\fR. .IP "\fBDomain state\fR" 4 .IX Item "Domain state" The following filter flags select a domain by its state: \&\fI\-\-state\-running\fR for running domains, \fI\-\-state\-paused\fR for paused domains, \&\fI\-\-state\-shutoff\fR for turned off domains and \fI\-\-state\-other\fR for all other states as a fallback. .IP "\fBAutostarting domains\fR" 4 .IX Item "Autostarting domains" To list autostarting domains use the flag \fI\-\-autostart\fR. To list domains with this feature disabled use \fI\-\-no\-autostart\fR. .IP "\fBSnapshot existence\fR" 4 .IX Item "Snapshot existence" Domains that have snapshot images can be listed using flag \fI\-\-with\-snapshot\fR, domains without a snapshot \fI\-\-without\-snapshot\fR. .RE .RS 4 .Sp When talking to older servers, this command is forced to use a series of \s-1API\s0 calls with an inherent race, where a domain might not be listed or might appear more than once if it changed state between calls while the list was being collected. Newer servers do not have this problem. .Sp If \fI\-\-managed\-save\fR is specified, then domains that have managed save state (only possible if they are in the \fBshut off\fR state, so you need to specify \&\fI\-\-inactive\fR or \fI\-\-all\fR to actually list them) will instead show as \fBsaved\fR in the listing. This flag is usable only with the default \fI\-\-table\fR output. Note that this flag does not filter the list of domains. .Sp If \fI\-\-name\fR is specified, domain names are printed instead of the table formatted one per line. If \fI\-\-uuid\fR is specified domain's \s-1UUID\s0's are printed instead of names. Flag \fI\-\-table\fR specifies that the legacy table-formatted output should be used. This is the default. .Sp If both \fI\-\-name\fR and \fI\-\-uuid\fR are specified, domain \s-1UUID\s0's and names are printed side by side without any header. Flag \fI\-\-table\fR specifies that the legacy table-formatted output should be used. This is the default if neither \fI\-\-name\fR nor \fI\-\-uuid\fR are specified. Option \&\fI\-\-table\fR is mutually exclusive with options \fI\-\-uuid\fR and \fI\-\-name\fR. .Sp If \fI\-\-title\fR is specified, then the short domain description (title) is printed in an extra column. This flag is usable only with the default \&\fI\-\-table\fR output. .Sp Example: .Sp \&\fBvirsh\fR list \-\-title Id Name State Title \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 Domain\-0 running Mailserver 1 2 fedora paused .RE .IP "\fBfreecell\fR [{ [\fI\-\-cellno\fR] \fBcellno\fR | \fI\-\-all\fR }]" 4 .IX Item "freecell [{ [--cellno] cellno | --all }]" Prints the available amount of memory on the machine or within a \s-1NUMA\s0 cell. The freecell command can provide one of three different displays of available memory on the machine depending on the options specified. With no options, it displays the total free memory on the machine. With the \-\-all option, it displays the free memory in each cell and the total free memory on the machine. Finally, with a numeric argument or with \-\-cellno plus a cell number it will display the free memory for the specified cell only. .IP "\fBfreepages\fR [{ [\fI\-\-cellno\fR] \fIcellno\fR [\fI\-\-pagesize\fR] \fIpagesize\fR | \fI\-\-all\fR }]" 4 .IX Item "freepages [{ [--cellno] cellno [--pagesize] pagesize | --all }]" Prints the available amount of pages within a \s-1NUMA\s0 cell. \fIcellno\fR refers to the \s-1NUMA\s0 cell you're interested in. \fIpagesize\fR is a scaled integer (see \&\fB\s-1NOTES\s0\fR above). Alternatively, if \fI\-\-all\fR is used, info on each possible combination of \s-1NUMA\s0 cell and page size is printed out. .IP "\fBallocpages\fR [\fI\-\-pagesize\fR] \fIpagesize\fR [\fI\-\-pagecount\fR] \fIpagecount\fR [[\fI\-\-cellno\fR] \fIcellno\fR] [\fI\-\-add\fR] [\fI\-\-all\fR]" 4 .IX Item "allocpages [--pagesize] pagesize [--pagecount] pagecount [[--cellno] cellno] [--add] [--all]" Change the size of pages pool of \fIpagesize\fR on the host. If \&\fI\-\-add\fR is specified, then \fIpagecount\fR pages are added into the pool. However, if \fI\-\-add\fR wasn't specified, then the \&\fIpagecount\fR is taken as the new absolute size of the pool (this may be used to free some pages and size the pool down). The \&\fIcellno\fR modifier can be used to narrow the modification down to a single host \s-1NUMA\s0 cell. On the other end of spectrum lies \&\fI\-\-all\fR which executes the modification on all \s-1NUMA\s0 cells. .IP "\fBcpu-baseline\fR \fI\s-1FILE\s0\fR [\fI\-\-features\fR] [\fI\-\-migratable\fR]" 4 .IX Item "cpu-baseline FILE [--features] [--migratable]" Compute baseline \s-1CPU\s0 which will be supported by all host CPUs given in . The list of host CPUs is built by extracting all elements from the . Thus, the can contain either a set of elements separated by new lines or even a set of complete elements printed by \&\fBcapabilities\fR command. If \fI\-\-features\fR is specified then the resulting \s-1XML\s0 description will explicitly include all features that make up the \s-1CPU,\s0 without this option features that are part of the \s-1CPU\s0 model will not be listed in the \s-1XML\s0 description. If \fI\-\-migratable\fR is specified, features that block migration will not be included in the resulting \s-1CPU.\s0 .IP "\fBcpu-compare\fR \fI\s-1FILE\s0\fR [\fI\-\-error\fR]" 4 .IX Item "cpu-compare FILE [--error]" Compare \s-1CPU\s0 definition from \s-1XML\s0 with host \s-1CPU.\s0 The \s-1XML\s0 may contain either host or guest \s-1CPU\s0 definition. The host \s-1CPU\s0 definition is the element and its contents as printed by \fBcapabilities\fR command. The guest \s-1CPU\s0 definition is the element and its contents from domain \s-1XML\s0 definition. For more information on guest \s-1CPU\s0 definition see: . If \fI\-\-error\fR is specified, the command will return an error when the given \s-1CPU\s0 is incompatible with host \s-1CPU\s0 and a message providing more details about the incompatibility will be printed out. .IP "\fBcpu-models\fR \fIarch\fR" 4 .IX Item "cpu-models arch" Print the list of \s-1CPU\s0 models known for the specified architecture. .IP "\fBecho\fR [\fI\-\-shell\fR] [\fI\-\-xml\fR] [\fIarg\fR...]" 4 .IX Item "echo [--shell] [--xml] [arg...]" Echo back each \fIarg\fR, separated by space. If \fI\-\-shell\fR is specified, then the output will be single-quoted where needed, so that it is suitable for reuse in a shell context. If \fI\-\-xml\fR is specified, then the output will be escaped for use in \s-1XML.\s0 .SH "DOMAIN COMMANDS" .IX Header "DOMAIN COMMANDS" The following commands manipulate domains directly, as stated previously most commands take domain as the first parameter. The \&\fIdomain\fR can be specified as a short integer, a name or a full \s-1UUID.\s0 .IP "\fBautostart\fR [\fI\-\-disable\fR] \fIdomain\fR" 4 .IX Item "autostart [--disable] domain" Configure a domain to be automatically started at boot. .Sp The option \fI\-\-disable\fR disables autostarting. .IP "\fBconsole\fR \fIdomain\fR [\fIdevname\fR] [\fI\-\-safe\fR] [\fI\-\-force\fR]" 4 .IX Item "console domain [devname] [--safe] [--force]" Connect the virtual serial console for the guest. The optional \&\fIdevname\fR parameter refers to the device alias of an alternate console, serial or parallel device configured for the guest. If omitted, the primary console will be opened. .Sp If the flag \fI\-\-safe\fR is specified, the connection is only attempted if the driver supports safe console handling. This flag specifies that the server has to ensure exclusive access to console devices. Optionally the \fI\-\-force\fR flag may be specified, requesting to disconnect any existing sessions, such as in a case of a broken connection. .IP "\fBcreate\fR \fI\s-1FILE\s0\fR [\fI\-\-console\fR] [\fI\-\-paused\fR] [\fI\-\-autodestroy\fR] [\fI\-\-pass\-fds N,M,...\fR]" 4 .IX Item "create FILE [--console] [--paused] [--autodestroy] [--pass-fds N,M,...]" Create a domain from an \s-1XML\s0 . An easy way to create the \s-1XML\s0 is to use the \fBdumpxml\fR command to obtain the definition of a pre-existing guest. The domain will be paused if the \fI\-\-paused\fR option is used and supported by the driver; otherwise it will be running. If \fI\-\-console\fR is requested, attach to the console after creation. If \fI\-\-autodestroy\fR is requested, then the guest will be automatically destroyed when virsh closes its connection to libvirt, or otherwise exits. .Sp If \fI\-\-pass\-fds\fR is specified, the argument is a comma separated list of open file descriptors which should be pass on into the guest. The file descriptors will be re-numbered in the guest, starting from 3. This is only supported with container based virtualization. .Sp \&\fBExample\fR .Sp .Vb 3 \& virsh dumpxml > domain.xml \& vi domain.xml (or make changes with your other text editor) \& virsh create domain.xml .Ve .IP "\fBdefine\fR \fI\s-1FILE\s0\fR" 4 .IX Item "define FILE" Define a domain from an \s-1XML\s0 . The domain definition is registered but not started. If domain is already running, the changes will take effect on the next boot. .IP "\fBdesc\fR \fIdomain\fR [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] [\fI\-\-title\fR] [\fI\-\-edit\fR] [\fI\-\-new\-desc\fR New description or title message]" 4 .IX Item "desc domain [[--live] [--config] | [--current]] [--title] [--edit] [--new-desc New description or title message]" Show or modify description and title of a domain. These values are user fields that allow to store arbitrary textual data to allow easy identification of domains. Title should be short, although it's not enforced. (See also \fBmetadata\fR that works with \s-1XML\s0 based domain metadata.) .Sp Flags \fI\-\-live\fR or \fI\-\-config\fR select whether this command works on live or persistent definitions of the domain. If both \fI\-\-live\fR and \fI\-\-config\fR are specified, the \fI\-\-config\fR option takes precedence on getting the current description and both live configuration and config are updated while setting the description. \fI\-\-current\fR is exclusive and implied if none of these was specified. .Sp Flag \fI\-\-edit\fR specifies that an editor with the contents of current description or title should be opened and the contents saved back afterwards. .Sp Flag \fI\-\-title\fR selects operation on the title field instead of description. .Sp If neither of \fI\-\-edit\fR and \fI\-\-new\-desc\fR are specified the note or description is displayed instead of being modified. .IP "\fBdestroy\fR \fIdomain\fR [\fI\-\-graceful\fR]" 4 .IX Item "destroy domain [--graceful]" Immediately terminate the domain \fIdomain\fR. This doesn't give the domain \&\s-1OS\s0 any chance to react, and it's the equivalent of ripping the power cord out on a physical machine. In most cases you will want to use the \fBshutdown\fR command instead. However, this does not delete any storage volumes used by the guest, and if the domain is persistent, it can be restarted later. .Sp If \fIdomain\fR is transient, then the metadata of any snapshots will be lost once the guest stops running, but the snapshot contents still exist, and a new domain with the same name and \s-1UUID\s0 can restore the snapshot metadata with \fBsnapshot-create\fR. .Sp If \fI\-\-graceful\fR is specified, don't resort to extreme measures (e.g. \s-1SIGKILL\s0) when the guest doesn't stop after a reasonable timeout; return an error instead. .IP "\fBdomblkstat\fR \fIdomain\fR [\fIblock-device\fR] [\fI\-\-human\fR]" 4 .IX Item "domblkstat domain [block-device] [--human]" Get device block stats for a running domain. A \fIblock-device\fR corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fR (see also \fBdomblklist\fR for listing these names). On a lxc or qemu domain, omitting the \fIblock-device\fR yields device block stats summarily for the entire domain. .Sp Use \fI\-\-human\fR for a more human readable output. .Sp Availability of these fields depends on hypervisor. Unsupported fields are missing from the output. Other fields may appear if communicating with a newer version of libvirtd. .Sp \&\fBExplanation of fields\fR (fields appear in the following order): rd_req \- count of read operations rd_bytes \- count of read bytes wr_req \- count of write operations wr_bytes \- count of written bytes errs \- error count flush_operations \- count of flush operations rd_total_times \- total time read operations took (ns) wr_total_times \- total time write operations took (ns) flush_total_times \- total time flush operations took (ns) <\-\- other fields provided by hypervisor \-\-> .IP "\fBdomifaddr\fR \fIdomain\fR [\fIinterface\fR] [\fI\-\-full\fR] [\fI\-\-source lease|agent\fR]" 4 .IX Item "domifaddr domain [interface] [--full] [--source lease|agent]" Get a list of interfaces of a running domain along with their \s-1IP\s0 and \s-1MAC\s0 addresses, or limited output just for one interface if \fIinterface\fR is specified. Note that \fIinterface\fR can be driver dependent, it can be the name within guest \s-1OS\s0 or the name you would see in domain \s-1XML.\s0 Moreover, the whole command may require a guest agent to be configured for the queried domain under some drivers, notably qemu. If \fI\-\-full\fR is specified, the interface name is always displayed when the interface has multiple addresses or alias, otherwise it only displays the interface name for the first address, and \*(L"\-\*(R" for the others. The \fI\-\-source\fR argument specifies what data source to use for the addresses, currently one of 'lease' to read \s-1DHCP\s0 leases, or 'agent' to query the guest \s-1OS\s0 via an agent. If unspecified, 'lease' is the default. .IP "\fBdomifstat\fR \fIdomain\fR \fIinterface-device\fR" 4 .IX Item "domifstat domain interface-device" Get network interface stats for a running domain. .IP "\fBdomif-setlink\fR \fIdomain\fR \fIinterface-device\fR \fIstate\fR [\fI\-\-config\fR]" 4 .IX Item "domif-setlink domain interface-device state [--config]" Modify link state of the domain's virtual interface. Possible values for state are \*(L"up\*(R" and \*(L"down\*(R". If \fI\-\-config\fR is specified, only the persistent configuration of the domain is modified, for compatibility purposes, \&\fI\-\-persistent\fR is alias of \fI\-\-config\fR. \&\fIinterface-device\fR can be the interface's target name or the \s-1MAC\s0 address. .IP "\fBdomif-getlink\fR \fIdomain\fR \fIinterface-device\fR [\fI\-\-config\fR]" 4 .IX Item "domif-getlink domain interface-device [--config]" Query link state of the domain's virtual interface. If \fI\-\-config\fR is specified, query the persistent configuration, for compatibility purposes, \fI\-\-persistent\fR is alias of \fI\-\-config\fR. .Sp \&\fIinterface-device\fR can be the interface's target name or the \s-1MAC\s0 address. .IP "\fBdomiftune\fR \fIdomain\fR \fIinterface-device\fR [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]] [\fI\-\-inbound average,peak,burst,floor\fR] [\fI\-\-outbound average,peak,burst\fR]" 4 .IX Item "domiftune domain interface-device [[--config] [--live] | [--current]] [--inbound average,peak,burst,floor] [--outbound average,peak,burst]" Set or query the domain's network interface's bandwidth parameters. \&\fIinterface-device\fR can be the interface's target name (), or the \s-1MAC\s0 address. .Sp If no \fI\-\-inbound\fR or \fI\-\-outbound\fR is specified, this command will query and show the bandwidth settings. Otherwise, it will set the inbound or outbound bandwidth. \fIaverage,peak,burst,floor\fR is the same as in command \fIattach-interface\fR. Values for \fIaverage\fR, \fIpeak\fR and \fIfloor\fR are expressed in kilobytes per second, while \fIburst\fR is expressed in kilobytes in a single burst at \fIpeak\fR speed as described in the Network \s-1XML\s0 documentation at . .Sp To clear inbound or outbound settings, use \fI\-\-inbound\fR or \fI\-\-outbound\fR respectfully with average value of zero. .Sp If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .IP "\fBdommemstat\fR \fIdomain\fR [\fI\-\-period\fR \fBseconds\fR] [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "dommemstat domain [--period seconds] [[--config] [--live] | [--current]]" Get memory stats for a running domain. .Sp Availability of these fields depends on hypervisor. Unsupported fields are missing from the output. Other fields may appear if communicating with a newer version of libvirtd. .Sp \&\fBExplanation of fields\fR: swap_in \- The amount of data read from swap space (in kB) swap_out \- The amount of memory written out to swap space (in kB) major_fault \- The number of page faults where disk \s-1IO\s0 was required minor_fault \- The number of other page faults unused \- The amount of memory left unused by the system (in kB) available \- The amount of usable memory as seen by the domain (in kB) actual \- Current balloon value (in \s-1KB\s0) rss \- Resident Set Size of the running domain's process (in kB) usable \- The amount of memory which can be reclaimed by balloon without causing host swapping (in \s-1KB\s0) last-update \- Timestamp of the last update of statistics (in seconds) .Sp For \s-1QEMU/KVM\s0 with a memory balloon, setting the optional \fI\-\-period\fR to a value larger than 0 in seconds will allow the balloon driver to return additional statistics which will be displayed by subsequent \fBdommemstat\fR commands. Setting the \fI\-\-period\fR to 0 will stop the balloon driver collection, but does not clear the statistics in the balloon driver. Requires at least \&\s-1QEMU/KVM 1.5\s0 to be running on the host. .Sp The \fI\-\-live\fR, \fI\-\-config\fR, and \fI\-\-current\fR flags are only valid when using the \fI\-\-period\fR option in order to set the collection period for the balloon driver. If \fI\-\-live\fR is specified, only the running guest collection period is affected. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. .Sp Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on the guest state. .IP "\fBdomblkerror\fR \fIdomain\fR" 4 .IX Item "domblkerror domain" Show errors on block devices. This command usually comes handy when \&\fBdomstate\fR command says that a domain was paused due to I/O error. The \fBdomblkerror\fR command lists all block devices in error state and the error seen on each of them. .IP "\fBdomblkinfo\fR \fIdomain\fR \fIblock-device\fR" 4 .IX Item "domblkinfo domain block-device" Get block device size info for a domain. A \fIblock-device\fR corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fR (see also \fBdomblklist\fR for listing these names). .IP "\fBdomblklist\fR \fIdomain\fR [\fI\-\-inactive\fR] [\fI\-\-details\fR]" 4 .IX Item "domblklist domain [--inactive] [--details]" Print a table showing the brief information of all block devices associated with \fIdomain\fR. If \fI\-\-inactive\fR is specified, query the block devices that will be used on the next boot, rather than those currently in use by a running domain. If \fI\-\-details\fR is specified, disk type and device value will also be printed. Other contexts that require a block device name (such as \fIdomblkinfo\fR or \&\fIsnapshot-create\fR for disk snapshots) will accept either target or unique source names printed by this command. .IP "\fBdomstats\fR [\fI\-\-raw\fR] [\fI\-\-enforce\fR] [\fI\-\-backing\fR] [\fI\-\-state\fR] [\fI\-\-cpu\-total\fR] [\fI\-\-balloon\fR] [\fI\-\-vcpu\fR] [\fI\-\-interface\fR] [\fI\-\-block\fR] [\fI\-\-perf\fR] [[\fI\-\-list\-active\fR] [\fI\-\-list\-inactive\fR] [\fI\-\-list\-persistent\fR] [\fI\-\-list\-transient\fR] [\fI\-\-list\-running\fR] [\fI\-\-list\-paused\fR] [\fI\-\-list\-shutoff\fR] [\fI\-\-list\-other\fR]] | [\fIdomain\fR ...]" 4 .IX Item "domstats [--raw] [--enforce] [--backing] [--state] [--cpu-total] [--balloon] [--vcpu] [--interface] [--block] [--perf] [[--list-active] [--list-inactive] [--list-persistent] [--list-transient] [--list-running] [--list-paused] [--list-shutoff] [--list-other]] | [domain ...]" Get statistics for multiple or all domains. Without any argument this command prints all available statistics for all domains. .Sp The list of domains to gather stats for can be either limited by listing the domains as a space separated list, or by specifying one of the filtering flags \fI\-\-list\-*\fR. (The approaches can't be combined.) .Sp By default some of the returned fields may be converted to more human friendly values by a set of pretty-printers. To suppress this behavior use the \fI\-\-raw\fR flag. .Sp The individual statistics groups are selectable via specific flags. By default all supported statistics groups are returned. Supported statistics groups flags are: \fI\-\-state\fR, \fI\-\-cpu\-total\fR, \fI\-\-balloon\fR, \&\fI\-\-vcpu\fR, \fI\-\-interface\fR, \fI\-\-block\fR, \fI\-\-perf\fR. .Sp Note that \- depending on the hypervisor type and version or the domain state \&\- not all of the following statistics may be returned. .Sp When selecting the \fI\-\-state\fR group the following fields are returned: \&\*(L"state.state\*(R" \- state of the \s-1VM,\s0 returned as number from virDomainState enum, \&\*(L"state.reason\*(R" \- reason for entering given state, returned as int from virDomain*Reason enum corresponding to given state. .Sp \&\fI\-\-cpu\-total\fR returns: \&\*(L"cpu.time\*(R" \- total cpu time spent for this domain in nanoseconds, \&\*(L"cpu.user\*(R" \- user cpu time spent in nanoseconds, \&\*(L"cpu.system\*(R" \- system cpu time spent in nanoseconds .Sp \&\fI\-\-balloon\fR returns: \&\*(L"balloon.current\*(R" \- the memory in kiB currently used, \&\*(L"balloon.maximum\*(R" \- the maximum memory in kiB allowed, \&\*(L"balloon.swap_in\*(R" \- the amount of data read from swap space (in kB), \&\*(L"balloon.swap_out\*(R" \- the amount of memory written out to swap space (in kB), \&\*(L"balloon.major_fault\*(R" \- the number of page faults then disk \s-1IO\s0 was required, \&\*(L"balloon.minor_fault\*(R" \- the number of other page faults, \&\*(L"balloon.unused\*(R" \- the amount of memory left unused by the system (in kB), \&\*(L"balloon.available\*(R" \- the amount of usable memory as seen by the domain (in kB), \&\*(L"balloon.rss\*(R" \- Resident Set Size of running domain's process (in kB), \&\*(L"balloon.usable\*(R" \- the amount of memory which can be reclaimed by balloon without causing host swapping (in \s-1KB\s0), \&\*(L"balloon.last\-update\*(R" \- timestamp of the last update of statistics (in seconds) .Sp \&\fI\-\-vcpu\fR returns: \&\*(L"vcpu.current\*(R" \- current number of online virtual CPUs, \&\*(L"vcpu.maximum\*(R" \- maximum number of online virtual CPUs, \&\*(L"vcpu..state\*(R" \- state of the virtual \s-1CPU\s0 , as number from virVcpuState enum, \&\*(L"vcpu..time\*(R" \- virtual cpu time spent by virtual \s-1CPU\s0 (in microseconds), \&\*(L"vcpu..wait\*(R" \- virtual cpu time spent by virtual \s-1CPU\s0 waiting on I/O (in microseconds), \&\*(L"vcpu..halted\*(R" \- virtual \s-1CPU\s0 is halted: yes or no (may indicate the processor is idle or even disabled, depending on the architecture) .Sp \&\fI\-\-interface\fR returns: \&\*(L"net.count\*(R" \- number of network interfaces on this domain, \&\*(L"net..name\*(R" \- name of the interface , \&\*(L"net..rx.bytes\*(R" \- number of bytes received, \&\*(L"net..rx.pkts\*(R" \- number of packets received, \&\*(L"net..rx.errs\*(R" \- number of receive errors, \&\*(L"net..rx.drop\*(R" \- number of receive packets dropped, \&\*(L"net..tx.bytes\*(R" \- number of bytes transmitted, \&\*(L"net..tx.pkts\*(R" \- number of packets transmitted, \&\*(L"net..tx.errs\*(R" \- number of transmission errors, \&\*(L"net..tx.drop\*(R" \- number of transmit packets dropped .Sp \&\fI\-\-perf\fR returns the statistics of all enabled perf events: \&\*(L"perf.cmt\*(R" \- the cache usage in Byte currently used, \&\*(L"perf.mbmt\*(R" \- total system bandwidth from one level of cache, \&\*(L"perf.mbml\*(R" \- bandwidth of memory traffic for a memory controller, \&\*(L"perf.cpu_cycles\*(R" \- the count of cpu cycles (total/elapsed), \&\*(L"perf.instructions\*(R" \- the count of instructions, \&\*(L"perf.cache_references\*(R" \- the count of cache hits, \&\*(L"perf.cache_misses\*(R" \- the count of caches misses, \&\*(L"perf.branch_instructions\*(R" \- the count of branch instructions, \&\*(L"perf.branch_misses\*(R" \- the count of branch misses, \&\*(L"perf.bus_cycles\*(R" \- the count of bus cycles, \&\*(L"perf.stalled_cycles_frontend\*(R" \- the count of stalled frontend cpu cycles, \&\*(L"perf.stalled_cycles_backend\*(R" \- the count of stalled backend cpu cycles, \&\*(L"perf.ref_cpu_cycles\*(R" \- the count of ref cpu cycles .Sp See the \fBperf\fR command for more details about each event. .Sp \&\fI\-\-block\fR returns information about disks associated with each domain. Using the \fI\-\-backing\fR flag extends this information to cover all resources in the backing chain, rather than the default of limiting information to the active layer for each guest disk. Information listed includes: \&\*(L"block.count\*(R" \- number of block devices being listed, \&\*(L"block..name\*(R" \- name of the target of the block device (the same name for multiple entries if \fI\-\-backing\fR is present), \&\*(L"block..backingIndex\*(R" \- when \fI\-\-backing\fR is present, matches up with the index listed in domain \s-1XML\s0 for backing files, \&\*(L"block..path\*(R" \- file source of block device , if it is a local file or block device, \&\*(L"block..rd.reqs\*(R" \- number of read requests, \&\*(L"block..rd.bytes\*(R" \- number of read bytes, \&\*(L"block..rd.times\*(R" \- total time (ns) spent on reads, \&\*(L"block..wr.reqs\*(R" \- number of write requests, \&\*(L"block..wr.bytes\*(R" \- number of written bytes, \&\*(L"block..wr.times\*(R" \- total time (ns) spent on writes, \&\*(L"block..fl.reqs\*(R" \- total flush requests, \&\*(L"block..fl.times\*(R" \- total time (ns) spent on cache flushing, \&\*(L"block..errors\*(R" \- Xen only: the 'oo_req' value, \&\*(L"block..allocation\*(R" \- offset of highest written sector in bytes, \&\*(L"block..capacity\*(R" \- logical size of source file in bytes, \&\*(L"block..physical\*(R" \- physical size of source file in bytes .Sp Selecting a specific statistics groups doesn't guarantee that the daemon supports the selected group of stats. Flag \fI\-\-enforce\fR forces the command to fail if the daemon doesn't support the selected group. .IP "\fBdomiflist\fR \fIdomain\fR [\fI\-\-inactive\fR]" 4 .IX Item "domiflist domain [--inactive]" Print a table showing the brief information of all virtual interfaces associated with \fIdomain\fR. If \fI\-\-inactive\fR is specified, query the virtual interfaces that will be used on the next boot, rather than those currently in use by a running domain. Other contexts that require a \s-1MAC\s0 address of virtual interface (such as \fIdetach-interface\fR or \&\fIdomif-setlink\fR) will accept the \s-1MAC\s0 address printed by this command. .IP "\fBblockcommit\fR \fIdomain\fR \fIpath\fR [\fIbandwidth\fR] [\fI\-\-bytes\fR] [\fIbase\fR] [\fI\-\-shallow\fR] [\fItop\fR] [\fI\-\-delete\fR] [\fI\-\-keep\-relative\fR] [\fI\-\-wait\fR [\fI\-\-async\fR] [\fI\-\-verbose\fR]] [\fI\-\-timeout\fR \fBseconds\fR] [\fI\-\-active\fR] [{\fI\-\-pivot\fR | \fI\-\-keep\-overlay\fR}]" 4 .IX Item "blockcommit domain path [bandwidth] [--bytes] [base] [--shallow] [top] [--delete] [--keep-relative] [--wait [--async] [--verbose]] [--timeout seconds] [--active] [{--pivot | --keep-overlay}]" Reduce the length of a backing image chain, by committing changes at the top of the chain (snapshot or delta files) into backing images. By default, this command attempts to flatten the entire chain. If \fIbase\fR and/or \fItop\fR are specified as files within the backing chain, then the operation is constrained to committing just that portion of the chain; \&\fI\-\-shallow\fR can be used instead of \fIbase\fR to specify the immediate backing file of the resulting top image to be committed. The files being committed are rendered invalid, possibly as soon as the operation starts; using the \fI\-\-delete\fR flag will attempt to remove these invalidated files at the successful completion of the commit operation. When the \&\fI\-\-keep\-relative\fR flag is used, the backing file paths will be kept relative. .Sp When \fItop\fR is omitted or specified as the active image, it is also possible to specify \fI\-\-active\fR to trigger a two-phase active commit. In the first phase, \fItop\fR is copied into \fIbase\fR and the job can only be canceled, with top still containing data not yet in base. In the second phase, \fItop\fR and \fIbase\fR remain identical until a call to \fBblockjob\fR with the \fI\-\-abort\fR flag (keeping top as the active image that tracks changes from that point in time) or the \fI\-\-pivot\fR flag (making base the new active image and invalidating top). .Sp By default, this command returns as soon as possible, and data for the entire disk is committed in the background; the progress of the operation can be checked with \fBblockjob\fR. However, if \fI\-\-wait\fR is specified, then this command will block until the operation completes (or for \fI\-\-active\fR, enters the second phase), or until the operation is canceled because the optional \fItimeout\fR in seconds elapses or \s-1SIGINT\s0 is sent (usually with \f(CW\*(C`Ctrl\-C\*(C'\fR). Using \fI\-\-verbose\fR along with \fI\-\-wait\fR will produce periodic status updates. If job cancellation is triggered, \fI\-\-async\fR will return control to the user as fast as possible, otherwise the command may continue to block a little while longer until the job is done cleaning up. Using \fI\-\-pivot\fR is shorthand for combining \fI\-\-active\fR \fI\-\-wait\fR with an automatic \fBblockjob\fR \&\fI\-\-pivot\fR; and using \fI\-\-keep\-overlay\fR is shorthand for combining \&\fI\-\-active\fR \fI\-\-wait\fR with an automatic \fBblockjob\fR \fI\-\-abort\fR. .Sp \&\fIpath\fR specifies fully-qualified path of the disk; it corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fR (see also \fBdomblklist\fR for listing these names). \&\fIbandwidth\fR specifies copying bandwidth limit in MiB/s, although for qemu, it may be non-zero only for an online domain. For further information on the \fIbandwidth\fR argument see the corresponding section for the \fBblockjob\fR command. .IP "\fBblockcopy\fR \fIdomain\fR \fIpath\fR { \fIdest\fR [\fIformat\fR] [\fI\-\-blockdev\fR] | \fI\-\-xml\fR \fBfile\fR } [\fI\-\-shallow\fR] [\fI\-\-reuse\-external\fR] [\fIbandwidth\fR] [\fI\-\-wait\fR [\fI\-\-async\fR] [\fI\-\-verbose\fR]] [{\fI\-\-pivot\fR | \fI\-\-finish\fR}] [\fI\-\-timeout\fR \fBseconds\fR] [\fIgranularity\fR] [\fIbuf-size\fR] [\fI\-\-bytes\fR]" 4 .IX Item "blockcopy domain path { dest [format] [--blockdev] | --xml file } [--shallow] [--reuse-external] [bandwidth] [--wait [--async] [--verbose]] [{--pivot | --finish}] [--timeout seconds] [granularity] [buf-size] [--bytes]" Copy a disk backing image chain to a destination. Either \fIdest\fR as the destination file name, or \fI\-\-xml\fR with the name of an \s-1XML\s0 file containing a top-level element describing the destination, must be present. Additionally, if \fIdest\fR is given, \fIformat\fR should be specified to declare the format of the destination (if \fIformat\fR is omitted, then libvirt will reuse the format of the source, or with \fI\-\-reuse\-external\fR will be forced to probe the destination format, which could be a potential security hole). The command supports \fI\-\-raw\fR as a boolean flag synonym for \&\fI\-\-format=raw\fR. When using \fIdest\fR, the destination is treated as a regular file unless \fI\-\-blockdev\fR is used to signal that it is a block device. By default, this command flattens the entire chain; but if \fI\-\-shallow\fR is specified, the copy shares the backing chain. .Sp If \fI\-\-reuse\-external\fR is specified, then the destination must exist and have sufficient space to hold the copy. If \fI\-\-shallow\fR is used in conjunction with \fI\-\-reuse\-external\fR then the pre-created image must have guest visible contents identical to guest visible contents of the backing file of the original image. This may be used to modify the backing file names on the destination. .Sp By default, the copy job runs in the background, and consists of two phases. Initially, the job must copy all data from the source, and during this phase, the job can only be canceled to revert back to the source disk, with no guarantees about the destination. After this phase completes, both the source and the destination remain mirrored until a call to \fBblockjob\fR with the \fI\-\-abort\fR and \fI\-\-pivot\fR flags pivots over to the copy, or a call without \fI\-\-pivot\fR leaves the destination as a faithful copy of that point in time. However, if \fI\-\-wait\fR is specified, then this command will block until the mirroring phase begins, or cancel the operation if the optional \fItimeout\fR in seconds elapses or \s-1SIGINT\s0 is sent (usually with \f(CW\*(C`Ctrl\-C\*(C'\fR). Using \fI\-\-verbose\fR along with \fI\-\-wait\fR will produce periodic status updates. Using \fI\-\-pivot\fR (similar to \&\fBblockjob\fR \fI\-\-pivot\fR) or \fI\-\-finish\fR (similar to \fBblockjob\fR \fI\-\-abort\fR) implies \fI\-\-wait\fR, and will additionally end the job cleanly rather than leaving things in the mirroring phase. If job cancellation is triggered by timeout or by \fI\-\-finish\fR, \fI\-\-async\fR will return control to the user as fast as possible, otherwise the command may continue to block a little while longer until the job has actually cancelled. .Sp \&\fIpath\fR specifies fully-qualified path of the disk. \&\fIbandwidth\fR specifies copying bandwidth limit in MiB/s. Specifying a negative value is interpreted as an unsigned long long value that might be essentially unlimited, but more likely would overflow; it is safer to use 0 for that purpose. For further information on the \fIbandwidth\fR argument see the corresponding section for the \fBblockjob\fR command. Specifying \fIgranularity\fR allows fine-tuning of the granularity that will be copied when a dirty region is detected; larger values trigger less I/O overhead but may end up copying more data overall (the default value is usually correct); hypervisors may restrict this to be a power of two or fall within a certain range. Specifying \fIbuf-size\fR will control how much data can be simultaneously in-flight during the copy; larger values use more memory but may allow faster completion (the default value is usually correct). .IP "\fBblockpull\fR \fIdomain\fR \fIpath\fR [\fIbandwidth\fR] [\fI\-\-bytes\fR] [\fIbase\fR] [\fI\-\-wait\fR [\fI\-\-verbose\fR] [\fI\-\-timeout\fR \fBseconds\fR] [\fI\-\-async\fR]] [\fI\-\-keep\-relative\fR]" 4 .IX Item "blockpull domain path [bandwidth] [--bytes] [base] [--wait [--verbose] [--timeout seconds] [--async]] [--keep-relative]" Populate a disk from its backing image chain. By default, this command flattens the entire chain; but if \fIbase\fR is specified, containing the name of one of the backing files in the chain, then that file becomes the new backing file and only the intermediate portion of the chain is pulled. Once all requested data from the backing image chain has been pulled, the disk no longer depends on that portion of the backing chain. .Sp By default, this command returns as soon as possible, and data for the entire disk is pulled in the background; the progress of the operation can be checked with \fBblockjob\fR. However, if \fI\-\-wait\fR is specified, then this command will block until the operation completes, or cancel the operation if the optional \fItimeout\fR in seconds elapses or \s-1SIGINT\s0 is sent (usually with \f(CW\*(C`Ctrl\-C\*(C'\fR). Using \fI\-\-verbose\fR along with \fI\-\-wait\fR will produce periodic status updates. If job cancellation is triggered, \fI\-\-async\fR will return control to the user as fast as possible, otherwise the command may continue to block a little while longer until the job is done cleaning up. .Sp Using the \fI\-\-keep\-relative\fR flag will keep the backing chain names relative. .Sp \&\fIpath\fR specifies fully-qualified path of the disk; it corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fR (see also \fBdomblklist\fR for listing these names). \&\fIbandwidth\fR specifies copying bandwidth limit in MiB/s. For further information on the \fIbandwidth\fR argument see the corresponding section for the \fBblockjob\fR command. .IP "\fBblkdeviotune\fR \fIdomain\fR \fIdevice\fR [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]] [[\fItotal-bytes-sec\fR] | [\fIread-bytes-sec\fR] [\fIwrite-bytes-sec\fR]] [[\fItotal-iops-sec\fR] | [\fIread-iops-sec\fR] [\fIwrite-iops-sec\fR]] [[\fItotal-bytes-sec-max\fR] | [\fIread-bytes-sec-max\fR] [\fIwrite-bytes-sec-max\fR]] [[\fItotal-iops-sec-max\fR] | [\fIread-iops-sec-max\fR] [\fIwrite-iops-sec-max\fR]] [[\fItotal-bytes-sec-max-length\fR] | [\fIread-bytes-sec-max-length\fR] [\fIwrite-bytes-sec-max-length\fR]] [[\fItotal-iops-sec-max-length\fR] | [\fIread-iops-sec-max-length\fR] [\fIwrite-iops-sec-max-length\fR]] [\fIsize-iops-sec\fR] [\fIgroup_name\fR]" 4 .IX Item "blkdeviotune domain device [[--config] [--live] | [--current]] [[total-bytes-sec] | [read-bytes-sec] [write-bytes-sec]] [[total-iops-sec] | [read-iops-sec] [write-iops-sec]] [[total-bytes-sec-max] | [read-bytes-sec-max] [write-bytes-sec-max]] [[total-iops-sec-max] | [read-iops-sec-max] [write-iops-sec-max]] [[total-bytes-sec-max-length] | [read-bytes-sec-max-length] [write-bytes-sec-max-length]] [[total-iops-sec-max-length] | [read-iops-sec-max-length] [write-iops-sec-max-length]] [size-iops-sec] [group_name]" Set or query the block disk io parameters for a block device of \fIdomain\fR. \&\fIdevice\fR specifies a unique target name () or source file () for one of the disk devices attached to \&\fIdomain\fR (see also \fBdomblklist\fR for listing these names). .Sp If no limit is specified, it will query current I/O limits setting. Otherwise, alter the limits with these flags: \&\fI\-\-total\-bytes\-sec\fR specifies total throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \&\fI\-\-read\-bytes\-sec\fR specifies read throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \&\fI\-\-write\-bytes\-sec\fR specifies write throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \&\fI\-\-total\-iops\-sec\fR specifies total I/O operations limit per second. \&\fI\-\-read\-iops\-sec\fR specifies read I/O operations limit per second. \&\fI\-\-write\-iops\-sec\fR specifies write I/O operations limit per second. \&\fI\-\-total\-bytes\-sec\-max\fR specifies maximum total throughput limit as a scaled integer, the default being bytes per second if no suffix is specified \&\fI\-\-read\-bytes\-sec\-max\fR specifies maximum read throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \&\fI\-\-write\-bytes\-sec\-max\fR specifies maximum write throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \&\fI\-\-total\-iops\-sec\-max\fR specifies maximum total I/O operations limit per second. \&\fI\-\-read\-iops\-sec\-max\fR specifies maximum read I/O operations limit per second. \&\fI\-\-write\-iops\-sec\-max\fR specifies maximum write I/O operations limit per second. \&\fI\-\-total\-bytes\-sec\-max\-length\fR specifies duration in seconds to allow maximum total throughput limit. \&\fI\-\-read\-bytes\-sec\-max\-length\fR specifies duration in seconds to allow maximum read throughput limit. \&\fI\-\-write\-bytes\-sec\-max\-length\fR specifies duration in seconds to allow maximum write throughput limit. \&\fI\-\-total\-iops\-sec\-max\-length\fR specifies duration in seconds to allow maximum total I/O operations limit. \&\fI\-\-read\-iops\-sec\-max\-length\fR specifies duration in seconds to allow maximum read I/O operations limit. \&\fI\-\-write\-iops\-sec\-max\-length\fR specifies duration in seconds to allow maximum write I/O operations limit. \&\fI\-\-size\-iops\-sec\fR specifies size I/O operations limit per second. \&\fI\-\-group_name\fR specifies group name to share I/O quota between multiple drives. For a qemu domain, if no name is provided, then the default is to have a single group for each \fIdevice\fR. .Sp Older versions of virsh only accepted these options with underscore instead of dash, as in \fI\-\-total_bytes_sec\fR. .Sp Bytes and iops values are independent, but setting only one value (such as \-\-read\-bytes\-sec) resets the other two in that category to unlimited. An explicit 0 also clears any limit. A non-zero value for a given total cannot be mixed with non-zero values for read or write. .Sp It is up to the hypervisor to determine how to handle the length values. For the qemu hypervisor, if an I/O limit value or maximum value is set, then the default value of 1 second will be displayed. Supplying a 0 will reset the value back to the default. .Sp If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. When setting the disk io parameters both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. For querying only one of \fI\-\-live\fR, \&\fI\-\-config\fR or \fI\-\-current\fR can be specified. If no flag is specified, behavior is different depending on hypervisor. .IP "\fBblockjob\fR \fIdomain\fR \fIpath\fR { [\fI\-\-abort\fR] [\fI\-\-async\fR] [\fI\-\-pivot\fR] | [\fI\-\-info\fR] [\fI\-\-raw\fR] [\fI\-\-bytes\fR] | [\fIbandwidth\fR] }" 4 .IX Item "blockjob domain path { [--abort] [--async] [--pivot] | [--info] [--raw] [--bytes] | [bandwidth] }" Manage active block operations. There are three mutually-exclusive modes: \&\fI\-\-info\fR, \fIbandwidth\fR, and \fI\-\-abort\fR. \fI\-\-async\fR and \fI\-\-pivot\fR imply abort mode; \fI\-\-raw\fR implies info mode; and if no mode was given, \fI\-\-info\fR mode is assumed. .Sp \&\fIpath\fR specifies fully-qualified path of the disk; it corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fR (see also \fBdomblklist\fR for listing these names). .Sp In \fI\-\-abort\fR mode, the active job on the specified disk will be aborted. If \fI\-\-async\fR is also specified, this command will return immediately, rather than waiting for the cancellation to complete. If \&\fI\-\-pivot\fR is specified, this requests that an active copy or active commit job be pivoted over to the new image. .Sp In \fI\-\-info\fR mode, the active job information on the specified disk will be printed. By default, the output is a single human-readable summary line; this format may change in future versions. Adding \&\fI\-\-raw\fR lists each field of the struct, in a stable format. If the \&\fI\-\-bytes\fR flag is set, then the command errors out if the server could not supply bytes/s resolution; when omitting the flag, raw output is listed in MiB/s and human-readable output automatically selects the best resolution supported by the server. .Sp \&\fIbandwidth\fR can be used to set bandwidth limit for the active job in MiB/s. If \fI\-\-bytes\fR is specified then the bandwidth value is interpreted in bytes/s. Specifying a negative value is interpreted as an unsigned long value or essentially unlimited. The hypervisor can choose whether to reject the value or convert it to the maximum value allowed. Optionally a scaled positive number may be used as bandwidth (see \fB\s-1NOTES\s0\fR above). Using \&\fI\-\-bytes\fR with a scaled value allows to use finer granularity. A scaled value used without \fI\-\-bytes\fR will be rounded down to MiB/s. Note that the \&\fI\-\-bytes\fR may be unsupported by the hypervisor. .IP "\fBblockresize\fR \fIdomain\fR \fIpath\fR \fIsize\fR" 4 .IX Item "blockresize domain path size" Resize a block device of domain while the domain is running, \fIpath\fR specifies the absolute path of the block device; it corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fR (see also \fBdomblklist\fR for listing these names). .Sp \&\fIsize\fR is a scaled integer (see \fB\s-1NOTES\s0\fR above) which defaults to KiB (blocks of 1024 bytes) if there is no suffix. You must use a suffix of \&\*(L"B\*(R" to get bytes (note that for historical reasons, this differs from \&\fBvol-resize\fR which defaults to bytes without a suffix). .IP "\fBdomdisplay\fR \fIdomain\fR [\fI\-\-include\-password\fR] [[\fI\-\-type\fR] \fBtype\fR] [\fI\-\-all\fR]" 4 .IX Item "domdisplay domain [--include-password] [[--type] type] [--all]" Output a \s-1URI\s0 which can be used to connect to the graphical display of the domain via \s-1VNC, SPICE\s0 or \s-1RDP. \s0 The particular graphical display type can be selected using the \fBtype\fR parameter (e.g. \*(L"vnc\*(R", \*(L"spice\*(R", \*(L"rdp\*(R"). If \&\fI\-\-include\-password\fR is specified, the \s-1SPICE\s0 channel password will be included in the \s-1URI.\s0 If \fI\-\-all\fR is specified, then all show all possible graphical displays, for a \s-1VM\s0 could have more than one graphical displays. .IP "\fBdomfsinfo\fR \fIdomain\fR" 4 .IX Item "domfsinfo domain" Show a list of mounted filesystems within the running domain. The list contains mountpoints, names of a mounted device in the guest, filesystem types, and unique target names used in the domain \s-1XML \s0(). .Sp Note that this command requires a guest agent configured and running in the domain's guest \s-1OS.\s0 .IP "\fBdomfsfreeze\fR \fIdomain\fR [[\fI\-\-mountpoint\fR] \fBmountpoint\fR...]" 4 .IX Item "domfsfreeze domain [[--mountpoint] mountpoint...]" Freeze mounted filesystems within a running domain to prepare for consistent snapshots. .Sp The \fI\-\-mountpoint\fR option takes a parameter \fBmountpoint\fR, which is a mount point path of the filesystem to be frozen. This option can occur multiple times. If this is not specified, every mounted filesystem is frozen. .Sp Note: \fBsnapshot-create\fR command has a \fI\-\-quiesce\fR option to freeze and thaw the filesystems automatically to keep snapshots consistent. \&\fBdomfsfreeze\fR command is only needed when a user wants to utilize the native snapshot features of storage devices not supported by libvirt. .IP "\fBdomfsthaw\fR \fIdomain\fR [[\fI\-\-mountpoint\fR] \fBmountpoint\fR...]" 4 .IX Item "domfsthaw domain [[--mountpoint] mountpoint...]" Thaw mounted filesystems within a running domain, which have been frozen by domfsfreeze command. .Sp The \fI\-\-mountpoint\fR option takes a parameter \fBmountpoint\fR, which is a mount point path of the filesystem to be thawed. This option can occur multiple times. If this is not specified, every mounted filesystem is thawed. .IP "\fBdomfstrim\fR \fIdomain\fR [\fI\-\-minimum\fR \fBbytes\fR] [\fI\-\-mountpoint mountPoint\fR]" 4 .IX Item "domfstrim domain [--minimum bytes] [--mountpoint mountPoint]" Issue a fstrim command on all mounted filesystems within a running domain. It discards blocks which are not in use by the filesystem. If \fI\-\-minimum\fR \fBbytes\fR is specified, it tells guest kernel length of contiguous free range. Smaller than this may be ignored (this is a hint and the guest may not respect it). By increasing this value, the fstrim operation will complete more quickly for filesystems with badly fragmented free space, although not all blocks will be discarded. The default value is zero, meaning \*(L"discard every free block\*(R". Moreover, if a user wants to trim only one mount point, it can be specified via optional \fI\-\-mountpoint\fR parameter. .IP "\fBdomhostname\fR \fIdomain\fR" 4 .IX Item "domhostname domain" Returns the hostname of a domain, if the hypervisor makes it available. .IP "\fBdominfo\fR \fIdomain\fR" 4 .IX Item "dominfo domain" Returns basic information about the domain. .IP "\fBdomuuid\fR \fIdomain-name-or-id\fR" 4 .IX Item "domuuid domain-name-or-id" Convert a domain name or id to domain \s-1UUID\s0 .IP "\fBdomid\fR \fIdomain-name-or-uuid\fR" 4 .IX Item "domid domain-name-or-uuid" Convert a domain name (or \s-1UUID\s0) to a domain id .IP "\fBdomjobabort\fR \fIdomain\fR" 4 .IX Item "domjobabort domain" Abort the currently running domain job. .IP "\fBdomjobinfo\fR \fIdomain\fR [\fI\-\-completed\fR]" 4 .IX Item "domjobinfo domain [--completed]" Returns information about jobs running on a domain. \fI\-\-completed\fR tells virsh to return information about a recently finished job. Statistics of a completed job are automatically destroyed once read or when libvirtd is restarted. Note that time information returned for completed migrations may be completely irrelevant unless both source and destination hosts have synchronized time (i.e., \s-1NTP\s0 daemon is running on both of them). .IP "\fBdomname\fR \fIdomain-id-or-uuid\fR" 4 .IX Item "domname domain-id-or-uuid" Convert a domain Id (or \s-1UUID\s0) to domain name .IP "\fBdomrename\fR \fIdomain\fR \fInew-name\fR" 4 .IX Item "domrename domain new-name" Rename a domain. This command changes current domain name to the new name specified in the second argument. .Sp \&\fBNote\fR: Domain must be inactive and without snapshots. .IP "\fBdomstate\fR \fIdomain\fR [\fI\-\-reason\fR]" 4 .IX Item "domstate domain [--reason]" Returns state about a domain. \fI\-\-reason\fR tells virsh to also print reason for the state. .IP "\fBdomcontrol\fR \fIdomain\fR" 4 .IX Item "domcontrol domain" Returns state of an interface to \s-1VMM\s0 used to control a domain. For states other than \*(L"ok\*(R" or \*(L"error\*(R" the command also prints number of seconds elapsed since the control interface entered its current state. .IP "\fBdomtime\fR \fIdomain\fR { [\fI\-\-now\fR] [\fI\-\-pretty\fR] [\fI\-\-sync\fR] [\fI\-\-time\fR \fBtime\fR] }" 4 .IX Item "domtime domain { [--now] [--pretty] [--sync] [--time time] }" Gets or sets the domain's system time. When run without any arguments (but \fIdomain\fR), the current domain's system time is printed out. The \&\fI\-\-pretty\fR modifier can be used to print the time in more human readable form. .Sp When \fI\-\-time\fR \fBtime\fR is specified, the domain's time is not gotten but set instead. The \fI\-\-now\fR modifier acts like if it was an alias for \fI\-\-time\fR \fB\f(CB$now\fB\fR, which means it sets the time that is currently on the host virsh is running at. In both cases (setting and getting), time is in seconds relative to Epoch of 1970\-01\-01 in \s-1UTC.\s0 The \fI\-\-sync\fR modifies the set behavior a bit: The time passed is ignored, but the time to set is read from domain's \s-1RTC\s0 instead. Please note, that some hypervisors may require a guest agent to be configured in order to get or set the guest time. .IP "\fBdomxml-from-native\fR \fIformat\fR \fIconfig\fR" 4 .IX Item "domxml-from-native format config" Convert the file \fIconfig\fR in the native guest configuration format named by \fIformat\fR to a domain \s-1XML\s0 format. For \s-1QEMU/KVM\s0 hypervisor, the \fIformat\fR argument must be \fBqemu-argv\fR. For Xen hypervisor, the \&\fIformat\fR argument may be \fBxen-xm\fR, \fBxen-xl\fR, or \fBxen-sxpr\fR. For \&\s-1LXC\s0 hypervisor, the \fIformat\fR argument must be \fBlxc-tools\fR. .IP "\fBdomxml-to-native\fR \fIformat\fR \fIxml\fR" 4 .IX Item "domxml-to-native format xml" Convert the file \fIxml\fR in domain \s-1XML\s0 format to the native guest configuration format named by \fIformat\fR. For \s-1QEMU/KVM\s0 hypervisor, the \fIformat\fR argument must be \fBqemu-argv\fR. For Xen hypervisor, the \&\fIformat\fR argument may be \fBxen-xm\fR, \fBxen-xl\fR, or \fBxen-sxpr\fR. For \&\s-1LXC\s0 hypervisor, the \fIformat\fR argument must be \fBlxc-tools\fR. .IP "\fBdump\fR \fIdomain\fR \fIcorefilepath\fR [\fI\-\-bypass\-cache\fR] { [\fI\-\-live\fR] | [\fI\-\-crash\fR] | [\fI\-\-reset\fR] } [\fI\-\-verbose\fR] [\fI\-\-memory\-only\fR] [\fI\-\-format\fR \fIstring\fR]" 4 .IX Item "dump domain corefilepath [--bypass-cache] { [--live] | [--crash] | [--reset] } [--verbose] [--memory-only] [--format string]" Dumps the core of a domain to a file for analysis. If \fI\-\-live\fR is specified, the domain continues to run until the core dump is complete, rather than pausing up front. If \fI\-\-crash\fR is specified, the domain is halted with a crashed status, rather than merely left in a paused state. If \fI\-\-reset\fR is specified, the domain is reset after successful dump. Note, these three switches are mutually exclusive. If \fI\-\-bypass\-cache\fR is specified, the save will avoid the file system cache, although this may slow down the operation. If \fI\-\-memory\-only\fR is specified, the file is elf file, and will only include domain's memory and cpu common register value. It is very useful if the domain uses host devices directly. \&\fI\-\-format\fR \fIstring\fR is used to specify the format of 'memory\-only' dump, and \fIstring\fR can be one of them: elf, kdump\-zlib(kdump\-compressed format with zlib-compressed), kdump\-lzo(kdump\-compressed format with lzo-compressed), kdump\-snappy(kdump\-compressed format with snappy-compressed). .Sp The progress may be monitored using \fBdomjobinfo\fR virsh command and canceled with \fBdomjobabort\fR command (sent by another virsh instance). Another option is to send \s-1SIGINT \s0(usually with \f(CW\*(C`Ctrl\-C\*(C'\fR) to the virsh process running \&\fBdump\fR command. \fI\-\-verbose\fR displays the progress of dump. .Sp \&\s-1NOTE:\s0 Some hypervisors may require the user to manually ensure proper permissions on file and path specified by argument \fIcorefilepath\fR. .Sp \&\s-1NOTE:\s0 Crash dump in a old kvmdump format is being obsolete and cannot be loaded and processed by crash utility since its version 6.1.0. A \-\-memory\-only option is required in order to produce valid \s-1ELF\s0 file which can be later processed by the crash utility. .IP "\fBdumpxml\fR \fIdomain\fR [\fI\-\-inactive\fR] [\fI\-\-security\-info\fR] [\fI\-\-update\-cpu\fR] [\fI\-\-migratable\fR]" 4 .IX Item "dumpxml domain [--inactive] [--security-info] [--update-cpu] [--migratable]" Output the domain information as an \s-1XML\s0 dump to stdout, this format can be used by the \fBcreate\fR command. Additional options affecting the \s-1XML\s0 dump may be used. \fI\-\-inactive\fR tells virsh to dump domain configuration that will be used on next start of the domain as opposed to the current domain configuration. Using \fI\-\-security\-info\fR will also include security sensitive information in the \s-1XML\s0 dump. \fI\-\-update\-cpu\fR updates domain \s-1CPU\s0 requirements according to host \s-1CPU.\s0 With \fI\-\-migratable\fR one can request an \s-1XML\s0 that is suitable for migrations, i.e., compatible with older libvirt releases and possibly amended with internal run-time options. This option may automatically enable other options (\fI\-\-update\-cpu\fR, \fI\-\-security\-info\fR, ...) as necessary. .IP "\fBedit\fR \fIdomain\fR" 4 .IX Item "edit domain" Edit the \s-1XML\s0 configuration file for a domain, which will affect the next boot of the guest. .Sp This is equivalent to: .Sp .Vb 3 \& virsh dumpxml \-\-inactive \-\-security\-info domain > domain.xml \& vi domain.xml (or make changes with your other text editor) \& virsh define domain.xml .Ve .Sp except that it does some error checking. .Sp The editor used can be supplied by the \f(CW$VISUAL\fR or \f(CW$EDITOR\fR environment variables, and defaults to \f(CW\*(C`vi\*(C'\fR. .IP "\fBevent\fR {[\fIdomain\fR] { \fIevent\fR | \fI\-\-all\fR } [\fI\-\-loop\fR] [\fI\-\-timeout\fR \fIseconds\fR] [\fI\-\-timestamp\fR] | \fI\-\-list\fR}" 4 .IX Item "event {[domain] { event | --all } [--loop] [--timeout seconds] [--timestamp] | --list}" Wait for a class of domain events to occur, and print appropriate details of events as they happen. The events can optionally be filtered by \&\fIdomain\fR. Using \fI\-\-list\fR as the only argument will provide a list of possible \fIevent\fR values known by this client, although the connection might not allow registering for all these events. It is also possible to use \fI\-\-all\fR instead of \fIevent\fR to register for all possible event types at once. .Sp By default, this command is one-shot, and returns success once an event occurs; you can send \s-1SIGINT \s0(usually via \f(CW\*(C`Ctrl\-C\*(C'\fR) to quit immediately. If \fI\-\-timeout\fR is specified, the command gives up waiting for events after \fIseconds\fR have elapsed. With \fI\-\-loop\fR, the command prints all events until a timeout or interrupt key. .Sp When \fI\-\-timestamp\fR is used, a human-readable timestamp will be printed before the event. .IP "\fBiothreadinfo\fR \fIdomain\fR [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]]" 4 .IX Item "iothreadinfo domain [[--live] [--config] | [--current]]" Display basic domain IOThreads information including the IOThread \s-1ID\s0 and the \s-1CPU\s0 Affinity for each IOThread. .Sp If \fI\-\-live\fR is specified, get the IOThreads data from the running guest. If the guest is not running, an error is returned. If \fI\-\-config\fR is specified, get the IOThreads data from the next boot of a persistent guest. If \fI\-\-current\fR is specified or \fI\-\-live\fR and \fI\-\-config\fR are not specified, then get the IOThread data based on the current guest state. .IP "\fBiothreadpin\fR \fIdomain\fR \fIiothread\fR \fIcpulist\fR [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]]" 4 .IX Item "iothreadpin domain iothread cpulist [[--live] [--config] | [--current]]" Change the pinning of a domain IOThread to host physical CPUs. In order to retrieve a list of all IOThreads, use \fBiothreadinfo\fR. To pin an \&\fIiothread\fR specify the \fIcpulist\fR desired for the IOThread \s-1ID\s0 as listed in the \fBiothreadinfo\fR output. .Sp \&\fIcpulist\fR is a list of physical \s-1CPU\s0 numbers. Its syntax is a comma separated list and a special markup using '\-' and '^' (ex. '0\-4', '0\-3,^2') can also be allowed. The '\-' denotes the range and the '^' denotes exclusive. If you want to reset iothreadpin setting, that is, to pin an \fIiothread\fR to all physical cpus, simply specify 'r' as a \fIcpulist\fR. .Sp If \fI\-\-live\fR is specified, affect a running guest. If the guest is not running, an error is returned. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified or \fI\-\-live\fR and \fI\-\-config\fR are not specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given if \fIcpulist\fR is present, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .Sp \&\fBNote\fR: The expression is sequentially evaluated, so \*(L"0\-15,^8\*(R" is identical to \*(L"9\-14,0\-7,15\*(R" but not identical to \*(L"^8,0\-15\*(R". .IP "\fBiothreadadd\fR \fIdomain\fR \fIiothread_id\fR [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "iothreadadd domain iothread_id [[--config] [--live] | [--current]]" Add a new IOThread to the domain using the specified \fIiothread_id\fR. If the \fIiothread_id\fR already exists, the command will fail. The \&\fIiothread_id\fR must be greater than zero. .Sp If \fI\-\-live\fR is specified, affect a running guest. If the guest is not running an error is returned. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified or \fI\-\-live\fR and \fI\-\-config\fR are not specified, affect the current guest state. .IP "\fBiothreaddel\fR \fIdomain\fR \fIiothread_id\fR [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "iothreaddel domain iothread_id [[--config] [--live] | [--current]]" Delete an IOThread from the domain using the specified \fIiothread_id\fR. If an IOThread is currently assigned to a disk resource such as via the \&\fBattach-disk\fR command, then the attempt to remove the IOThread will fail. If the \fIiothread_id\fR does not exist an error will occur. .Sp If \fI\-\-live\fR is specified, affect a running guest. If the guest is not running an error is returned. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified or \fI\-\-live\fR and \fI\-\-config\fR are not specified, affect the current guest state. .IP "\fBmanagedsave\fR \fIdomain\fR [\fI\-\-bypass\-cache\fR] [{\fI\-\-running\fR | \fI\-\-paused\fR}] [\fI\-\-verbose\fR]" 4 .IX Item "managedsave domain [--bypass-cache] [{--running | --paused}] [--verbose]" Save and destroy (stop) a running domain, so it can be restarted from the same state at a later time. When the virsh \fBstart\fR command is next run for the domain, it will automatically be started from this saved state. If \fI\-\-bypass\-cache\fR is specified, the save will avoid the file system cache, although this may slow down the operation. .Sp The progress may be monitored using \fBdomjobinfo\fR virsh command and canceled with \fBdomjobabort\fR command (sent by another virsh instance). Another option is to send \s-1SIGINT \s0(usually with \f(CW\*(C`Ctrl\-C\*(C'\fR) to the virsh process running \&\fBmanagedsave\fR command. \fI\-\-verbose\fR displays the progress of save. .Sp Normally, starting a managed save will decide between running or paused based on the state the domain was in when the save was done; passing either the \fI\-\-running\fR or \fI\-\-paused\fR flag will allow overriding which state the \fBstart\fR should use. .Sp The \fBdominfo\fR command can be used to query whether a domain currently has any managed save image. .IP "\fBmanagedsave-remove\fR \fIdomain\fR" 4 .IX Item "managedsave-remove domain" Remove the \fBmanagedsave\fR state file for a domain, if it exists. This ensures the domain will do a full boot the next time it is started. .IP "\fBmaxvcpus\fR [\fItype\fR]" 4 .IX Item "maxvcpus [type]" Provide the maximum number of virtual CPUs supported for a guest \s-1VM\s0 on this connection. If provided, the \fItype\fR parameter must be a valid type attribute for the element of \s-1XML.\s0 .IP "\fBcpu-stats\fR \fIdomain\fR [\fI\-\-total\fR] [\fIstart\fR] [\fIcount\fR]" 4 .IX Item "cpu-stats domain [--total] [start] [count]" Provide cpu statistics information of a domain. The domain should be running. Default it shows stats for all CPUs, and a total. Use \&\fI\-\-total\fR for only the total stats, \fIstart\fR for only the per-cpu stats of the CPUs from \fIstart\fR, \fIcount\fR for only \fIcount\fR CPUs' stats. .IP "\fBmetadata\fR \fIdomain\fR [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] [\fI\-\-edit\fR] [\fIuri\fR] [\fIkey\fR] [\fIset\fR] [\fI\-\-remove\fR]" 4 .IX Item "metadata domain [[--live] [--config] | [--current]] [--edit] [uri] [key] [set] [--remove]" Show or modify custom \s-1XML\s0 metadata of a domain. The metadata is a user defined \s-1XML\s0 that allows to store arbitrary \s-1XML\s0 data in the domain definition. Multiple separate custom metadata pieces can be stored in the domain \s-1XML.\s0 The pieces are identified by a private \s-1XML\s0 namespace provided via the \&\fIuri\fR argument. (See also \fBdesc\fR that works with textual metadata of a domain.) .Sp Flags \fI\-\-live\fR or \fI\-\-config\fR select whether this command works on live or persistent definitions of the domain. If both \fI\-\-live\fR and \fI\-\-config\fR are specified, the \fI\-\-config\fR option takes precedence on getting the current description and both live configuration and config are updated while setting the description. \fI\-\-current\fR is exclusive and implied if none of these was specified. .Sp Flag \fI\-\-remove\fR specifies that the metadata element specified by the \fIuri\fR argument should be removed rather than updated. .Sp Flag \fI\-\-edit\fR specifies that an editor with the metadata identified by the \&\fIuri\fR argument should be opened and the contents saved back afterwards. Otherwise the new contents can be provided via the \fIset\fR argument. .Sp When setting metadata via \fI\-\-edit\fR or \fIset\fR the \fIkey\fR argument must be specified and is used to prefix the custom elements to bind them to the private namespace. .Sp If neither of \fI\-\-edit\fR and \fIset\fR are specified the \s-1XML\s0 metadata corresponding to the \fIuri\fR namespace is displayed instead of being modified. .IP "\fBmigrate\fR [\fI\-\-live\fR] [\fI\-\-offline\fR] [\fI\-\-direct\fR] [\fI\-\-p2p\fR [\fI\-\-tunnelled\fR]] [\fI\-\-persistent\fR] [\fI\-\-undefinesource\fR] [\fI\-\-suspend\fR] [\fI\-\-copy\-storage\-all\fR] [\fI\-\-copy\-storage\-inc\fR] [\fI\-\-change\-protection\fR] [\fI\-\-unsafe\fR] [\fI\-\-verbose\fR] [\fI\-\-rdma\-pin\-all\fR] [\fI\-\-abort\-on\-error\fR] [\fI\-\-postcopy\fR] [\fI\-\-postcopy\-after\-precopy\fR] \fIdomain\fR \fIdesturi\fR [\fImigrateuri\fR] [\fIgraphicsuri\fR] [\fIlisten-address\fR] [\fIdname\fR] [\fI\-\-timeout\fR \fBseconds\fR [\fI\-\-timeout\-suspend\fR | \fI\-\-timeout\-postcopy\fR]] [\fI\-\-xml\fR \fBfile\fR] [\fI\-\-migrate\-disks\fR \fBdisk-list\fR] [\fI\-\-disks\-port\fR \fBport\fR] [\fI\-\-compressed\fR] [\fI\-\-comp\-methods\fR \fBmethod-list\fR] [\fI\-\-comp\-mt\-level\fR] [\fI\-\-comp\-mt\-threads\fR] [\fI\-\-comp\-mt\-dthreads\fR] [\fI\-\-comp\-xbzrle\-cache\fR] [\fI\-\-auto\-converge\fR] [\fIauto-converge-initial\fR] [\fIauto-converge-increment\fR] [\fI\-\-persistent\-xml\fR \fBfile\fR]" 4 .IX Item "migrate [--live] [--offline] [--direct] [--p2p [--tunnelled]] [--persistent] [--undefinesource] [--suspend] [--copy-storage-all] [--copy-storage-inc] [--change-protection] [--unsafe] [--verbose] [--rdma-pin-all] [--abort-on-error] [--postcopy] [--postcopy-after-precopy] domain desturi [migrateuri] [graphicsuri] [listen-address] [dname] [--timeout seconds [--timeout-suspend | --timeout-postcopy]] [--xml file] [--migrate-disks disk-list] [--disks-port port] [--compressed] [--comp-methods method-list] [--comp-mt-level] [--comp-mt-threads] [--comp-mt-dthreads] [--comp-xbzrle-cache] [--auto-converge] [auto-converge-initial] [auto-converge-increment] [--persistent-xml file]" Migrate domain to another host. Add \fI\-\-live\fR for live migration; <\-\-p2p> for peer\-2\-peer migration; \fI\-\-direct\fR for direct migration; or \fI\-\-tunnelled\fR for tunnelled migration. \fI\-\-offline\fR migrates domain definition without starting the domain on destination and without stopping it on source host. Offline migration may be used with inactive domains and it must be used with \&\fI\-\-persistent\fR option. \fI\-\-persistent\fR leaves the domain persistent on destination host, \fI\-\-undefinesource\fR undefines the domain on the source host, and \fI\-\-suspend\fR leaves the domain paused on the destination host. \&\fI\-\-copy\-storage\-all\fR indicates migration with non-shared storage with full disk copy, \fI\-\-copy\-storage\-inc\fR indicates migration with non-shared storage with incremental copy (same base image shared between source and destination). In both cases the disk images have to exist on destination host, the \&\fI\-\-copy\-storage\-...\fR options only tell libvirt to transfer data from the images on source host to the images found at the same place on the destination host. By default only non-shared non-readonly images are transferred. Use \&\fI\-\-migrate\-disks\fR to explicitly specify a list of disk targets to transfer via the comma separated \fBdisk-list\fR argument. \fI\-\-change\-protection\fR enforces that no incompatible configuration changes will be made to the domain while the migration is underway; this flag is implicitly enabled when supported by the hypervisor, but can be explicitly used to reject the migration if the hypervisor lacks change protection support. \fI\-\-verbose\fR displays the progress of migration. \fI\-\-abort\-on\-error\fR cancels the migration if a soft error (for example I/O error) happens during the migration. \fI\-\-postcopy\fR enables post-copy logic in migration, but does not actually start post-copy, i.e., migration is started in pre-copy mode. Once migration is running, the user may switch to post-copy using the \&\fBmigrate-postcopy\fR command sent from another virsh instance or use \&\fI\-\-postcopy\-after\-precopy\fR along with \fI\-\-postcopy\fR to let libvirt automatically switch to post-copy after the first pass of pre-copy is finished. .Sp \&\fI\-\-auto\-converge\fR forces convergence during live migration. The initial guest \s-1CPU\s0 throttling rate can be set with \fIauto-converge-initial\fR. If the initial throttling rate is not enough to ensure convergence, the rate is periodically increased by \fIauto-converge-increment\fR. .Sp \&\fI\-\-rdma\-pin\-all\fR can be used with \s-1RDMA\s0 migration (i.e., when \fImigrateuri\fR starts with rdma://) to tell the hypervisor to pin all domain's memory at once before migration starts rather than letting it pin memory pages as needed. .Sp \&\fBNote\fR: Individual hypervisors usually do not support all possible types of migration. For example, \s-1QEMU\s0 does not support direct migration. .Sp In some cases libvirt may refuse to migrate the domain because doing so may lead to potential problems such as data corruption, and thus the migration is considered unsafe. For \s-1QEMU\s0 domain, this may happen if the domain uses disks without explicitly setting cache mode to \*(L"none\*(R". Migrating such domains is unsafe unless the disk images are stored on coherent clustered filesystem, such as \s-1GFS2\s0 or \s-1GPFS.\s0 If you are sure the migration is safe or you just do not care, use \fI\-\-unsafe\fR to force the migration. .Sp \&\fIdname\fR is used for renaming the domain to new name during migration, which also usually can be omitted. Likewise, \fI\-\-xml\fR \fBfile\fR is usually omitted, but can be used to supply an alternative \s-1XML\s0 file for use on the destination to supply a larger set of changes to any host-specific portions of the domain \s-1XML,\s0 such as accounting for naming differences between source and destination in accessing underlying storage. If \fI\-\-persistent\fR is enabled, \fI\-\-persistent\-xml\fR \fBfile\fR can be used to supply an alternative \s-1XML\s0 file which will be used as the persistent domain definition on the destination host. .Sp \&\fI\-\-timeout\fR \fBseconds\fR tells virsh to run a specified action when live migration exceeds that many seconds. It can only be used with \fI\-\-live\fR. If \fI\-\-timeout\-suspend\fR is specified, the domain will be suspended after the timeout and the migration will complete offline; this is the default if no \fI\-\-timeout\-*\fR option is specified on the command line. When \&\fI\-\-timeout\-postcopy\fR is used, virsh will switch migration from pre-copy to post-copy upon timeout; migration has to be started with \fI\-\-postcopy\fR option for this to work. .Sp \&\fI\-\-compressed\fR activates compression, the compression method is chosen with \fI\-\-comp\-methods\fR. Supported methods are \*(L"mt\*(R" and \*(L"xbzrle\*(R" and can be used in any combination. When no methods are specified, a hypervisor default methods will be used. \s-1QEMU\s0 defaults to \*(L"xbzrle\*(R". Compression methods can be tuned further. \fI\-\-comp\-mt\-level\fR sets compression level. Values are in range from 0 to 9, where 1 is maximum speed and 9 is maximum compression. \fI\-\-comp\-mt\-threads\fR and \fI\-\-comp\-mt\-dthreads\fR set the number of compress threads on source and the number of decompress threads on target respectively. \fI\-\-comp\-xbzrle\-cache\fR sets size of page cache in bytes. .Sp Running migration can be canceled by interrupting virsh (usually using \&\f(CW\*(C`Ctrl\-C\*(C'\fR) or by \fBdomjobabort\fR command sent from another virsh instance. .Sp The \fIdesturi\fR and \fImigrateuri\fR parameters can be used to control which destination the migration uses. \fIdesturi\fR is important for managed migration, but unused for direct migration; \fImigrateuri\fR is required for direct migration, but can usually be automatically determined for managed migration. .Sp \&\fBNote\fR: The \fIdesturi\fR parameter for normal migration and peer2peer migration has different semantics: .RS 4 .IP "\(bu" 4 normal migration: the \fIdesturi\fR is an address of the target host as seen from the client machine. .IP "\(bu" 4 peer2peer migration: the \fIdesturi\fR is an address of the target host as seen from the source machine. .RE .RS 4 .Sp When \fImigrateuri\fR is not specified, libvirt will automatically determine the hypervisor specific \s-1URI. \s0 Some hypervisors, including \s-1QEMU,\s0 have an optional \&\*(L"migration_host\*(R" configuration parameter (useful when the host has multiple network interfaces). If this is unspecified, libvirt determines a name by looking up the target host's configured hostname. .Sp There are a few scenarios where specifying \fImigrateuri\fR may help: .IP "\(bu" 4 The configured hostname is incorrect, or \s-1DNS\s0 is broken. If a host has a hostname which will not resolve to match one of its public \s-1IP\s0 addresses, then libvirt will generate an incorrect \s-1URI. \s0 In this case \fImigrateuri\fR should be explicitly specified, using an \s-1IP\s0 address, or a correct hostname. .IP "\(bu" 4 The host has multiple network interfaces. If a host has multiple network interfaces, it might be desirable for the migration data stream to be sent over a specific interface for either security or performance reasons. In this case \&\fImigrateuri\fR should be explicitly specified, using an \s-1IP\s0 address associated with the network to be used. .IP "\(bu" 4 The firewall restricts what ports are available. When libvirt generates a migration \s-1URI,\s0 it will pick a port number using hypervisor specific rules. Some hypervisors only require a single port to be open in the firewalls, while others require a whole range of port numbers. In the latter case \fImigrateuri\fR might be specified to choose a specific port number outside the default range in order to comply with local firewall policies. .RE .RS 4 .Sp See for more details on migration URIs. .Sp Optional \fIgraphicsuri\fR overrides connection parameters used for automatically reconnecting a graphical clients at the end of migration. If omitted, libvirt will compute the parameters based on target host \s-1IP\s0 address. In case the client does not have a direct access to the network virtualization hosts are connected to and needs to connect through a proxy, \fIgraphicsuri\fR may be used to specify the address the client should connect to. The \s-1URI\s0 is formed as follows: .Sp .Vb 1 \& protocol://hostname[:port]/[?parameters] .Ve .Sp where protocol is either \*(L"spice\*(R" or \*(L"vnc\*(R" and parameters is a list of protocol specific parameters separated by '&'. Currently recognized parameters are \&\*(L"tlsPort\*(R" and \*(L"tlsSubject\*(R". For example, .Sp .Vb 1 \& spice://target.host.com:1234/?tlsPort=4567 .Ve .Sp Optional \fIlisten-address\fR sets the listen address that hypervisor on the destination side should bind to for incoming migration. Both IPv4 and IPv6 addresses are accepted as well as hostnames (the resolving is done on destination). Some hypervisors do not support this feature and will return an error if this parameter is used. .Sp Optional \fIdisks-port\fR sets the port that hypervisor on destination side should bind to for incoming disks traffic. Currently it is supported only by qemu. .RE .IP "\fBmigrate-setmaxdowntime\fR \fIdomain\fR \fIdowntime\fR" 4 .IX Item "migrate-setmaxdowntime domain downtime" Set maximum tolerable downtime for a domain which is being live-migrated to another host. The \fIdowntime\fR is a number of milliseconds the guest is allowed to be down at the end of live migration. .IP "\fBmigrate-compcache\fR \fIdomain\fR [\fI\-\-size\fR \fBbytes\fR]" 4 .IX Item "migrate-compcache domain [--size bytes]" Sets and/or gets size of the cache (in bytes) used for compressing repeatedly transferred memory pages during live migration. When called without \fIsize\fR, the command just prints current size of the compression cache. When \fIsize\fR is specified, the hypervisor is asked to change compression cache to \fIsize\fR bytes and then the current size is printed (the result may differ from the requested size due to rounding done by the hypervisor). The \fIsize\fR option is supposed to be used while the domain is being live-migrated as a reaction to migration progress and increasing number of compression cache misses obtained from domjobinfo. .IP "\fBmigrate-setspeed\fR \fIdomain\fR \fIbandwidth\fR" 4 .IX Item "migrate-setspeed domain bandwidth" Set the maximum migration bandwidth (in MiB/s) for a domain which is being migrated to another host. \fIbandwidth\fR is interpreted as an unsigned long long value. Specifying a negative value results in an essentially unlimited value being provided to the hypervisor. The hypervisor can choose whether to reject the value or convert it to the maximum value allowed. .IP "\fBmigrate-getspeed\fR \fIdomain\fR" 4 .IX Item "migrate-getspeed domain" Get the maximum migration bandwidth (in MiB/s) for a domain. .IP "\fBmigrate-postcopy\fR \fIdomain\fR" 4 .IX Item "migrate-postcopy domain" Switch the current migration from pre-copy to post-copy. This is only supported for a migration started with \fI\-\-postcopy\fR option. .IP "\fBnumatune\fR \fIdomain\fR [\fI\-\-mode\fR \fBmode\fR] [\fI\-\-nodeset\fR \fBnodeset\fR] [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "numatune domain [--mode mode] [--nodeset nodeset] [[--config] [--live] | [--current]]" Set or get a domain's numa parameters, corresponding to the element of domain \s-1XML. \s0 Without flags, the current settings are displayed. .Sp \&\fImode\fR can be one of `strict', `interleave' and `preferred' or any valid number from the virDomainNumatuneMemMode enum in case the daemon supports it. For a running domain, the mode can't be changed, and the nodeset can be changed only if the domain was started with a mode of `strict'. .Sp \&\fInodeset\fR is a list of numa nodes used by the host for running the domain. Its syntax is a comma separated list, with '\-' for ranges and '^' for excluding a node. .Sp If \fI\-\-live\fR is specified, set scheduler information of a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. .IP "\fBreboot\fR \fIdomain\fR [\fI\-\-mode MODE-LIST\fR]" 4 .IX Item "reboot domain [--mode MODE-LIST]" Reboot a domain. This acts just as if the domain had the \fBreboot\fR command run from the console. The command returns as soon as it has executed the reboot action, which may be significantly before the domain actually reboots. .Sp The exact behavior of a domain when it reboots is set by the \&\fIon_reboot\fR parameter in the domain's \s-1XML\s0 definition. .Sp By default the hypervisor will try to pick a suitable shutdown method. To specify an alternative method, the \fI\-\-mode\fR parameter can specify a comma separated list which includes \f(CW\*(C`acpi\*(C'\fR, \f(CW\*(C`agent\*(C'\fR, \&\f(CW\*(C`initctl\*(C'\fR, \f(CW\*(C`signal\*(C'\fR and \f(CW\*(C`paravirt\*(C'\fR. The order in which drivers will try each mode is undefined, and not related to the order specified to virsh. For strict control over ordering, use a single mode at a time and repeat the command. .IP "\fBreset\fR \fIdomain\fR" 4 .IX Item "reset domain" Reset a domain immediately without any guest shutdown. \fBreset\fR emulates the power reset button on a machine, where all guest hardware sees the \s-1RST\s0 line set and reinitializes internal state. .Sp \&\fBNote\fR: Reset without any guest \s-1OS\s0 shutdown risks data loss. .IP "\fBrestore\fR \fIstate-file\fR [\fI\-\-bypass\-cache\fR] [\fI\-\-xml\fR \fBfile\fR] [{\fI\-\-running\fR | \fI\-\-paused\fR}]" 4 .IX Item "restore state-file [--bypass-cache] [--xml file] [{--running | --paused}]" Restores a domain from a \fBvirsh save\fR state file. See \fIsave\fR for more info. .Sp If \fI\-\-bypass\-cache\fR is specified, the restore will avoid the file system cache, although this may slow down the operation. .Sp \&\fI\-\-xml\fR \fBfile\fR is usually omitted, but can be used to supply an alternative \s-1XML\s0 file for use on the restored guest with changes only in the host-specific portions of the domain \s-1XML. \s0 For example, it can be used to account for file naming differences in underlying storage due to disk snapshots taken after the guest was saved. .Sp Normally, restoring a saved image will use the state recorded in the save image to decide between running or paused; passing either the \&\fI\-\-running\fR or \fI\-\-paused\fR flag will allow overriding which state the domain should be started in. .Sp \&\fBNote\fR: To avoid corrupting file system contents within the domain, you should not reuse the saved state file for a second \fBrestore\fR unless you have also reverted all storage volumes back to the same contents as when the state file was created. .IP "\fBsave\fR \fIdomain\fR \fIstate-file\fR [\fI\-\-bypass\-cache\fR] [\fI\-\-xml\fR \fBfile\fR] [{\fI\-\-running\fR | \fI\-\-paused\fR}] [\fI\-\-verbose\fR]" 4 .IX Item "save domain state-file [--bypass-cache] [--xml file] [{--running | --paused}] [--verbose]" Saves a running domain (\s-1RAM,\s0 but not disk state) to a state file so that it can be restored later. Once saved, the domain will no longer be running on the system, thus the memory allocated for the domain will be free for other domains to use. \fBvirsh restore\fR restores from this state file. If \fI\-\-bypass\-cache\fR is specified, the save will avoid the file system cache, although this may slow down the operation. .Sp The progress may be monitored using \fBdomjobinfo\fR virsh command and canceled with \fBdomjobabort\fR command (sent by another virsh instance). Another option is to send \s-1SIGINT \s0(usually with \f(CW\*(C`Ctrl\-C\*(C'\fR) to the virsh process running \&\fBsave\fR command. \fI\-\-verbose\fR displays the progress of save. .Sp This is roughly equivalent to doing a hibernate on a running computer, with all the same limitations. Open network connections may be severed upon restore, as \s-1TCP\s0 timeouts may have expired. .Sp \&\fI\-\-xml\fR \fBfile\fR is usually omitted, but can be used to supply an alternative \s-1XML\s0 file for use on the restored guest with changes only in the host-specific portions of the domain \s-1XML. \s0 For example, it can be used to account for file naming differences that are planned to be made via disk snapshots of underlying storage after the guest is saved. .Sp Normally, restoring a saved image will decide between running or paused based on the state the domain was in when the save was done; passing either the \fI\-\-running\fR or \fI\-\-paused\fR flag will allow overriding which state the \fBrestore\fR should use. .Sp Domain saved state files assume that disk images will be unchanged between the creation and restore point. For a more complete system restore point, where the disk state is saved alongside the memory state, see the \fBsnapshot\fR family of commands. .IP "\fBsave-image-define\fR \fIfile\fR \fIxml\fR [{\fI\-\-running\fR | \fI\-\-paused\fR}]" 4 .IX Item "save-image-define file xml [{--running | --paused}]" Update the domain \s-1XML\s0 that will be used when \fIfile\fR is later used in the \fBrestore\fR command. The \fIxml\fR argument must be a file name containing the alternative \s-1XML,\s0 with changes only in the host-specific portions of the domain \s-1XML. \s0 For example, it can be used to account for file naming differences resulting from creating disk snapshots of underlying storage after the guest was saved. .Sp The save image records whether the domain should be restored to a running or paused state. Normally, this command does not alter the recorded state; passing either the \fI\-\-running\fR or \fI\-\-paused\fR flag will allow overriding which state the \fBrestore\fR should use. .IP "\fBsave-image-dumpxml\fR \fIfile\fR [\fI\-\-security\-info\fR]" 4 .IX Item "save-image-dumpxml file [--security-info]" Extract the domain \s-1XML\s0 that was in effect at the time the saved state file \fIfile\fR was created with the \fBsave\fR command. Using \&\fI\-\-security\-info\fR will also include security sensitive information. .IP "\fBsave-image-edit\fR \fIfile\fR [{\fI\-\-running\fR | \fI\-\-paused\fR}]" 4 .IX Item "save-image-edit file [{--running | --paused}]" Edit the \s-1XML\s0 configuration associated with a saved state file \fIfile\fR created by the \fBsave\fR command. .Sp The save image records whether the domain should be restored to a running or paused state. Normally, this command does not alter the recorded state; passing either the \fI\-\-running\fR or \fI\-\-paused\fR flag will allow overriding which state the \fBrestore\fR should use. .Sp This is equivalent to: .Sp .Vb 3 \& virsh save\-image\-dumpxml state\-file > state\-file.xml \& vi state\-file.xml (or make changes with your other text editor) \& virsh save\-image\-define state\-file state\-file\-xml .Ve .Sp except that it does some error checking. .Sp The editor used can be supplied by the \f(CW$VISUAL\fR or \f(CW$EDITOR\fR environment variables, and defaults to \f(CW\*(C`vi\*(C'\fR. .IP "\fBschedinfo\fR \fIdomain\fR [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]] [[\fI\-\-set\fR] \fBparameter=value\fR]..." 4 .IX Item "schedinfo domain [[--config] [--live] | [--current]] [[--set] parameter=value]..." .PD 0 .IP "\fBschedinfo\fR [\fI\-\-weight\fR \fBnumber\fR] [\fI\-\-cap\fR \fBnumber\fR] \fIdomain\fR" 4 .IX Item "schedinfo [--weight number] [--cap number] domain" .PD Allows you to show (and set) the domain scheduler parameters. The parameters available for each hypervisor are: .Sp \&\s-1LXC \s0(posix scheduler) : cpu_shares, vcpu_period, vcpu_quota .Sp \&\s-1QEMU/KVM \s0(posix scheduler): cpu_shares, vcpu_period, vcpu_quota, emulator_period, emulator_quota, iothread_quota, iothread_period .Sp Xen (credit scheduler): weight, cap .Sp \&\s-1ESX \s0(allocation scheduler): reservation, limit, shares .Sp If \fI\-\-live\fR is specified, set scheduler information of a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. .Sp \&\fBNote\fR: The cpu_shares parameter has a valid value range of 0\-262144; Negative values are wrapped to positive, and larger values are capped at the maximum. Therefore, \-1 is a useful shorthand for 262144. On the Linux kernel, the values 0 and 1 are automatically converted to a minimal value of 2. .Sp \&\fBNote\fR: The weight and cap parameters are defined only for the \&\s-1XEN_CREDIT\s0 scheduler. .Sp \&\fBNote\fR: The vcpu_period, emulator_period, and iothread_period parameters have a valid value range of 1000\-1000000 or 0, and the vcpu_quota, emulator_quota, and iothread_quota parameters have a valid value range of 1000\-18446744073709551 or less than 0. The value 0 for either parameter is the same as not specifying that parameter. .IP "\fBscreenshot\fR \fIdomain\fR [\fIimagefilepath\fR] [\fI\-\-screen\fR \fBscreenID\fR]" 4 .IX Item "screenshot domain [imagefilepath] [--screen screenID]" Takes a screenshot of a current domain console and stores it into a file. Optionally, if hypervisor supports more displays for a domain, \fIscreenID\fR allows to specify which screen will be captured. It is the sequential number of screen. In case of multiple graphics cards, heads are enumerated before devices, e.g. having two graphics cards, both with four heads, screen \s-1ID 5\s0 addresses the second head on the second card. .IP "\fBsend-key\fR \fIdomain\fR [\fI\-\-codeset\fR \fBcodeset\fR] [\fI\-\-holdtime\fR \fBholdtime\fR] \fIkeycode\fR..." 4 .IX Item "send-key domain [--codeset codeset] [--holdtime holdtime] keycode..." Parse the \fIkeycode\fR sequence as keystrokes to send to \fIdomain\fR. Each \fIkeycode\fR can either be a numeric value or a symbolic name from the corresponding codeset. If \fI\-\-holdtime\fR is given, each keystroke will be held for that many milliseconds. The default codeset is \&\fBlinux\fR, but use of the \fI\-\-codeset\fR option allows other codesets to be chosen. .Sp If multiple keycodes are specified, they are all sent simultaneously to the guest, and they may be received in random order. If you need distinct keypresses, you must use multiple send-key invocations. .RS 4 .IP "\fBlinux\fR" 4 .IX Item "linux" The numeric values are those defined by the Linux generic input event subsystem. The symbolic names match the corresponding Linux key constant macro names. .IP "\fBxt\fR" 4 .IX Item "xt" The numeric values are those defined by the original \s-1XT\s0 keyboard controller. No symbolic names are provided .IP "\fBatset1\fR" 4 .IX Item "atset1" The numeric values are those defined by the \s-1AT\s0 keyboard controller, set 1 (aka \s-1XT\s0 compatible set). Extended keycoes from \fBatset1\fR may differ from extended keycodes in the \fBxt\fR codeset. No symbolic names are provided .IP "\fBatset2\fR" 4 .IX Item "atset2" The numeric values are those defined by the \s-1AT\s0 keyboard controller, set 2. No symbolic names are provided .IP "\fBatset3\fR" 4 .IX Item "atset3" The numeric values are those defined by the \s-1AT\s0 keyboard controller, set 3 (aka \s-1PS/2\s0 compatible set). No symbolic names are provided .IP "\fBos_x\fR" 4 .IX Item "os_x" The numeric values are those defined by the OS-X keyboard input subsystem. The symbolic names match the corresponding OS-X key constant macro names .IP "\fBxt_kbd\fR" 4 .IX Item "xt_kbd" The numeric values are those defined by the Linux \s-1KBD\s0 device. These are a variant on the original \s-1XT\s0 codeset, but often with different encoding for extended keycodes. No symbolic names are provided. .IP "\fBwin32\fR" 4 .IX Item "win32" The numeric values are those defined by the Win32 keyboard input subsystem. The symbolic names match the corresponding Win32 key constant macro names .IP "\fBusb\fR" 4 .IX Item "usb" The numeric values are those defined by the \s-1USB HID\s0 specification for keyboard input. No symbolic names are provided .IP "\fBrfb\fR" 4 .IX Item "rfb" The numeric values are those defined by the \s-1RFB\s0 extension for sending raw keycodes. These are a variant on the \s-1XT\s0 codeset, but extended keycodes have the low bit of the second byte set, instead of the high bit of the first byte. No symbolic names are provided. .RE .RS 4 .Sp \&\fBExamples\fR # send three strokes 'k', 'e', 'y', using xt codeset. these # are all pressed simultaneously and may be received by the guest # in random order virsh send-key dom \-\-codeset xt 37 18 21 .Sp .Vb 2 \& # send one stroke \*(Aqright\-ctrl+C\*(Aq \& virsh send\-key dom KEY_RIGHTCTRL KEY_C \& \& # send a tab, held for 1 second \& virsh send\-key \-\-holdtime 1000 0xf .Ve .RE .IP "\fBsend-process-signal\fR \fIdomain-id\fR \fIpid\fR \fIsigname\fR" 4 .IX Item "send-process-signal domain-id pid signame" Send a signal \fIsigname\fR to the process identified by \fIpid\fR running in the virtual domain \fIdomain-id\fR. The \fIpid\fR is a process \s-1ID\s0 in the virtual domain namespace. .Sp The \fIsigname\fR argument may be either an integer signal constant number, or one of the symbolic names: .Sp .Vb 12 \& "nop", "hup", "int", "quit", "ill", \& "trap", "abrt", "bus", "fpe", "kill", \& "usr1", "segv", "usr2", "pipe", "alrm", \& "term", "stkflt", "chld", "cont", "stop", \& "tstp", "ttin", "ttou", "urg", "xcpu", \& "xfsz", "vtalrm", "prof", "winch", "poll", \& "pwr", "sys", "rt0", "rt1", "rt2", "rt3", \& "rt4", "rt5", "rt6", "rt7", "rt8", "rt9", \& "rt10", "rt11", "rt12", "rt13", "rt14", "rt15", \& "rt16", "rt17", "rt18", "rt19", "rt20", "rt21", \& "rt22", "rt23", "rt24", "rt25", "rt26", "rt27", \& "rt28", "rt29", "rt30", "rt31", "rt32" .Ve .Sp The symbol name may optionally be prefixed with 'sig' or 'sig_' and may be in uppercase or lowercase. .Sp \&\fBExamples\fR virsh send-process-signal myguest 1 15 virsh send-process-signal myguest 1 term virsh send-process-signal myguest 1 sigterm virsh send-process-signal myguest 1 \s-1SIG_HUP\s0 .IP "\fBsetmem\fR \fIdomain\fR \fBsize\fR [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "setmem domain size [[--config] [--live] | [--current]]" Change the memory allocation for a guest domain. If \fI\-\-live\fR is specified, perform a memory balloon of a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .Sp \&\fIsize\fR is a scaled integer (see \fB\s-1NOTES\s0\fR above); it defaults to kibibytes (blocks of 1024 bytes) unless you provide a suffix (and the older option name \fI\-\-kilobytes\fR is available as a deprecated synonym) . Libvirt rounds up to the nearest kibibyte. Some hypervisors require a larger granularity than KiB, and requests that are not an even multiple will be rounded up. For example, vSphere/ESX rounds the parameter up to mebibytes (1024 kibibytes). .Sp For Xen, you can only adjust the memory of a running domain if the domain is paravirtualized or running the \s-1PV\s0 balloon driver. .Sp For \s-1LXC,\s0 the value being set is the cgroups value for limit_in_bytes or the maximum amount of user memory (including file cache). When viewing memory inside the container, this is the /proc/meminfo \*(L"MemTotal\*(R" value. When viewing the value from the host, use the \fBvirsh memtune\fR command. In order to view the current memory in use and the maximum value allowed to set memory, use the \fBvirsh dominfo\fR command. .IP "\fBset-user-password\fR \fIdomain\fR \fIuser\fR \fIpassword\fR [\fI\-\-encrypted\fR]" 4 .IX Item "set-user-password domain user password [--encrypted]" Set the password for the \fIuser\fR account in the guest domain. .Sp If \fI\-\-encrypted\fR is specified, the password is assumed to be already encrypted by the method required by the guest \s-1OS.\s0 .Sp For \s-1QEMU/KVM,\s0 this requires the guest agent to be configured and running. .IP "\fBsetmaxmem\fR \fIdomain\fR \fBsize\fR [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "setmaxmem domain size [[--config] [--live] | [--current]]" Change the maximum memory allocation limit for a guest domain. If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .Sp Some hypervisors such as \s-1QEMU/KVM\s0 don't support live changes (especially increasing) of the maximum memory limit. Even persistent configuration changes might not be performed with some hypervisors/configuration (e.g. on \s-1NUMA\s0 enabled domains on \s-1QEMU\s0). For complex configuration changes use command \fBedit\fR instead). .Sp \&\fIsize\fR is a scaled integer (see \fB\s-1NOTES\s0\fR above); it defaults to kibibytes (blocks of 1024 bytes) unless you provide a suffix (and the older option name \fI\-\-kilobytes\fR is available as a deprecated synonym) . Libvirt rounds up to the nearest kibibyte. Some hypervisors require a larger granularity than KiB, and requests that are not an even multiple will be rounded up. For example, vSphere/ESX rounds the parameter up to mebibytes (1024 kibibytes). .IP "\fBmemtune\fR \fIdomain\fR [\fI\-\-hard\-limit\fR \fBsize\fR] [\fI\-\-soft\-limit\fR \fBsize\fR] [\fI\-\-swap\-hard\-limit\fR \fBsize\fR] [\fI\-\-min\-guarantee\fR \fBsize\fR] [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "memtune domain [--hard-limit size] [--soft-limit size] [--swap-hard-limit size] [--min-guarantee size] [[--config] [--live] | [--current]]" Allows you to display or set the domain memory parameters. Without flags, the current settings are displayed; with a flag, the appropriate limit is adjusted if supported by the hypervisor. \s-1LXC\s0 and \&\s-1QEMU/KVM\s0 support \fI\-\-hard\-limit\fR, \fI\-\-soft\-limit\fR, and \fI\-\-swap\-hard\-limit\fR. \&\fI\-\-min\-guarantee\fR is supported only by \s-1ESX\s0 hypervisor. Each of these limits are scaled integers (see \fB\s-1NOTES\s0\fR above), with a default of kibibytes (blocks of 1024 bytes) if no suffix is present. Libvirt rounds up to the nearest kibibyte. Some hypervisors require a larger granularity than KiB, and requests that are not an even multiple will be rounded up. For example, vSphere/ESX rounds the parameter up to mebibytes (1024 kibibytes). .Sp If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .Sp For \s-1QEMU/KVM,\s0 the parameters are applied to the \s-1QEMU\s0 process as a whole. Thus, when counting them, one needs to add up guest \s-1RAM,\s0 guest video \s-1RAM,\s0 and some memory overhead of \s-1QEMU\s0 itself. The last piece is hard to determine so one needs guess and try. .Sp For \s-1LXC,\s0 the displayed hard_limit value is the current memory setting from the \s-1XML\s0 or the results from a \fBvirsh setmem\fR command. .RS 4 .IP "\fI\-\-hard\-limit\fR" 4 .IX Item "--hard-limit" The maximum memory the guest can use. .IP "\fI\-\-soft\-limit\fR" 4 .IX Item "--soft-limit" The memory limit to enforce during memory contention. .IP "\fI\-\-swap\-hard\-limit\fR" 4 .IX Item "--swap-hard-limit" The maximum memory plus swap the guest can use. This has to be more than hard-limit value provided. .IP "\fI\-\-min\-guarantee\fR" 4 .IX Item "--min-guarantee" The guaranteed minimum memory allocation for the guest. .RE .RS 4 .Sp Specifying \-1 as a value for these limits is interpreted as unlimited. .RE .IP "\fBperf\fR \fIdomain\fR [\fI\-\-enable\fR \fBeventSpec\fR] [\fI\-\-disable\fR \fBeventSpec\fR] [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "perf domain [--enable eventSpec] [--disable eventSpec] [[--config] [--live] | [--current]]" Get the current perf events setting or enable/disable specific perf events for a guest domain. .Sp Perf is a performance analyzing tool in Linux, and it can instrument \&\s-1CPU\s0 performance counters, tracepoints, kprobes, and uprobes (dynamic tracing). Perf supports a list of measurable events, and can measure events coming from different sources. For instance, some event are pure kernel counters, in this case they are called software events, including context-switches, minor-faults, etc.. Now dozens of events from different sources can be supported by perf. .Sp Currently only \s-1QEMU/KVM\s0 supports this command. The \fI\-\-enable\fR and \fI\-\-disable\fR option combined with \fBeventSpec\fR can be used to enable or disable specific performance event. \fBeventSpec\fR is a string list of one or more events separated by commas. Valid event names are as follows: .Sp \&\fBValid perf event names\fR cmt \- A PQos (Platform Qos) feature to monitor the usage of cache by applications running on the platform. mbmt \- Provides a way to monitor the total system memory bandwidth between one level of cache and another. mbml \- Provides a way to limit the amount of data (bytes/s) send through the memory controller on the socket. cache_misses \- Provides the count of cache misses by applications running on the platform. cache_references \- Provides the count of cache hits by applications running on th e platform. instructions \- Provides the count of instructions executed by applications running on the platform. cpu_cycles \- Provides the count of cpu cycles (total/elapsed). May be used with instructions in order to get a cycles per instruction. branch_instructions \- Provides the count of branch instructions executed by applications running on the platform. branch_misses \- Provides the count of branch misses executed by applications running on the platform. bus_cycles \- Provides the count of bus cycles executed by applications running on the platform. stalled_cycles_frontend \- Provides the count of stalled cpu cycles in the frontend of the instruction processor pipeline by applications running on the platform. stalled_cycles_backend \- Provides the count of stalled cpu cycles in the backend of the instruction processor pipeline by applications running on the platform. ref_cpu_cycles \- Provides the count of total cpu cycles not affected by \s-1CPU\s0 frequency scaling by applications running on the platform. .Sp \&\fBNote\fR: The statistics can be retrieved using the \fBdomstats\fR command using the \fI\-\-perf\fR flag. .Sp If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .IP "\fBblkiotune\fR \fIdomain\fR [\fI\-\-weight\fR \fBweight\fR] [\fI\-\-device\-weights\fR \fBdevice-weights\fR] [\fI\-\-device\-read\-iops\-sec\fR \fBdevice-read-iops-sec\fR] [\fI\-\-device\-write\-iops\-sec\fR \fBdevice-write-iops-sec\fR] [\fI\-\-device\-read\-bytes\-sec\fR \fBdevice-read-bytes-sec\fR] [\fI\-\-device\-write\-bytes\-sec\fR \fBdevice-write-bytes-sec\fR] [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]]" 4 .IX Item "blkiotune domain [--weight weight] [--device-weights device-weights] [--device-read-iops-sec device-read-iops-sec] [--device-write-iops-sec device-write-iops-sec] [--device-read-bytes-sec device-read-bytes-sec] [--device-write-bytes-sec device-write-bytes-sec] [[--config] [--live] | [--current]]" Display or set the blkio parameters. \s-1QEMU/KVM\s0 supports \fI\-\-weight\fR. \&\fI\-\-weight\fR is in range [100, 1000]. After kernel 2.6.39, the value could be in the range [10, 1000]. .Sp \&\fBdevice-weights\fR is a single string listing one or more device/weight pairs, in the format of /path/to/device,weight,/path/to/device,weight. Each weight is in the range [100, 1000], [10, 1000] after kernel 2.6.39, or the value 0 to remove that device from per-device listings. Only the devices listed in the string are modified; any existing per-device weights for other devices remain unchanged. .Sp \&\fBdevice-read-iops-sec\fR is a single string listing one or more device/read_iops_sec pairs, int the format of /path/to/device,read_iops_sec,/path/to/device,read_iops_sec. Each read_iops_sec is a number which type is unsigned int, value 0 to remove that device from per-device listing. Only the devices listed in the string are modified; any existing per-device read_iops_sec for other devices remain unchanged. .Sp \&\fBdevice-write-iops-sec\fR is a single string listing one or more device/write_iops_sec pairs, int the format of /path/to/device,write_iops_sec,/path/to/device,write_iops_sec. Each write_iops_sec is a number which type is unsigned int, value 0 to remove that device from per-device listing. Only the devices listed in the string are modified; any existing per-device write_iops_sec for other devices remain unchanged. .Sp \&\fBdevice-read-bytes-sec\fR is a single string listing one or more device/read_bytes_sec pairs, int the format of /path/to/device,read_bytes_sec,/path/to/device,read_bytes_sec. Each read_bytes_sec is a number which type is unsigned long long, value 0 to remove that device from per-device listing. Only the devices listed in the string are modified; any existing per-device read_bytes_sec for other devices remain unchanged. .Sp \&\fBdevice-write-bytes-sec\fR is a single string listing one or more device/write_bytes_sec pairs, int the format of /path/to/device,write_bytes_sec,/path/to/device,write_bytes_sec. Each write_bytes_sec is a number which type is unsigned long long, value 0 to remove that device from per-device listing. Only the devices listed in the string are modified; any existing per-device write_bytes_sec for other devices remain unchanged. .Sp If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .IP "\fBsetvcpus\fR \fIdomain\fR \fIcount\fR [\fI\-\-maximum\fR] [[\fI\-\-config\fR] [\fI\-\-live\fR] | [\fI\-\-current\fR]] [\fI\-\-guest\fR] [\fI\-\-hotpluggable\fR]" 4 .IX Item "setvcpus domain count [--maximum] [[--config] [--live] | [--current]] [--guest] [--hotpluggable]" Change the number of virtual CPUs active in a guest domain. By default, this command works on active guest domains. To change the settings for an inactive guest domain, use the \fI\-\-config\fR flag. .Sp The \fIcount\fR value may be limited by host, hypervisor, or a limit coming from the original description of the guest domain. For Xen, you can only adjust the virtual CPUs of a running domain if the domain is paravirtualized. .Sp If the \fI\-\-config\fR flag is specified, the change is made to the stored \s-1XML\s0 configuration for the guest domain, and will only take effect when the guest domain is next started. .Sp If \fI\-\-live\fR is specified, the guest domain must be active, and the change takes place immediately. Both the \fI\-\-config\fR and \fI\-\-live\fR flags may be specified together if supported by the hypervisor. If this command is run before the guest has finished booting, the guest may fail to process the change. .Sp If \fI\-\-current\fR is specified, affect the current guest state. .Sp When no flags are given, the \fI\-\-live\fR flag is assumed and the guest domain must be active. In this situation it is up to the hypervisor whether the \fI\-\-config\fR flag is also assumed, and therefore whether the \s-1XML\s0 configuration is adjusted to make the change persistent. .Sp If \fI\-\-guest\fR is specified, then the count of cpus is modified in the guest instead of the hypervisor. This flag is usable only for live domains and may require guest agent to be configured in the guest. .Sp To allow adding vcpus to persistent definitions that can be later hotunplugged after the domain is booted it is necessary to specify the \fI\-\-hotpluggable\fR flag. Vcpus added to live domains supporting vcpu unplug are automatically marked as hotpluggable. .Sp The \fI\-\-maximum\fR flag controls the maximum number of virtual cpus that can be hot-plugged the next time the domain is booted. As such, it must only be used with the \fI\-\-config\fR flag, and not with the \fI\-\-live\fR or the \fI\-\-current\fR flag. .IP "\fBshutdown\fR \fIdomain\fR [\fI\-\-mode MODE-LIST\fR]" 4 .IX Item "shutdown domain [--mode MODE-LIST]" Gracefully shuts down a domain. This coordinates with the domain \s-1OS\s0 to perform graceful shutdown, so there is no guarantee that it will succeed, and may take a variable length of time depending on what services must be shutdown in the domain. .Sp The exact behavior of a domain when it shuts down is set by the \&\fIon_poweroff\fR parameter in the domain's \s-1XML\s0 definition. .Sp If \fIdomain\fR is transient, then the metadata of any snapshots will be lost once the guest stops running, but the snapshot contents still exist, and a new domain with the same name and \s-1UUID\s0 can restore the snapshot metadata with \fBsnapshot-create\fR. .Sp By default the hypervisor will try to pick a suitable shutdown method. To specify an alternative method, the \fI\-\-mode\fR parameter can specify a comma separated list which includes \f(CW\*(C`acpi\*(C'\fR, \f(CW\*(C`agent\*(C'\fR, \&\f(CW\*(C`initctl\*(C'\fR, \f(CW\*(C`signal\*(C'\fR and \f(CW\*(C`paravirt\*(C'\fR. The order in which drivers will try each mode is undefined, and not related to the order specified to virsh. For strict control over ordering, use a single mode at a time and repeat the command. .IP "\fBstart\fR \fIdomain-name-or-uuid\fR [\fI\-\-console\fR] [\fI\-\-paused\fR] [\fI\-\-autodestroy\fR] [\fI\-\-bypass\-cache\fR] [\fI\-\-force\-boot\fR] [\fI\-\-pass\-fds N,M,...\fR]" 4 .IX Item "start domain-name-or-uuid [--console] [--paused] [--autodestroy] [--bypass-cache] [--force-boot] [--pass-fds N,M,...]" Start a (previously defined) inactive domain, either from the last \&\fBmanagedsave\fR state, or via a fresh boot if no managedsave state is present. The domain will be paused if the \fI\-\-paused\fR option is used and supported by the driver; otherwise it will be running. If \fI\-\-console\fR is requested, attach to the console after creation. If \fI\-\-autodestroy\fR is requested, then the guest will be automatically destroyed when virsh closes its connection to libvirt, or otherwise exits. If \fI\-\-bypass\-cache\fR is specified, and managedsave state exists, the restore will avoid the file system cache, although this may slow down the operation. If \fI\-\-force\-boot\fR is specified, then any managedsave state is discarded and a fresh boot occurs. .Sp If \fI\-\-pass\-fds\fR is specified, the argument is a comma separated list of open file descriptors which should be pass on into the guest. The file descriptors will be re-numbered in the guest, starting from 3. This is only supported with container based virtualization. .IP "\fBsuspend\fR \fIdomain\fR" 4 .IX Item "suspend domain" Suspend a running domain. It is kept in memory but won't be scheduled anymore. .IP "\fBresume\fR \fIdomain\fR" 4 .IX Item "resume domain" Moves a domain out of the suspended state. This will allow a previously suspended domain to now be eligible for scheduling by the underlying hypervisor. .IP "\fBdompmsuspend\fR \fIdomain\fR \fItarget\fR [\fI\-\-duration\fR]" 4 .IX Item "dompmsuspend domain target [--duration]" Suspend a running domain into one of these states (possible \fItarget\fR values): mem equivalent of S3 \s-1ACPI\s0 state disk equivalent of S4 \s-1ACPI\s0 state hybrid \s-1RAM\s0 is saved to disk but not powered off .Sp The \fI\-\-duration\fR argument specifies number of seconds before the domain is woken up after it was suspended (see also \fBdompmwakeup\fR). Default is 0 for unlimited suspend time. (This feature isn't currently supported by any hypervisor driver and 0 should be used.). .Sp Note that this command requires a guest agent configured and running in the domain's guest \s-1OS.\s0 .Sp Beware that at least for \s-1QEMU,\s0 the domain's process will be terminated when target disk is used and a new process will be launched when libvirt is asked to wake up the domain. As a result of this, any runtime changes, such as device hotplug or memory settings, are lost unless such changes were made with \fI\-\-config\fR flag. .IP "\fBdompmwakeup\fR \fIdomain\fR" 4 .IX Item "dompmwakeup domain" Wakeup a domain from pmsuspended state (either suspended by dompmsuspend or from the guest itself). Injects a wakeup into the guest that is in pmsuspended state, rather than waiting for the previously requested duration (if any) to elapse. This operation doesn't not necessarily fail if the domain is running. .IP "\fBttyconsole\fR \fIdomain\fR" 4 .IX Item "ttyconsole domain" Output the device used for the \s-1TTY\s0 console of the domain. If the information is not available the processes will provide an exit code of 1. .IP "\fBundefine\fR \fIdomain\fR [\fI\-\-managed\-save\fR] [\fI\-\-snapshots\-metadata\fR] [\fI\-\-nvram\fR] [\fI\-\-keep\-nvram\fR] [ {\fI\-\-storage\fR \fBvolumes\fR | \fI\-\-remove\-all\-storage\fR [\fI\-\-delete\-snapshots\fR]} \fI\-\-wipe\-storage\fR]" 4 .IX Item "undefine domain [--managed-save] [--snapshots-metadata] [--nvram] [--keep-nvram] [ {--storage volumes | --remove-all-storage [--delete-snapshots]} --wipe-storage]" Undefine a domain. If the domain is running, this converts it to a transient domain, without stopping it. If the domain is inactive, the domain configuration is removed. .Sp The \fI\-\-managed\-save\fR flag guarantees that any managed save image (see the \fBmanagedsave\fR command) is also cleaned up. Without the flag, attempts to undefine a domain with a managed save image will fail. .Sp The \fI\-\-snapshots\-metadata\fR flag guarantees that any snapshots (see the \&\fBsnapshot-list\fR command) are also cleaned up when undefining an inactive domain. Without the flag, attempts to undefine an inactive domain with snapshot metadata will fail. If the domain is active, this flag is ignored. .Sp \&\fI\-\-nvram\fR and \fI\-\-keep\-nvram\fR specify accordingly to delete or keep nvram (/domain/os/nvram/) file. If the domain has an nvram file and the flags are omitted, the undefine will fail. .Sp The \fI\-\-storage\fR flag takes a parameter \fBvolumes\fR, which is a comma separated list of volume target names or source paths of storage volumes to be removed along with the undefined domain. Volumes can be undefined and thus removed only on inactive domains. Volume deletion is only attempted after the domain is undefined; if not all of the requested volumes could be deleted, the error message indicates what still remains behind. If a volume path is not found in the domain definition, it's treated as if the volume was successfully deleted. Only volumes managed by libvirt in storage pools can be removed this way. (See \fBdomblklist\fR for list of target names associated to a domain). Example: \-\-storage vda,/path/to/storage.img .Sp The \fI\-\-remove\-all\-storage\fR flag specifies that all of the domain's storage volumes should be deleted. .Sp The \fI\-\-delete\-snapshots\fR flag specifies that any snapshots associated with the storage volume should be deleted as well. Requires the \&\fI\-\-remove\-all\-storage\fR flag to be provided. Not all storage drivers support this option, presently only rbd. .Sp The flag \fI\-\-wipe\-storage\fR specifies that the storage volumes should be wiped before removal. .Sp \&\s-1NOTE:\s0 For an inactive domain, the domain name or \s-1UUID\s0 must be used as the \&\fIdomain\fR. .IP "\fBvcpucount\fR \fIdomain\fR [{\fI\-\-maximum\fR | \fI\-\-active\fR} {\fI\-\-config\fR | \fI\-\-live\fR | \fI\-\-current\fR}] [\fI\-\-guest\fR]" 4 .IX Item "vcpucount domain [{--maximum | --active} {--config | --live | --current}] [--guest]" Print information about the virtual cpu counts of the given \&\fIdomain\fR. If no flags are specified, all possible counts are listed in a table; otherwise, the output is limited to just the numeric value requested. For historical reasons, the table lists the label \*(L"current\*(R" on the rows that can be queried in isolation via the \fI\-\-active\fR flag, rather than relating to the \fI\-\-current\fR flag. .Sp \&\fI\-\-maximum\fR requests information on the maximum cap of vcpus that a domain can add via \fBsetvcpus\fR, while \fI\-\-active\fR shows the current usage; these two flags cannot both be specified. \fI\-\-config\fR requires a persistent domain and requests information regarding the next time the domain will be booted, \fI\-\-live\fR requires a running domain and lists current values, and \fI\-\-current\fR queries according to the current state of the domain (corresponding to \fI\-\-live\fR if running, or \&\fI\-\-config\fR if inactive); these three flags are mutually exclusive. .Sp If \fI\-\-guest\fR is specified, then the count of cpus is reported from the perspective of the guest. This flag is usable only for live domains and may require guest agent to be configured in the guest. .IP "\fBvcpuinfo\fR \fIdomain\fR [\fI\-\-pretty\fR]" 4 .IX Item "vcpuinfo domain [--pretty]" Returns basic information about the domain virtual CPUs, like the number of vCPUs, the running time, the affinity to physical processors. .Sp With \fI\-\-pretty\fR, cpu affinities are shown as ranges. .Sp An example output is .Sp .Vb 6 \& $ virsh vcpuinfo fedora \& VCPU: 0 \& CPU: 0 \& State: running \& CPU time: 7,0s \& CPU Affinity: yyyy \& \& VCPU: 1 \& CPU: 1 \& State: running \& CPU time: 0,7s \& CPU Affinity: yyyy .Ve .Sp \&\fB\s-1STATES\s0\fR .Sp The State field displays the current operating state of a virtual \s-1CPU\s0 .RS 4 .IP "\fBoffline\fR" 4 .IX Item "offline" The virtual \s-1CPU\s0 is offline and not usable by the domain. This state is not supported by all hypervisors. .IP "\fBrunning\fR" 4 .IX Item "running" The virtual \s-1CPU\s0 is available to the domain and is operating. .IP "\fBblocked\fR" 4 .IX Item "blocked" The virtual \s-1CPU\s0 is available to the domain but is waiting for a resource. This state is not supported by all hypervisors, in which case \fIrunning\fR may be reported instead. .IP "\fBno state\fR" 4 .IX Item "no state" The virtual \s-1CPU\s0 state could not be determined. This could happen if the hypervisor is newer than virsh. .IP "\fBN/A\fR" 4 .IX Item "N/A" There's no information about the virtual \s-1CPU\s0 state available. This can be the case if the domain is not running or the hypervisor does not report the virtual \s-1CPU\s0 state. .RE .RS 4 .RE .IP "\fBvcpupin\fR \fIdomain\fR [\fIvcpu\fR] [\fIcpulist\fR] [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]]" 4 .IX Item "vcpupin domain [vcpu] [cpulist] [[--live] [--config] | [--current]]" Query or change the pinning of domain VCPUs to host physical CPUs. To pin a single \fIvcpu\fR, specify \fIcpulist\fR; otherwise, you can query one \&\fIvcpu\fR or omit \fIvcpu\fR to list all at once. .Sp \&\fIcpulist\fR is a list of physical \s-1CPU\s0 numbers. Its syntax is a comma separated list and a special markup using '\-' and '^' (ex. '0\-4', '0\-3,^2') can also be allowed. The '\-' denotes the range and the '^' denotes exclusive. For pinning the \fIvcpu\fR to all physical cpus specify 'r' as a \fIcpulist\fR. If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given if \fIcpulist\fR is present, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .Sp \&\fBNote\fR: The expression is sequentially evaluated, so \*(L"0\-15,^8\*(R" is identical to \*(L"9\-14,0\-7,15\*(R" but not identical to \*(L"^8,0\-15\*(R". .IP "\fBemulatorpin\fR \fIdomain\fR [\fIcpulist\fR] [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]]" 4 .IX Item "emulatorpin domain [cpulist] [[--live] [--config] | [--current]]" Query or change the pinning of domain's emulator threads to host physical CPUs. .Sp See \fBvcpupin\fR for \fIcpulist\fR. .Sp If \fI\-\-live\fR is specified, affect a running guest. If \fI\-\-config\fR is specified, affect the next boot of a persistent guest. If \fI\-\-current\fR is specified, affect the current guest state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given if \fIcpulist\fR is present, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. .IP "\fBguestvcpus\fR \fIdomain\fR [[\fI\-\-enable\fR] | [\fI\-\-disable\fR]] [\fIcpulist\fR]" 4 .IX Item "guestvcpus domain [[--enable] | [--disable]] [cpulist]" Query or change state of vCPUs from guest's point of view using the guest agent. When invoked without \fIcpulist\fR the guest is queried for available guest vCPUs, their state and possibility to be offlined. .Sp If \fIcpulist\fR is provided then one of \fI\-\-enable\fR or \fI\-\-disable\fR must be provided too. The desired operation is then executed on the domain. .Sp See \fBvcpupin\fR for information on \fIcpulist\fR. .IP "\fBvncdisplay\fR \fIdomain\fR" 4 .IX Item "vncdisplay domain" Output the \s-1IP\s0 address and port number for the \s-1VNC\s0 display. If the information is not available the processes will provide an exit code of 1. .SH "DEVICE COMMANDS" .IX Header "DEVICE COMMANDS" The following commands manipulate devices associated to domains. The \fIdomain\fR can be specified as a short integer, a name or a full \s-1UUID.\s0 To better understand the values allowed as options for the command reading the documentation at on the format of the device sections to get the most accurate set of accepted values. .IP "\fBattach-device\fR \fIdomain\fR \fI\s-1FILE\s0\fR [[[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] | [\fI\-\-persistent\fR]]" 4 .IX Item "attach-device domain FILE [[[--live] [--config] | [--current]] | [--persistent]]" Attach a device to the domain, using a device definition in an \s-1XML\s0 file using a device definition element such as or as the top-level element. See the documentation at to learn about libvirt \s-1XML\s0 format for a device. If \fI\-\-config\fR is specified the command alters the persistent domain configuration with the device attach taking effect the next time libvirt starts the domain. For cdrom and floppy devices, this command only replaces the media within an existing device; consider using \fBupdate-device\fR for this usage. For passthrough host devices, see also \fBnodedev-detach\fR, needed if the \s-1PCI\s0 device does not use managed mode. .Sp If \fI\-\-live\fR is specified, affect a running domain. If \fI\-\-config\fR is specified, affect the next startup of a persistent domain. If \fI\-\-current\fR is specified, affect the current domain state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. When no flag is specified legacy \s-1API\s0 is used whose behavior depends on the hypervisor driver. .Sp For compatibility purposes, \fI\-\-persistent\fR behaves like \fI\-\-config\fR for an offline domain, and like \fI\-\-live\fR \fI\-\-config\fR for a running domain. .Sp \&\fBNote\fR: using of partial device definition \s-1XML\s0 files may lead to unexpected results as some fields may be autogenerated and thus match devices other than expected. .IP "\fBattach-disk\fR \fIdomain\fR \fIsource\fR \fItarget\fR [[[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] | [\fI\-\-persistent\fR]] [\fI\-\-targetbus bus\fR] [\fI\-\-driver driver\fR] [\fI\-\-subdriver subdriver\fR] [\fI\-\-iothread iothread\fR] [\fI\-\-cache cache\fR] [\fI\-\-type type\fR] [\fI\-\-mode mode\fR] [\fI\-\-sourcetype sourcetype\fR] [\fI\-\-serial serial\fR] [\fI\-\-wwn wwn\fR] [\fI\-\-rawio\fR] [\fI\-\-address address\fR] [\fI\-\-multifunction\fR] [\fI\-\-print\-xml\fR]" 4 .IX Item "attach-disk domain source target [[[--live] [--config] | [--current]] | [--persistent]] [--targetbus bus] [--driver driver] [--subdriver subdriver] [--iothread iothread] [--cache cache] [--type type] [--mode mode] [--sourcetype sourcetype] [--serial serial] [--wwn wwn] [--rawio] [--address address] [--multifunction] [--print-xml]" Attach a new disk device to the domain. \&\fIsource\fR is path for the files and devices. \fItarget\fR controls the bus or device under which the disk is exposed to the guest \s-1OS.\s0 It indicates the \&\*(L"logical\*(R" device name; the optional \fItargetbus\fR attribute specifies the type of disk device to emulate; possible values are driver specific, with typical values being \fIide\fR, \fIscsi\fR, \fIvirtio\fR, \fIxen\fR, \fIusb\fR, \fIsata\fR, or \fIsd\fR, if omitted, the bus type is inferred from the style of the device name (e.g. a device named 'sda' will typically be exported using a \s-1SCSI\s0 bus). \fIdriver\fR can be \fIfile\fR, \fItap\fR or \fIphy\fR for the Xen hypervisor depending on the kind of access; or \fIqemu\fR for the \s-1QEMU\s0 emulator. Further details to the driver can be passed using \fIsubdriver\fR. For Xen \&\fIsubdriver\fR can be \fIaio\fR, while for \s-1QEMU\s0 subdriver should match the format of the disk source, such as \fIraw\fR or \fIqcow2\fR. Hypervisor default will be used if \fIsubdriver\fR is not specified. However, the default may not be correct, esp. for \s-1QEMU\s0 as for security reasons it is configured not to detect disk formats. \fItype\fR can indicate \fIlun\fR, \fIcdrom\fR or \fIfloppy\fR as alternative to the disk default, although this use only replaces the media within the existing virtual cdrom or floppy device; consider using \&\fBupdate-device\fR for this usage instead. \&\fImode\fR can specify the two specific mode \fIreadonly\fR or \fIshareable\fR. \&\fIsourcetype\fR can indicate the type of source (block|file) \&\fIcache\fR can be one of \*(L"default\*(R", \*(L"none\*(R", \*(L"writethrough\*(R", \*(L"writeback\*(R", \&\*(L"directsync\*(R" or \*(L"unsafe\*(R". \&\fIiothread\fR is the number within the range of domain IOThreads to which this disk may be attached (\s-1QEMU\s0 only). \&\fIserial\fR is the serial of disk device. \fIwwn\fR is the wwn of disk device. \&\fIrawio\fR indicates the disk needs rawio capability. \&\fIaddress\fR is the address of disk device in the form of pci:domain.bus.slot.function, scsi:controller.bus.unit, ide:controller.bus.unit or ccw:cssid.ssid.devno. Virtio-ccw devices must have their cssid set to 0xfe. \&\fImultifunction\fR indicates specified pci address is a multifunction pci device address. .Sp If \fI\-\-print\-xml\fR is specified, then the \s-1XML\s0 of the disk that would be attached is printed instead. .Sp If \fI\-\-live\fR is specified, affect a running domain. If \fI\-\-config\fR is specified, affect the next startup of a persistent domain. If \fI\-\-current\fR is specified, affect the current domain state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. When no flag is specified legacy \s-1API\s0 is used whose behavior depends on the hypervisor driver. .Sp For compatibility purposes, \fI\-\-persistent\fR behaves like \fI\-\-config\fR for an offline domain, and like \fI\-\-live\fR \fI\-\-config\fR for a running domain. Likewise, \fI\-\-shareable\fR is an alias for \fI\-\-mode shareable\fR. .IP "\fBattach-interface\fR \fIdomain\fR \fItype\fR \fIsource\fR [[[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] | [\fI\-\-persistent\fR]] [\fI\-\-target target\fR] [\fI\-\-mac mac\fR] [\fI\-\-script script\fR] [\fI\-\-model model\fR] [\fI\-\-inbound average,peak,burst,floor\fR] [\fI\-\-outbound average,peak,burst\fR] [\fI\-\-managed\fR] [\fI\-\-print\-xml\fR]" 4 .IX Item "attach-interface domain type source [[[--live] [--config] | [--current]] | [--persistent]] [--target target] [--mac mac] [--script script] [--model model] [--inbound average,peak,burst,floor] [--outbound average,peak,burst] [--managed] [--print-xml]" Attach a new network interface to the domain. .Sp \&\fBtype\fR can be one of the: .RS 4 .Sp .RS 4 \&\fInetwork\fR to indicate connection via a libvirt virtual network, .Sp \&\fIbridge\fR to indicate connection via a bridge device on the host, .Sp \&\fIdirect\fR to indicate connection directly to one of the host's network interfaces or bridges, .Sp \&\fIhostdev\fR to indicate connection using a passthrough of \s-1PCI\s0 device on the host. .RE .RE .RS 4 .Sp \&\fBsource\fR indicates the source of the connection. The source depends on the type of the interface: .Sp .RS 4 \&\fInetwork\fR name of the virtual network, .Sp \&\fIbridge\fR the name of the bridge device, .Sp \&\fIdirect\fR the name of the host's interface or bridge, .Sp \&\fIhostdev\fR the \s-1PCI\s0 address of the host's interface formatted as domain:bus:slot.function. .RE .RE .RS 4 .Sp \&\fB\-\-target\fR is used to specify the tap/macvtap device to be used to connect the domain to the source. Names starting with 'vnet' are considered as auto-generated and are blanked out/regenerated each time the interface is attached. .Sp \&\fB\-\-mac\fR specifies the \s-1MAC\s0 address of the network interface; if a \s-1MAC\s0 address is not given, a new address will be automatically generated (and stored in the persistent configuration if \*(L"\-\-config\*(R" is given on the command line). .Sp \&\fB\-\-script\fR is used to specify a path to a custom script to be called while attaching to a bridge \- this will be called instead of the default script not in addition to it. This is valid only for interfaces of \&\fIbridge\fR type and only for Xen domains. .Sp \&\fB\-\-model\fR specifies the network device model to be presented to the domain. .Sp \&\fB\-\-inbound\fR and \fB\-\-outbound\fR control the bandwidth of the interface. At least one from the \fIaverage\fR, \fIfloor\fR pair must be specified. The other two \fIpeak\fR and \fIburst\fR are optional, so \&\*(L"average,peak\*(R", \*(L"average,,burst\*(R", \*(L"average,,,floor\*(R", \*(L"average\*(R" and \&\*(L",,,floor\*(R" are also legal. Values for \fIaverage\fR, \fIfloor\fR and \fIpeak\fR are expressed in kilobytes per second, while \fIburst\fR is expressed in kilobytes in a single burst at \fIpeak\fR speed as described in the Network \s-1XML\s0 documentation at . .Sp \&\fB\-\-managed\fR is usable only for \fIhostdev\fR type and tells libvirt that the interface should be managed, which means detached and reattached from/to the host by libvirt. .Sp If \fB\-\-print\-xml\fR is specified, then the \s-1XML\s0 of the interface that would be attached is printed instead. .Sp If \fB\-\-live\fR is specified, affect a running domain. If \fB\-\-config\fR is specified, affect the next startup of a persistent domain. If \fB\-\-current\fR is specified, affect the current domain state. Both \fB\-\-live\fR and \fB\-\-config\fR flags may be given, but \fB\-\-current\fR is exclusive. When no flag is specified legacy \s-1API\s0 is used whose behavior depends on the hypervisor driver. .Sp For compatibility purposes, \fB\-\-persistent\fR behaves like \fB\-\-config\fR for an offline domain, and like \fB\-\-live\fR \fB\-\-config\fR for a running domain. .Sp \&\fBNote\fR: the optional target value is the name of a device to be created as the back-end on the node. If not provided a device named \*(L"vnetN\*(R" or \*(L"vifN\*(R" will be created automatically. .RE .IP "\fBdetach-device\fR \fIdomain\fR \fI\s-1FILE\s0\fR [[[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] | [\fI\-\-persistent\fR]]" 4 .IX Item "detach-device domain FILE [[[--live] [--config] | [--current]] | [--persistent]]" Detach a device from the domain, takes the same kind of \s-1XML\s0 descriptions as command \fBattach-device\fR. For passthrough host devices, see also \fBnodedev-reattach\fR, needed if the device does not use managed mode. .Sp \&\fBNote\fR: The supplied \s-1XML\s0 description of the device should be as specific as its definition in the domain \s-1XML.\s0 The set of attributes used to match the device are internal to the drivers. Using a partial definition, or attempting to detach a device that is not present in the domain \s-1XML,\s0 but shares some specific attributes with one that is present, may lead to unexpected results. .Sp If \fI\-\-live\fR is specified, affect a running domain. If \fI\-\-config\fR is specified, affect the next startup of a persistent domain. If \fI\-\-current\fR is specified, affect the current domain state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. When no flag is specified legacy \s-1API\s0 is used whose behavior depends on the hypervisor driver. .Sp For compatibility purposes, \fI\-\-persistent\fR behaves like \fI\-\-config\fR for an offline domain, and like \fI\-\-live\fR \fI\-\-config\fR for a running domain. .Sp Note that older versions of virsh used \fI\-\-config\fR as an alias for \&\fI\-\-persistent\fR. .IP "\fBdetach-disk\fR \fIdomain\fR \fItarget\fR [[[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] | [\fI\-\-persistent\fR]]" 4 .IX Item "detach-disk domain target [[[--live] [--config] | [--current]] | [--persistent]]" Detach a disk device from a domain. The \fItarget\fR is the device as seen from the domain. .Sp If \fI\-\-live\fR is specified, affect a running domain. If \fI\-\-config\fR is specified, affect the next startup of a persistent domain. If \fI\-\-current\fR is specified, affect the current domain state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. When no flag is specified legacy \s-1API\s0 is used whose behavior depends on the hypervisor driver. .Sp For compatibility purposes, \fI\-\-persistent\fR behaves like \fI\-\-config\fR for an offline domain, and like \fI\-\-live\fR \fI\-\-config\fR for a running domain. .Sp Note that older versions of virsh used \fI\-\-config\fR as an alias for \&\fI\-\-persistent\fR. .IP "\fBdetach-interface\fR \fIdomain\fR \fItype\fR [\fI\-\-mac mac\fR] [[[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] | [\fI\-\-persistent\fR]]" 4 .IX Item "detach-interface domain type [--mac mac] [[[--live] [--config] | [--current]] | [--persistent]]" Detach a network interface from a domain. \&\fItype\fR can be either \fInetwork\fR to indicate a physical network device or \&\fIbridge\fR to indicate a bridge to a device. It is recommended to use the \&\fImac\fR option to distinguish between the interfaces if more than one are present on the domain. .Sp If \fI\-\-live\fR is specified, affect a running domain. If \fI\-\-config\fR is specified, affect the next startup of a persistent domain. If \fI\-\-current\fR is specified, affect the current domain state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. When no flag is specified legacy \s-1API\s0 is used whose behavior depends on the hypervisor driver. .Sp For compatibility purposes, \fI\-\-persistent\fR behaves like \fI\-\-config\fR for an offline domain, and like \fI\-\-live\fR \fI\-\-config\fR for a running domain. .Sp Note that older versions of virsh used \fI\-\-config\fR as an alias for \&\fI\-\-persistent\fR. .IP "\fBupdate-device\fR \fIdomain\fR \fIfile\fR [\fI\-\-force\fR] [[[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] | [\fI\-\-persistent\fR]]" 4 .IX Item "update-device domain file [--force] [[[--live] [--config] | [--current]] | [--persistent]]" Update the characteristics of a device associated with \fIdomain\fR, based on the device definition in an \s-1XML \s0\fIfile\fR. The \fI\-\-force\fR option can be used to force device update, e.g., to eject a CD-ROM even if it is locked/mounted in the domain. See the documentation at to learn about libvirt \s-1XML\s0 format for a device. .Sp If \fI\-\-live\fR is specified, affect a running domain. If \fI\-\-config\fR is specified, affect the next startup of a persistent domain. If \fI\-\-current\fR is specified, affect the current domain state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. Not specifying any flag is the same as specifying \fI\-\-current\fR. .Sp For compatibility purposes, \fI\-\-persistent\fR behaves like \fI\-\-config\fR for an offline domain, and like \fI\-\-live\fR \fI\-\-config\fR for a running domain. .Sp Note that older versions of virsh used \fI\-\-config\fR as an alias for \&\fI\-\-persistent\fR. .Sp \&\fBNote\fR: using of partial device definition \s-1XML\s0 files may lead to unexpected results as some fields may be autogenerated and thus match devices other than expected. .IP "\fBchange-media\fR \fIdomain\fR \fIpath\fR [\fI\-\-eject\fR] [\fI\-\-insert\fR] [\fI\-\-update\fR] [\fIsource\fR] [\fI\-\-force\fR] [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]] [\fI\-\-print\-xml\fR] [\fI\-\-block\fR]" 4 .IX Item "change-media domain path [--eject] [--insert] [--update] [source] [--force] [[--live] [--config] | [--current]] [--print-xml] [--block]" Change media of \s-1CDROM\s0 or floppy drive. \fIpath\fR can be the fully-qualified path or the unique target name () of the disk device. \fIsource\fR specifies the path of the media to be inserted or updated. Flag \fI\-\-block\fR allows to set the backing type in case a block device is used as media for the \&\s-1CDROM\s0 or floppy drive instead of a file. .Sp \&\fI\-\-eject\fR indicates the media will be ejected. \&\fI\-\-insert\fR indicates the media will be inserted. \fIsource\fR must be specified. If the device has source (e.g. ), and \fIsource\fR is not specified, \fI\-\-update\fR is equal to \fI\-\-eject\fR. If the device has no source, and \fIsource\fR is specified, \fI\-\-update\fR is equal to \fI\-\-insert\fR. If the device has source, and \fIsource\fR is specified, \fI\-\-update\fR behaves like combination of \fI\-\-eject\fR and \fI\-\-insert\fR. If none of \fI\-\-eject\fR, \fI\-\-insert\fR, and \fI\-\-update\fR is specified, \fI\-\-update\fR is used by default. The \fI\-\-force\fR option can be used to force media changing. If \fI\-\-live\fR is specified, alter live configuration of running guest. If \fI\-\-config\fR is specified, alter persistent configuration, effect observed on next boot. \&\fI\-\-current\fR can be either or both of \fIlive\fR and \fIconfig\fR, depends on the hypervisor's implementation. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. If no flag is specified, behavior is different depending on hypervisor. If \fI\-\-print\-xml\fR is specified, the \s-1XML\s0 that would be used to change media is printed instead of changing the media. .SH "NODEDEV COMMANDS" .IX Header "NODEDEV COMMANDS" The following commands manipulate host devices that are intended to be passed through to guest domains via elements in a domain's section. A node device key is generally specified by the bus name followed by its address, using underscores between all components, such as pci_0000_00_02_1, usb_1_5_3, or net_eth1_00_27_13_6a_fe_00. The \fBnodedev-list\fR gives the full list of host devices that are known to libvirt, although this includes devices that cannot be assigned to a guest (for example, attempting to detach the \s-1PCI\s0 device that controls the host's hard disk controller where the guest's disk images live could cause the host system to lock up or reboot). .PP For more information on node device definition see: . .PP Passthrough devices cannot be simultaneously used by the host and its guest domains, nor by multiple active guests at once. If the description of a \s-1PCI\s0 device includes the attribute \fBmanaged='yes'\fR, and the hypervisor driver supports it, then the device is in managed mode, and attempts to use that passthrough device in an active guest will automatically behave as if \fBnodedev-detach\fR (guest start, device hot-plug) and \fBnodedev-reattach\fR (guest stop, device hot-unplug) were called at the right points. If a \s-1PCI\s0 device is not marked as managed, then it must manually be detached before guests can use it, and manually reattached to be returned to the host. Also, if a device is manually detached, then the host does not regain control of the device without a matching reattach, even if the guests use the device in managed mode. .IP "\fBnodedev-create\fR \fI\s-1FILE\s0\fR" 4 .IX Item "nodedev-create FILE" Create a device on the host node that can then be assigned to virtual machines. Normally, libvirt is able to automatically determine which host nodes are available for use, but this allows registration of host hardware that libvirt did not automatically detect. \fIfile\fR contains xml for a top-level description of a node device. .IP "\fBnodedev-destroy\fR \fIdevice\fR" 4 .IX Item "nodedev-destroy device" Destroy (stop) a device on the host. \fIdevice\fR can be either device name or wwn pair in \*(L"wwnn,wwpn\*(R" format (only works for vHBA currently). Note that this makes libvirt quit managing a host device, and may even make that device unusable by the rest of the physical host until a reboot. .IP "\fBnodedev-detach\fR \fInodedev\fR [\fI\-\-driver backend_driver\fR]" 4 .IX Item "nodedev-detach nodedev [--driver backend_driver]" Detach \fInodedev\fR from the host, so that it can safely be used by guests via passthrough. This is reversed with \&\fBnodedev-reattach\fR, and is done automatically for managed devices. .Sp Different backend drivers expect the device to be bound to different dummy devices. For example, \s-1QEMU\s0's \*(L"kvm\*(R" backend driver (the default) expects the device to be bound to pci-stub, but its \*(L"vfio\*(R" backend driver expects the device to be bound to vfio-pci. The \fI\-\-driver\fR parameter can be used to specify the desired backend driver. .IP "\fBnodedev-dumpxml\fR \fIdevice\fR" 4 .IX Item "nodedev-dumpxml device" Dump a \s-1XML\s0 representation for the given node device, including such information as the device name, which bus owns the device, the vendor and product id, and any capabilities of the device usable by libvirt (such as whether device reset is supported). \fIdevice\fR can be either device name or wwn pair in \*(L"wwnn,wwpn\*(R" format (only works for \s-1HBA\s0). .IP "\fBnodedev-list\fR \fIcap\fR \fI\-\-tree\fR" 4 .IX Item "nodedev-list cap --tree" List all of the devices available on the node that are known by libvirt. \&\fIcap\fR is used to filter the list by capability types, the types must be separated by comma, e.g. \-\-cap pci,scsi, valid capability types include \&'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target', \&'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic'. If \fI\-\-tree\fR is used, the output is formatted in a tree representing parents of each node. \&\fIcap\fR and \fI\-\-tree\fR are mutually exclusive. .IP "\fBnodedev-reattach\fR \fInodedev\fR" 4 .IX Item "nodedev-reattach nodedev" Declare that \fInodedev\fR is no longer in use by any guests, and that the host can resume normal use of the device. This is done automatically for \s-1PCI\s0 devices in managed mode and \s-1USB\s0 devices, but must be done explicitly to match any explicit \fBnodedev-detach\fR. .IP "\fBnodedev-reset\fR \fInodedev\fR" 4 .IX Item "nodedev-reset nodedev" Trigger a device reset for \fInodedev\fR, useful prior to transferring a node device between guest passthrough or the host. Libvirt will often do this action implicitly when required, but this command allows an explicit reset when needed. .IP "\fBnodedev-event\fR {[\fInodedev\fR] \fIevent\fR [\fI\-\-loop\fR] [\fI\-\-timeout\fR \fIseconds\fR] [\fI\-\-timestamp\fR] | \fI\-\-list\fR}" 4 .IX Item "nodedev-event {[nodedev] event [--loop] [--timeout seconds] [--timestamp] | --list}" Wait for a class of node device events to occur, and print appropriate details of events as they happen. The events can optionally be filtered by \fInodedev\fR. Using \fI\-\-list\fR as the only argument will provide a list of possible \fIevent\fR values known by this client, although the connection might not allow registering for all these events. .Sp By default, this command is one-shot, and returns success once an event occurs; you can send \s-1SIGINT \s0(usually via \f(CW\*(C`Ctrl\-C\*(C'\fR) to quit immediately. If \fI\-\-timeout\fR is specified, the command gives up waiting for events after \fIseconds\fR have elapsed. With \fI\-\-loop\fR, the command prints all events until a timeout or interrupt key. .Sp When \fI\-\-timestamp\fR is used, a human-readable timestamp will be printed before the event. .SH "VIRTUAL NETWORK COMMANDS" .IX Header "VIRTUAL NETWORK COMMANDS" The following commands manipulate networks. Libvirt has the capability to define virtual networks which can then be used by domains and linked to actual network devices. For more detailed information about this feature see the documentation at . Many of the commands for virtual networks are similar to the ones used for domains, but the way to name a virtual network is either by its name or \s-1UUID.\s0 .IP "\fBnet-autostart\fR \fInetwork\fR [\fI\-\-disable\fR]" 4 .IX Item "net-autostart network [--disable]" Configure a virtual network to be automatically started at boot. The \fI\-\-disable\fR option disable autostarting. .IP "\fBnet-create\fR \fIfile\fR" 4 .IX Item "net-create file" Create a transient (temporary) virtual network from an \&\s-1XML \s0\fIfile\fR and instantiate (start) the network. See the documentation at to get a description of the \s-1XML\s0 network format used by libvirt. .IP "\fBnet-define\fR \fIfile\fR" 4 .IX Item "net-define file" Define an inactive persistent virtual network or modify an existing persistent one from the \s-1XML \s0\fIfile\fR. .IP "\fBnet-destroy\fR \fInetwork\fR" 4 .IX Item "net-destroy network" Destroy (stop) a given transient or persistent virtual network specified by its name or \s-1UUID.\s0 This takes effect immediately. .IP "\fBnet-dumpxml\fR \fInetwork\fR [\fI\-\-inactive\fR]" 4 .IX Item "net-dumpxml network [--inactive]" Output the virtual network information as an \s-1XML\s0 dump to stdout. If \fI\-\-inactive\fR is specified, then physical functions are not expanded into their associated virtual functions. .IP "\fBnet-edit\fR \fInetwork\fR" 4 .IX Item "net-edit network" Edit the \s-1XML\s0 configuration file for a network. .Sp This is equivalent to: .Sp .Vb 3 \& virsh net\-dumpxml \-\-inactive network > network.xml \& vi network.xml (or make changes with your other text editor) \& virsh net\-define network.xml .Ve .Sp except that it does some error checking. .Sp The editor used can be supplied by the \f(CW$VISUAL\fR or \f(CW$EDITOR\fR environment variables, and defaults to \f(CW\*(C`vi\*(C'\fR. .IP "\fBnet-event\fR {[\fInetwork\fR] \fIevent\fR [\fI\-\-loop\fR] [\fI\-\-timeout\fR \fIseconds\fR] [\fI\-\-timestamp\fR] | \fI\-\-list\fR}" 4 .IX Item "net-event {[network] event [--loop] [--timeout seconds] [--timestamp] | --list}" Wait for a class of network events to occur, and print appropriate details of events as they happen. The events can optionally be filtered by \&\fInetwork\fR. Using \fI\-\-list\fR as the only argument will provide a list of possible \fIevent\fR values known by this client, although the connection might not allow registering for all these events. .Sp By default, this command is one-shot, and returns success once an event occurs; you can send \s-1SIGINT \s0(usually via \f(CW\*(C`Ctrl\-C\*(C'\fR) to quit immediately. If \fI\-\-timeout\fR is specified, the command gives up waiting for events after \fIseconds\fR have elapsed. With \fI\-\-loop\fR, the command prints all events until a timeout or interrupt key. .Sp When \fI\-\-timestamp\fR is used, a human-readable timestamp will be printed before the event. .IP "\fBnet-info\fR \fInetwork\fR" 4 .IX Item "net-info network" Returns basic information about the \fInetwork\fR object. .IP "\fBnet-list\fR [\fI\-\-inactive\fR | \fI\-\-all\fR] { [\fI\-\-table\fR] | \fI\-\-name\fR | \fI\-\-uuid\fR } [\fI\-\-persistent\fR] [<\-\-transient>] [\fI\-\-autostart\fR] [<\-\-no\-autostart>]" 4 .IX Item "net-list [--inactive | --all] { [--table] | --name | --uuid } [--persistent] [<--transient>] [--autostart] [<--no-autostart>]" Returns the list of active networks, if \fI\-\-all\fR is specified this will also include defined but inactive networks, if \fI\-\-inactive\fR is specified only the inactive ones will be listed. You may also want to filter the returned networks by \fI\-\-persistent\fR to list the persistent ones, \fI\-\-transient\fR to list the transient ones, \fI\-\-autostart\fR to list the ones with autostart enabled, and \&\fI\-\-no\-autostart\fR to list the ones with autostart disabled. .Sp If \fI\-\-name\fR is specified, network names are printed instead of the table formatted one per line. If \fI\-\-uuid\fR is specified network's \s-1UUID\s0's are printed instead of names. Flag \fI\-\-table\fR specifies that the legacy table-formatted output should be used. This is the default. All of these are mutually exclusive. .Sp \&\s-1NOTE:\s0 When talking to older servers, this command is forced to use a series of \&\s-1API\s0 calls with an inherent race, where a pool might not be listed or might appear more than once if it changed state between calls while the list was being collected. Newer servers do not have this problem. .IP "\fBnet-name\fR \fInetwork-UUID\fR" 4 .IX Item "net-name network-UUID" Convert a network \s-1UUID\s0 to network name. .IP "\fBnet-start\fR \fInetwork\fR" 4 .IX Item "net-start network" Start a (previously defined) inactive network. .IP "\fBnet-undefine\fR \fInetwork\fR" 4 .IX Item "net-undefine network" Undefine the configuration for a persistent network. If the network is active, make it transient. .IP "\fBnet-uuid\fR \fInetwork-name\fR" 4 .IX Item "net-uuid network-name" Convert a network name to network \s-1UUID.\s0 .IP "\fBnet-update\fR \fInetwork\fR \fIcommand\fR \fIsection\fR \fIxml\fR [\fI\-\-parent\-index\fR \fIindex\fR] [[\fI\-\-live\fR] [\fI\-\-config\fR] | [\fI\-\-current\fR]]" 4 .IX Item "net-update network command section xml [--parent-index index] [[--live] [--config] | [--current]]" Update the given section of an existing network definition, with the changes optionally taking effect immediately, without needing to destroy and re-start the network. .Sp \&\fIcommand\fR is one of \*(L"add-first\*(R", \*(L"add-last\*(R", \*(L"add\*(R" (a synonym for add-last), \*(L"delete\*(R", or \*(L"modify\*(R". .Sp \&\fIsection\fR is one of \*(L"bridge\*(R", \*(L"domain\*(R", \*(L"ip\*(R", \*(L"ip-dhcp-host\*(R", \&\*(L"ip-dhcp-range\*(R", \*(L"forward\*(R", \*(L"forward-interface\*(R", \*(L"forward-pf\*(R", \&\*(L"portgroup\*(R", \*(L"dns-host\*(R", \*(L"dns-txt\*(R", or \*(L"dns-srv\*(R", each section being named by a concatenation of the xml element hierarchy leading to the element being changed. For example, \*(L"ip-dhcp-host\*(R" will change a element that is contained inside a element inside an element of the network. .Sp \&\fIxml\fR is either the text of a complete xml element of the type being changed (e.g. \*(L"\*(L", or the name of a file that contains a complete xml element. Disambiguation is done by looking at the first character of the provided text \- if the first character is \*(R"<\*(L", it is xml text, if the first character is not \&\*(R"<", it is the name of a file that contains the xml text to be used. .Sp The \fI\-\-parent\-index\fR option is used to specify which of several parent elements the requested element is in (0\-based). For example, a dhcp element could be in any one of multiple elements in the network; if a parent-index isn't provided, the \*(L"most appropriate\*(R" element will be selected (usually the only one that already has a element), but if \fI\-\-parent\-index\fR is given, that particular instance of will get the modification. .Sp If \fI\-\-live\fR is specified, affect a running network. If \fI\-\-config\fR is specified, affect the next startup of a persistent network. If \fI\-\-current\fR is specified, affect the current network state. Both \fI\-\-live\fR and \fI\-\-config\fR flags may be given, but \fI\-\-current\fR is exclusive. Not specifying any flag is the same as specifying \fI\-\-current\fR. .IP "\fBnet-dhcp-leases\fR \fInetwork\fR [\fImac\fR]" 4 .IX Item "net-dhcp-leases network [mac]" Get a list of dhcp leases for all network interfaces connected to the given virtual \fInetwork\fR or limited output just for one interface if \fImac\fR is specified. .SH "INTERFACE COMMANDS" .IX Header "INTERFACE COMMANDS" The following commands manipulate host interfaces. Often, these host interfaces can then be used by name within domain elements (such as a system-created bridge interface), but there is no requirement that host interfaces be tied to any particular guest configuration \s-1XML\s0 at all. .PP Many of the commands for host interfaces are similar to the ones used for domains, and the way to name an interface is either by its name or its \s-1MAC\s0 address. However, using a \s-1MAC\s0 address for an \fIiface\fR argument only works when that address is unique (if an interface and a bridge share the same \s-1MAC\s0 address, which is often the case, then using that \s-1MAC\s0 address results in an error due to ambiguity, and you must resort to a name instead). .IP "\fBiface-bridge\fR \fIinterface\fR \fIbridge\fR [\fI\-\-no\-stp\fR] [\fIdelay\fR] [\fI\-\-no\-start\fR]" 4 .IX Item "iface-bridge interface bridge [--no-stp] [delay] [--no-start]" Create a bridge device named \fIbridge\fR, and attach the existing network device \fIinterface\fR to the new bridge. The new bridge defaults to starting immediately, with \s-1STP\s0 enabled and a delay of 0; these settings can be altered with \fI\-\-no\-stp\fR, \fI\-\-no\-start\fR, and an integer number of seconds for \fIdelay\fR. All \s-1IP\s0 address configuration of \fIinterface\fR will be moved to the new bridge device. .Sp See also \fBiface-unbridge\fR for undoing this operation. .IP "\fBiface-define\fR \fIfile\fR" 4 .IX Item "iface-define file" Define an inactive persistent physical host interface or modify an existing persistent one from the \s-1XML \s0\fIfile\fR. .IP "\fBiface-destroy\fR \fIinterface\fR" 4 .IX Item "iface-destroy interface" Destroy (stop) a given host interface, such as by running \*(L"if-down\*(R" to disable that interface from active use. This takes effect immediately. .IP "\fBiface-dumpxml\fR \fIinterface\fR [\fI\-\-inactive\fR]" 4 .IX Item "iface-dumpxml interface [--inactive]" Output the host interface information as an \s-1XML\s0 dump to stdout. If \&\fI\-\-inactive\fR is specified, then the output reflects the persistent state of the interface that will be used the next time it is started. .IP "\fBiface-edit\fR \fIinterface\fR" 4 .IX Item "iface-edit interface" Edit the \s-1XML\s0 configuration file for a host interface. .Sp This is equivalent to: .Sp .Vb 3 \& virsh iface\-dumpxml iface > iface.xml \& vi iface.xml (or make changes with your other text editor) \& virsh iface\-define iface.xml .Ve .Sp except that it does some error checking. .Sp The editor used can be supplied by the \f(CW$VISUAL\fR or \f(CW$EDITOR\fR environment variables, and defaults to \f(CW\*(C`vi\*(C'\fR. .IP "\fBiface-list\fR [\fI\-\-inactive\fR | \fI\-\-all\fR]" 4 .IX Item "iface-list [--inactive | --all]" Returns the list of active host interfaces. If \fI\-\-all\fR is specified this will also include defined but inactive interfaces. If \&\fI\-\-inactive\fR is specified only the inactive ones will be listed. .IP "\fBiface-name\fR \fIinterface\fR" 4 .IX Item "iface-name interface" Convert a host interface \s-1MAC\s0 to interface name, if the \s-1MAC\s0 address is unique among the host's interfaces. .Sp \&\fIinterface\fR specifies the interface \s-1MAC\s0 address. .IP "\fBiface-mac\fR \fIinterface\fR" 4 .IX Item "iface-mac interface" Convert a host interface name to \s-1MAC\s0 address. .Sp \&\fIinterface\fR specifies the interface name. .IP "\fBiface-start\fR \fIinterface\fR" 4 .IX Item "iface-start interface" Start a (previously defined) host interface, such as by running \*(L"if-up\*(R". .IP "\fBiface-unbridge\fR \fIbridge\fR [\fI\-\-no\-start\fR]" 4 .IX Item "iface-unbridge bridge [--no-start]" Tear down a bridge device named \fIbridge\fR, releasing its underlying interface back to normal usage, and moving all \s-1IP\s0 address configuration from the bridge device to the underlying device. The underlying interface is restarted unless \fI\-\-no\-start\fR is present; this flag is present for symmetry, but generally not recommended. .Sp See also \fBiface-bridge\fR for creating a bridge. .IP "\fBiface-undefine\fR \fIinterface\fR" 4 .IX Item "iface-undefine interface" Undefine the configuration for an inactive host interface. .IP "\fBiface-begin\fR" 4 .IX Item "iface-begin" Create a snapshot of current host interface settings, which can later be committed (\fIiface-commit\fR) or restored (\fIiface-rollback\fR). If a snapshot already exists, then this command will fail until the previous snapshot has been committed or restored. Undefined behavior results if any external changes are made to host interfaces outside of the libvirt \s-1API\s0 between the beginning of a snapshot and its eventual commit or rollback. .IP "\fBiface-commit\fR" 4 .IX Item "iface-commit" Declare all changes since the last \fIiface-begin\fR as working, and delete the rollback point. If no interface snapshot has already been started, then this command will fail. .IP "\fBiface-rollback\fR" 4 .IX Item "iface-rollback" Revert all host interface settings back to the state recorded in the last \fIiface-begin\fR. If no interface snapshot has already been started, then this command will fail. Rebooting the host also serves as an implicit rollback point. .SH "STORAGE POOL COMMANDS" .IX Header "STORAGE POOL COMMANDS" The following commands manipulate storage pools. Libvirt has the capability to manage various storage solutions, including files, raw partitions, and domain-specific formats, used to provide the storage volumes visible as devices within virtual machines. For more detailed information about this feature, see the documentation at . Many of the commands for pools are similar to the ones used for domains. .IP "\fBfind-storage-pool-sources\fR \fItype\fR [\fIsrcSpec\fR]" 4 .IX Item "find-storage-pool-sources type [srcSpec]" Returns \s-1XML\s0 describing all possible available storage pool sources that could be used to create or define a storage pool of a given \fItype\fR. If \&\fIsrcSpec\fR is provided, it is a file that contains \s-1XML\s0 to further restrict the query for pools. .Sp Not all storage pools support discovery in this manner. Furthermore, for those that do support discovery, only specific \s-1XML\s0 elements are required in order to return valid data, while other elements and even attributes of some elements are ignored since they are not necessary to find the pool based on the search criteria. The following lists the supported \fItype\fR options and the expected minimal \s-1XML\s0 elements used to perform the search. .Sp For a \*(L"netfs\*(R" or \*(L"gluster\*(R" pool, the minimal expected \s-1XML\s0 required is the element with a \*(L"name\*(R" attribute describing the \s-1IP\s0 address or hostname to be used to find the pool. The \*(L"port\*(R" attribute will be ignored as will any other provided \s-1XML\s0 elements in \fIsrcSpec\fR. .Sp For a \*(L"logical\*(R" pool, the contents of the \fIsrcSpec\fR file are ignored, although if provided the file must at least exist. .Sp For an \*(L"iscsi\*(R" pool, the minimal expect \s-1XML\s0 required is the element with a \*(L"name\*(R" attribute describing the \s-1IP\s0 address or hostname to be used to find the pool (the iSCSI server address). Optionally, the \*(L"port\*(R" attribute may be provided, although it will default to 3260. Optionally, an \&\s-1XML\s0 element with a \*(L"name\*(R" attribute may be provided to further restrict the iSCSI target search to a specific initiator for multi-iqn iSCSI storage pools. .IP "\fBfind-storage-pool-sources-as\fR \fItype\fR [\fIhost\fR] [\fIport\fR] [\fIinitiator\fR]" 4 .IX Item "find-storage-pool-sources-as type [host] [port] [initiator]" Rather than providing \fIsrcSpec\fR \s-1XML\s0 file for \fBfind-storage-pool-sources\fR use this command option in order to have virsh generate the query \s-1XML\s0 file using the optional arguments. The command will return the same output \&\s-1XML\s0 as \fBfind-storage-pool-sources\fR. .Sp Use \fIhost\fR to describe a specific host to use for networked storage, such as netfs, gluster, and iscsi \fItype\fR pools. .Sp Use \fIport\fR to further restrict which networked port to utilize for the connection if required by the specific storage backend, such as iscsi. .Sp Use \fIinitiator\fR to further restrict the iscsi \fItype\fR pool searches to specific target initiators. .IP "\fBpool-autostart\fR \fIpool-or-uuid\fR [\fI\-\-disable\fR]" 4 .IX Item "pool-autostart pool-or-uuid [--disable]" Configure whether \fIpool\fR should automatically start at boot. .IP "\fBpool-build\fR \fIpool-or-uuid\fR [\fI\-\-overwrite\fR] [\fI\-\-no\-overwrite\fR]" 4 .IX Item "pool-build pool-or-uuid [--overwrite] [--no-overwrite]" Build a given pool. .Sp Options \fI\-\-overwrite\fR and \fI\-\-no\-overwrite\fR can only be used for \&\fBpool-build\fR a filesystem, disk, or logical pool. .Sp For a file system pool if neither flag is specified, then \fBpool-build\fR just makes the target path directory and no attempt to run mkfs on the target volume device. If \fI\-\-no\-overwrite\fR is specified, it probes to determine if a filesystem already exists on the target device, returning an error if one exists or using mkfs to format the target device if not. If \fI\-\-overwrite\fR is specified, mkfs is always executed and any existing data on the target device is overwritten unconditionally. .Sp For a disk pool, if neither of them is specified or \fI\-\-no\-overwrite\fR is specified, \fBpool-build\fR will check the target volume device for existing filesystems or partitions before attempting to write a new label on the target volume device. If the target volume device already has a label, the command will fail. If \fI\-\-overwrite\fR is specified, then no check will be made on the target volume device prior to writing a new label. Writing of the label uses the pool source format type or \*(L"dos\*(R" if not specified. .Sp For a logical pool, if neither of them is specified or \fI\-\-no\-overwrite\fR is specified, \fBpool-build\fR will check the target volume devices for existing filesystems or partitions before attempting to initialize and format each device for usage by the logical pool. If any target volume device already has a label, the command will fail. If \&\fI\-\-overwrite\fR is specified, then no check will be made on the target volume devices prior to initializing and formatting each device. Once all the target volume devices are properly formatted via pvcreate, the volume group will be created using all the devices. .IP "\fBpool-create\fR \fIfile\fR [\fI\-\-build\fR] [[\fI\-\-overwrite\fR] | [\fI\-\-no\-overwrite\fR]]" 4 .IX Item "pool-create file [--build] [[--overwrite] | [--no-overwrite]]" Create and start a pool object from the \s-1XML \s0\fIfile\fR. .Sp [\fI\-\-build\fR] [[\fI\-\-overwrite\fR] | [\fI\-\-no\-overwrite\fR]] perform a \&\fBpool-build\fR after creation in order to remove the need for a follow-up command to build the pool. The \fI\-\-overwrite\fR and \&\fI\-\-no\-overwrite\fR flags follow the same rules as \fBpool-build\fR. If just \fI\-\-build\fR is provided, then \fBpool-build\fR is called with no flags. .IP "\fBpool-create-as\fR \fIname\fR \fItype\fR [\fI\-\-print\-xml\fR] [\fI\-\-source\-host hostname\fR] [\fI\-\-source\-path path\fR] [\fI\-\-source\-dev path\fR] [\fI\-\-source\-name name\fR] [\fI\-\-target path\fR] [\fI\-\-source\-format format\fR] [\fI\-\-auth\-type authtype\fR \fI\-\-auth\-username username\fR \fI\-\-secret\-usage usage\fR] [[\fI\-\-adapter\-name name\fR] | [\fI\-\-adapter\-wwnn\fR \fI\-\-adapter\-wwpn\fR] [\fI\-\-adapter\-parent parent\fR]] [\fI\-\-build\fR] [[\fI\-\-overwrite\fR] | [\fI\-\-no\-overwrite\fR]]" 4 .IX Item "pool-create-as name type [--print-xml] [--source-host hostname] [--source-path path] [--source-dev path] [--source-name name] [--target path] [--source-format format] [--auth-type authtype --auth-username username --secret-usage usage] [[--adapter-name name] | [--adapter-wwnn --adapter-wwpn] [--adapter-parent parent]] [--build] [[--overwrite] | [--no-overwrite]]" Create and start a pool object \fIname\fR from the raw parameters. If \&\fI\-\-print\-xml\fR is specified, then print the \s-1XML\s0 of the pool object without creating the pool. Otherwise, the pool has the specified \&\fItype\fR. When using \fBpool-create-as\fR for a pool of \fItype\fR \*(L"disk\*(R", the existing partitions found on the \fI\-\-source\-dev path\fR will be used to populate the disk pool. Therefore, it is suggested to use \&\fBpool-define-as\fR and \fBpool-build\fR with the \fI\-\-overwrite\fR in order to properly initialize the disk pool. .Sp [\fI\-\-source\-host hostname\fR] provides the source hostname for pools backed by storage from a remote server (pool types netfs, iscsi, rbd, sheepdog, gluster). .Sp [\fI\-\-source\-path path\fR] provides the source directory path for pools backed by directories (pool type dir). .Sp [\fI\-\-source\-dev path\fR] provides the source path for pools backed by physical devices (pool types fs, logical, disk, iscsi, zfs). .Sp [\fI\-\-source\-name name\fR] provides the source name for pools backed by storage from a named element (pool types logical, rbd, sheepdog, gluster). .Sp [\fI\-\-target path\fR] is the path for the mapping of the storage pool into the host file system. .Sp [\fI\-\-source\-format format\fR] provides information about the format of the pool (pool types fs, netfs, disk, logical). .Sp [\fI\-\-auth\-type authtype\fR \fI\-\-auth\-username username\fR \fI\-\-secret\-usage usage\fR] provides the elements required to generate authentication credentials for the storage pool. The \fIauthtype\fR is either chap for iscsi \fItype\fR pools or ceph for rbd \fItype\fR pools. .Sp [\fI\-\-adapter\-name name\fR] defines the scsi_hostN adapter name to be used for the scsi_host adapter type pool. .Sp [\fI\-\-adapter\-wwnn\fR \fI\-\-adapter\-wwpn\fR [\fI\-\-adapter\-parent parent\fR]] defines the wwnn and wwpn to be used for the fc_host adapter type pool. The parent optionally provides the name of the scsi_hostN node device to be used for the vHBA. .Sp [\fI\-\-build\fR] [[\fI\-\-overwrite\fR] | [\fI\-\-no\-overwrite\fR]] perform a \&\fBpool-build\fR after creation in order to remove the need for a follow-up command to build the pool. The \fI\-\-overwrite\fR and \&\fI\-\-no\-overwrite\fR flags follow the same rules as \fBpool-build\fR. If just \fI\-\-build\fR is provided, then \fBpool-build\fR is called with no flags. .IP "\fBpool-define\fR \fIfile\fR" 4 .IX Item "pool-define file" Define an inactive persistent storage pool or modify an existing persistent one from the \s-1XML \s0\fIfile\fR. .IP "\fBpool-define-as\fR \fIname\fR \fItype\fR [\fI\-\-print\-xml\fR] [\fI\-\-source\-host hostname\fR] [\fI\-\-source\-path path\fR] [\fI\-\-source\-dev path\fR] [\fI\-\-source\-name name\fR] [\fI\-\-target path\fR] [\fI\-\-source\-format format\fR] [\fI\-\-auth\-type authtype\fR \fI\-\-auth\-username username\fR \fI\-\-secret\-usage usage\fR] [[\fI\-\-adapter\-name name\fR] | [\fI\-\-adapter\-wwnn\fR \fI\-\-adapter\-wwpn\fR] [\fI\-\-adapter\-parent parent\fR]]" 4 .IX Item "pool-define-as name type [--print-xml] [--source-host hostname] [--source-path path] [--source-dev path] [--source-name name] [--target path] [--source-format format] [--auth-type authtype --auth-username username --secret-usage usage] [[--adapter-name name] | [--adapter-wwnn --adapter-wwpn] [--adapter-parent parent]]" Create, but do not start, a pool object \fIname\fR from the raw parameters. If \&\fI\-\-print\-xml\fR is specified, then print the \s-1XML\s0 of the pool object without defining the pool. Otherwise, the pool has the specified \&\fItype\fR. .Sp Use the same arguments as \fBpool-create-as\fR, except for the \fI\-\-build\fR, \&\fI\-\-overwrite\fR, and \fI\-\-no\-overwrite\fR options. .IP "\fBpool-destroy\fR \fIpool-or-uuid\fR" 4 .IX Item "pool-destroy pool-or-uuid" Destroy (stop) a given \fIpool\fR object. Libvirt will no longer manage the storage described by the pool object, but the raw data contained in the pool is not changed, and can be later recovered with \&\fBpool-create\fR. .IP "\fBpool-delete\fR \fIpool-or-uuid\fR" 4 .IX Item "pool-delete pool-or-uuid" Destroy the resources used by a given \fIpool\fR object. This operation is non-recoverable. The \fIpool\fR object will still exist after this command, ready for the creation of new storage volumes. .IP "\fBpool-dumpxml\fR [\fI\-\-inactive\fR] \fIpool-or-uuid\fR" 4 .IX Item "pool-dumpxml [--inactive] pool-or-uuid" Returns the \s-1XML\s0 information about the \fIpool\fR object. \&\fI\-\-inactive\fR tells virsh to dump pool configuration that will be used on next start of the pool as opposed to the current pool configuration. .IP "\fBpool-edit\fR \fIpool-or-uuid\fR" 4 .IX Item "pool-edit pool-or-uuid" Edit the \s-1XML\s0 configuration file for a storage pool. .Sp This is equivalent to: .Sp .Vb 3 \& virsh pool\-dumpxml pool > pool.xml \& vi pool.xml (or make changes with your other text editor) \& virsh pool\-define pool.xml .Ve .Sp except that it does some error checking. .Sp The editor used can be supplied by the \f(CW$VISUAL\fR or \f(CW$EDITOR\fR environment variables, and defaults to \f(CW\*(C`vi\*(C'\fR. .IP "\fBpool-info\fR [\fI\-\-bytes\fR] \fIpool-or-uuid\fR" 4 .IX Item "pool-info [--bytes] pool-or-uuid" Returns basic information about the \fIpool\fR object. If \fI\-\-bytes\fR is specified the sizes of basic info are not converted to human friendly units. .IP "\fBpool-list\fR [\fI\-\-inactive\fR] [\fI\-\-all\fR] [\fI\-\-persistent\fR] [\fI\-\-transient\fR] [\fI\-\-autostart\fR] [\fI\-\-no\-autostart\fR] [[\fI\-\-details\fR] []" 4 .IX Item "pool-list [--inactive] [--all] [--persistent] [--transient] [--autostart] [--no-autostart] [[--details] []" List pool objects known to libvirt. By default, only active pools are listed; \fI\-\-inactive\fR lists just the inactive pools, and \fI\-\-all\fR lists all pools. .Sp In addition, there are several sets of filtering flags. \fI\-\-persistent\fR is to list the persistent pools, \fI\-\-transient\fR is to list the transient pools. \&\fI\-\-autostart\fR lists the autostarting pools, \fI\-\-no\-autostart\fR lists the pools with autostarting disabled. .Sp You may also want to list pools with specified types using \fItype\fR, the pool types must be separated by comma, e.g. \-\-type dir,disk. The valid pool types include 'dir', 'fs', 'netfs', 'logical', 'disk', 'iscsi', 'scsi', \&'mpath', 'rbd', 'sheepdog' and 'gluster'. .Sp The \fI\-\-details\fR option instructs virsh to additionally display pool persistence and capacity related information where available. .Sp \&\s-1NOTE:\s0 When talking to older servers, this command is forced to use a series of \&\s-1API\s0 calls with an inherent race, where a pool might not be listed or might appear more than once if it changed state between calls while the list was being collected. Newer servers do not have this problem. .IP "\fBpool-name\fR \fIuuid\fR" 4 .IX Item "pool-name uuid" Convert the \fIuuid\fR to a pool name. .IP "\fBpool-refresh\fR \fIpool-or-uuid\fR" 4 .IX Item "pool-refresh pool-or-uuid" Refresh the list of volumes contained in \fIpool\fR. .IP "\fBpool-start\fR \fIpool-or-uuid\fR [\fI\-\-build\fR] [[\fI\-\-overwrite\fR] | [\fI\-\-no\-overwrite\fR]]" 4 .IX Item "pool-start pool-or-uuid [--build] [[--overwrite] | [--no-overwrite]]" Start the storage \fIpool\fR, which is previously defined but inactive. .Sp [\fI\-\-build\fR] [[\fI\-\-overwrite\fR] | [\fI\-\-no\-overwrite\fR]] perform a \&\fBpool-build\fR prior to \fBpool-start\fR to ensure the pool environment is in an expected state rather than needing to run the build command prior to startup. The \fI\-\-overwrite\fR and \fI\-\-no\-overwrite\fR flags follow the same rules as \fBpool-build\fR. If just \fI\-\-build\fR is provided, then \&\fBpool-build\fR is called with no flags. .Sp \&\fBNote\fR: A storage pool that relies on remote resources such as an \&\*(L"iscsi\*(R" or a (v)HBA backed \*(L"scsi\*(R" pool may need to be refreshed multiple times in order to have all the volumes detected (see \fBpool-refresh\fR). This is because the corresponding volume devices may not be present in the host's filesystem during the initial pool startup or the current refresh attempt. The number of refresh retries is dependent upon the network connection and the time the host takes to export the corresponding devices. .IP "\fBpool-undefine\fR \fIpool-or-uuid\fR" 4 .IX Item "pool-undefine pool-or-uuid" Undefine the configuration for an inactive \fIpool\fR. .IP "\fBpool-uuid\fR \fIpool\fR" 4 .IX Item "pool-uuid pool" Returns the \s-1UUID\s0 of the named \fIpool\fR. .IP "\fBpool-event\fR {[\fIpool\fR] \fIevent\fR [\fI\-\-loop\fR] [\fI\-\-timeout\fR \fIseconds\fR] [\fI\-\-timestamp\fR] | \fI\-\-list\fR}" 4 .IX Item "pool-event {[pool] event [--loop] [--timeout seconds] [--timestamp] | --list}" Wait for a class of storage pool events to occur, and print appropriate details of events as they happen. The events can optionally be filtered by \fIpool\fR. Using \fI\-\-list\fR as the only argument will provide a list of possible \fIevent\fR values known by this client, although the connection might not allow registering for all these events. .Sp By default, this command is one-shot, and returns success once an event occurs; you can send \s-1SIGINT \s0(usually via \f(CW\*(C`Ctrl\-C\*(C'\fR) to quit immediately. If \fI\-\-timeout\fR is specified, the command gives up waiting for events after \fIseconds\fR have elapsed. With \fI\-\-loop\fR, the command prints all events until a timeout or interrupt key. .Sp When \fI\-\-timestamp\fR is used, a human-readable timestamp will be printed before the event. .SH "VOLUME COMMANDS" .IX Header "VOLUME COMMANDS" .IP "\fBvol-create\fR \fIpool-or-uuid\fR \fI\s-1FILE\s0\fR [\fI\-\-prealloc\-metadata\fR]" 4 .IX Item "vol-create pool-or-uuid FILE [--prealloc-metadata]" Create a volume from an \s-1XML\s0 . \&\fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool to create the volume in. \&\fI\s-1FILE\s0\fR is the \s-1XML\s0 with the volume definition. An easy way to create the \&\s-1XML\s0 is to use the \fBvol-dumpxml\fR command to obtain the definition of a pre-existing volume. [\fI\-\-prealloc\-metadata\fR] preallocate metadata (for qcow2 images which don't support full allocation). This option creates a sparse image file with metadata, resulting in higher performance compared to images with no preallocation and only slightly higher initial disk space usage. .Sp \&\fBExample\fR .Sp .Vb 3 \& virsh vol\-dumpxml \-\-pool storagepool1 appvolume1 > newvolume.xml \& vi newvolume.xml (or make changes with your other text editor) \& virsh vol\-create differentstoragepool newvolume.xml .Ve .IP "\fBvol-create-from\fR \fIpool-or-uuid\fR \fI\s-1FILE\s0\fR [\fI\-\-inputpool\fR \fIpool-or-uuid\fR] \fIvol-name-or-key-or-path\fR [\fI\-\-prealloc\-metadata\fR] [\fI\-\-reflink\fR]" 4 .IX Item "vol-create-from pool-or-uuid FILE [--inputpool pool-or-uuid] vol-name-or-key-or-path [--prealloc-metadata] [--reflink]" Create a volume, using another volume as input. \&\fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool to create the volume in. \&\fI\s-1FILE\s0\fR is the \s-1XML\s0 with the volume definition. \&\fI\-\-inputpool\fR \fIpool-or-uuid\fR is the name or uuid of the storage pool the source volume is in. \&\fIvol-name-or-key-or-path\fR is the name or key or path of the source volume. [\fI\-\-prealloc\-metadata\fR] preallocate metadata (for qcow2 images which don't support full allocation). This option creates a sparse image file with metadata, resulting in higher performance compared to images with no preallocation and only slightly higher initial disk space usage. When \fI\-\-reflink\fR is specified, perform a \s-1COW\s0 lightweight copy, where the data blocks are copied only when modified. If this is not possible, the copy fails. .IP "\fBvol-create-as\fR \fIpool-or-uuid\fR \fIname\fR \fIcapacity\fR [\fI\-\-allocation\fR \fIsize\fR] [\fI\-\-format\fR \fIstring\fR] [\fI\-\-backing\-vol\fR \fIvol-name-or-key-or-path\fR] [\fI\-\-backing\-vol\-format\fR \fIstring\fR] [\fI\-\-prealloc\-metadata\fR] [\fI\-\-print\-xml\fR]" 4 .IX Item "vol-create-as pool-or-uuid name capacity [--allocation size] [--format string] [--backing-vol vol-name-or-key-or-path] [--backing-vol-format string] [--prealloc-metadata] [--print-xml]" Create a volume from a set of arguments unless \fI\-\-print\-xml\fR is specified, in which case just the \s-1XML\s0 of the volume object is printed out without any actual object creation. \&\fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool to create the volume in. \&\fIname\fR is the name of the new volume. For a disk pool, this must match the partition name as determined from the pool's source device path and the next available partition. For example, a source device path of /dev/sdb and there are no partitions on the disk, then the name must be sdb1 with the next name being sdb2 and so on. \&\fIcapacity\fR is the size of the volume to be created, as a scaled integer (see \fB\s-1NOTES\s0\fR above), defaulting to bytes if there is no suffix. \&\fI\-\-allocation\fR \fIsize\fR is the initial size to be allocated in the volume, also as a scaled integer defaulting to bytes. \&\fI\-\-format\fR \fIstring\fR is used in file based storage pools to specify the volume file format to use; raw, bochs, qcow, qcow2, vmdk, qed. Use extended for disk storage pools in order to create an extended partition (other values are validity checked but not preserved when libvirtd is restarted or the pool is refreshed). \&\fI\-\-backing\-vol\fR \fIvol-name-or-key-or-path\fR is the source backing volume to be used if taking a snapshot of an existing volume. \&\fI\-\-backing\-vol\-format\fR \fIstring\fR is the format of the snapshot backing volume; raw, bochs, qcow, qcow2, qed, vmdk, host_device. These are, however, meant for file based storage pools. [\fI\-\-prealloc\-metadata\fR] preallocate metadata (for qcow2 images which don't support full allocation). This option creates a sparse image file with metadata, resulting in higher performance compared to images with no preallocation and only slightly higher initial disk space usage. .IP "\fBvol-clone\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] \fIvol-name-or-key-or-path\fR \fIname\fR [\fI\-\-prealloc\-metadata\fR] [\fI\-\-reflink\fR]" 4 .IX Item "vol-clone [--pool pool-or-uuid] vol-name-or-key-or-path name [--prealloc-metadata] [--reflink]" Clone an existing volume within the parent pool. Less powerful, but easier to type, version of \fBvol-create-from\fR. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool that contains the source volume, and will contain the new volume. \&\fIvol-name-or-key-or-path\fR is the name or key or path of the source volume. \&\fIname\fR is the name of the new volume. [\fI\-\-prealloc\-metadata\fR] preallocate metadata (for qcow2 images which don't support full allocation). This option creates a sparse image file with metadata, resulting in higher performance compared to images with no preallocation and only slightly higher initial disk space usage. When \fI\-\-reflink\fR is specified, perform a \s-1COW\s0 lightweight copy, where the data blocks are copied only when modified. If this is not possible, the copy fails. .IP "\fBvol-delete\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] \fIvol-name-or-key-or-path\fR [\fI\-\-delete\-snapshots\fR]" 4 .IX Item "vol-delete [--pool pool-or-uuid] vol-name-or-key-or-path [--delete-snapshots]" Delete a given volume. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \&\fIvol-name-or-key-or-path\fR is the name or key or path of the volume to delete. .Sp The \fI\-\-delete\-snapshots\fR flag specifies that any snapshots associated with the storage volume should be deleted as well. Not all storage drivers support this option, presently only rbd. .IP "\fBvol-upload\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] [\fI\-\-offset\fR \fIbytes\fR] [\fI\-\-length\fR \fIbytes\fR] \fIvol-name-or-key-or-path\fR \fIlocal-file\fR" 4 .IX Item "vol-upload [--pool pool-or-uuid] [--offset bytes] [--length bytes] vol-name-or-key-or-path local-file" Upload the contents of \fIlocal-file\fR to a storage volume. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \&\fIvol-name-or-key-or-path\fR is the name or key or path of the volume where the file will be uploaded. \&\fI\-\-offset\fR is the position in the storage volume at which to start writing the data. The value must be 0 or larger. \fI\-\-length\fR is an upper bound of the amount of data to be uploaded. A negative value is interpreted as an unsigned long long value to essentially include everything from the offset to the end of the volume. An error will occur if the \fIlocal-file\fR is greater than the specified length. See the description for the libvirt virStorageVolUpload \s-1API\s0 for details regarding possible target volume and pool changes as a result of the pool refresh when the upload is attempted. .IP "\fBvol-download\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] [\fI\-\-offset\fR \fIbytes\fR] [\fI\-\-length\fR \fIbytes\fR] \fIvol-name-or-key-or-path\fR \fIlocal-file\fR" 4 .IX Item "vol-download [--pool pool-or-uuid] [--offset bytes] [--length bytes] vol-name-or-key-or-path local-file" Download the contents of a storage volume to \fIlocal-file\fR. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \&\fIvol-name-or-key-or-path\fR is the name or key or path of the volume to download. \&\fI\-\-offset\fR is the position in the storage volume at which to start reading the data. The value must be 0 or larger. \fI\-\-length\fR is an upper bound of the amount of data to be downloaded. A negative value is interpreted as an unsigned long long value to essentially include everything from the offset to the end of the volume. .IP "\fBvol-wipe\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] [\fI\-\-algorithm\fR \fIalgorithm\fR] \fIvol-name-or-key-or-path\fR" 4 .IX Item "vol-wipe [--pool pool-or-uuid] [--algorithm algorithm] vol-name-or-key-or-path" Wipe a volume, ensure data previously on the volume is not accessible to future reads. \fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \&\fIvol-name-or-key-or-path\fR is the name or key or path of the volume to wipe. It is possible to choose different wiping algorithms instead of re-writing volume with zeroes. This can be done via \fI\-\-algorithm\fR switch. .Sp \&\fBSupported algorithms\fR zero \- 1\-pass all zeroes nnsa \- 4\-pass \s-1NNSA\s0 Policy Letter \s-1NAP\-14.1\-C \s0(\s-1XVI\-8\s0) for sanitizing removable and non-removable hard disks: random x2, 0x00, verify. dod \- 4\-pass DoD 5220.22\-M section 8\-306 procedure for sanitizing removable and non-removable rigid disks: random, 0x00, 0xff, verify. bsi \- 9\-pass method recommended by the German Center of Security in Information Technologies (http://www.bsi.bund.de): 0xff, 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f. gutmann \- The canonical 35\-pass sequence described in Gutmann's paper. schneier \- 7\-pass method described by Bruce Schneier in \*(L"Applied Cryptography\*(R" (1996): 0x00, 0xff, random x5. pfitzner7 \- Roy Pfitzner's 7\-random\-pass method: random x7. pfitzner33 \- Roy Pfitzner's 33\-random\-pass method: random x33. random \- 1\-pass pattern: random. trim \- 1\-pass trimming the volume using \s-1TRIM\s0 or \s-1DISCARD\s0 .Sp \&\fBNote\fR: The \f(CW\*(C`scrub\*(C'\fR binary will be used to handle the 'nnsa', 'dod', \&'bsi', 'gutmann', 'schneier', 'pfitzner7' and 'pfitzner33' algorithms. The availability of the algorithms may be limited by the version of the \f(CW\*(C`scrub\*(C'\fR binary installed on the host. The 'zero' algorithm will write zeroes to the entire volume. For some volumes, such as sparse or rbd volumes, this may result in completely filling the volume with zeroes making it appear to be completely full. As an alternative, the \&'trim' algorithm does not overwrite all the data in a volume, rather it expects the storage driver to be able to discard all bytes in a volume. It is up to the storage driver to handle how the discarding occurs. Not all storage drivers or volume types can support 'trim'. .IP "\fBvol-dumpxml\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] \fIvol-name-or-key-or-path\fR" 4 .IX Item "vol-dumpxml [--pool pool-or-uuid] vol-name-or-key-or-path" Output the volume information as an \s-1XML\s0 dump to stdout. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \fIvol-name-or-key-or-path\fR is the name or key or path of the volume to output the \s-1XML\s0 of. .IP "\fBvol-info\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] \fIvol-name-or-key-or-path\fR [\fI\-\-bytes\fR] [\fI\-\-physical\fR]" 4 .IX Item "vol-info [--pool pool-or-uuid] vol-name-or-key-or-path [--bytes] [--physical]" Returns basic information about the given storage volume. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \fIvol-name-or-key-or-path\fR is the name or key or path of the volume to return information for. If \fI\-\-bytes\fR is specified the sizes are not converted to human friendly units. If \fI\-\-physical\fR is specified, then the host physical size is returned and displayed instead of the allocation value. The physical value for some file types, such as qcow2 may have a different (larger) physical value than is shown for allocation. Additionally sparse files will have different physical and allocation values. .IP "\fBvol-list\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] [\fI\-\-details\fR]" 4 .IX Item "vol-list [--pool pool-or-uuid] [--details]" Return the list of volumes in the given storage pool. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool. The \fI\-\-details\fR option instructs virsh to additionally display volume type and capacity related information where available. .IP "\fBvol-pool\fR [\fI\-\-uuid\fR] \fIvol-key-or-path\fR" 4 .IX Item "vol-pool [--uuid] vol-key-or-path" Return the pool name or \s-1UUID\s0 for a given volume. By default, the pool name is returned. If the \fI\-\-uuid\fR option is given, the pool \s-1UUID\s0 is returned instead. \&\fIvol-key-or-path\fR is the key or path of the volume to return the pool information for. .IP "\fBvol-path\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] \fIvol-name-or-key\fR" 4 .IX Item "vol-path [--pool pool-or-uuid] vol-name-or-key" Return the path for a given volume. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \&\fIvol-name-or-key\fR is the name or key of the volume to return the path for. .IP "\fBvol-name\fR \fIvol-key-or-path\fR" 4 .IX Item "vol-name vol-key-or-path" Return the name for a given volume. \&\fIvol-key-or-path\fR is the key or path of the volume to return the name for. .IP "\fBvol-key\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] \fIvol-name-or-path\fR" 4 .IX Item "vol-key [--pool pool-or-uuid] vol-name-or-path" Return the volume key for a given volume. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \fIvol-name-or-path\fR is the name or path of the volume to return the volume key for. .IP "\fBvol-resize\fR [\fI\-\-pool\fR \fIpool-or-uuid\fR] \fIvol-name-or-path\fR \fIpool-or-uuid\fR \fIcapacity\fR [\fI\-\-allocate\fR] [\fI\-\-delta\fR] [\fI\-\-shrink\fR]" 4 .IX Item "vol-resize [--pool pool-or-uuid] vol-name-or-path pool-or-uuid capacity [--allocate] [--delta] [--shrink]" Resize the capacity of the given volume, in bytes. \&\fI\-\-pool\fR \fIpool-or-uuid\fR is the name or \s-1UUID\s0 of the storage pool the volume is in. \fIvol-name-or-key-or-path\fR is the name or key or path of the volume to resize. The new capacity might be sparse unless \fI\-\-allocate\fR is specified. Normally, \fIcapacity\fR is the new size, but if \fI\-\-delta\fR is present, then it is added to the existing size. Attempts to shrink the volume will fail unless \fI\-\-shrink\fR is present; \fIcapacity\fR cannot be negative unless \fI\-\-shrink\fR is provided, but a negative sign is not necessary. \fIcapacity\fR is a scaled integer (see \fB\s-1NOTES\s0\fR above), which defaults to bytes if there is no suffix. This command is only safe for storage volumes not in use by an active guest; see also \&\fBblockresize\fR for live resizing. .SH "SECRET COMMANDS" .IX Header "SECRET COMMANDS" The following commands manipulate \*(L"secrets\*(R" (e.g. passwords, passphrases and encryption keys). Libvirt can store secrets independently from their use, and other objects (e.g. volumes or domains) can refer to the secrets for encryption or possibly other uses. Secrets are identified using a \s-1UUID. \s0 See for documentation of the \s-1XML\s0 format used to represent properties of secrets. .IP "\fBsecret-define\fR \fIfile\fR" 4 .IX Item "secret-define file" Create a secret with the properties specified in \fIfile\fR, with no associated secret value. If \fIfile\fR does not specify a \s-1UUID,\s0 choose one automatically. If \fIfile\fR specifies a \s-1UUID\s0 of an existing secret, replace its properties by properties defined in \fIfile\fR, without affecting the secret value. .IP "\fBsecret-dumpxml\fR \fIsecret\fR" 4 .IX Item "secret-dumpxml secret" Output properties of \fIsecret\fR (specified by its \s-1UUID\s0) as an \s-1XML\s0 dump to stdout. .IP "\fBsecret-event\fR {[\fIsecret\fR] \fIevent\fR [\fI\-\-loop\fR] [\fI\-\-timeout\fR \fIseconds\fR] [\fI\-\-timestamp\fR] | \fI\-\-list\fR}" 4 .IX Item "secret-event {[secret] event [--loop] [--timeout seconds] [--timestamp] | --list}" Wait for a class of secret events to occur, and print appropriate details of events as they happen. The events can optionally be filtered by \&\fIsecret\fR. Using \fI\-\-list\fR as the only argument will provide a list of possible \fIevent\fR values known by this client, although the connection might not allow registering for all these events. .Sp By default, this command is one-shot, and returns success once an event occurs; you can send \s-1SIGINT \s0(usually via \f(CW\*(C`Ctrl\-C\*(C'\fR) to quit immediately. If \fI\-\-timeout\fR is specified, the command gives up waiting for events after \fIseconds\fR have elapsed. With \fI\-\-loop\fR, the command prints all events until a timeout or interrupt key. .Sp When \fI\-\-timestamp\fR is used, a human-readable timestamp will be printed before the event. .IP "\fBsecret-set-value\fR \fIsecret\fR \fIbase64\fR" 4 .IX Item "secret-set-value secret base64" Set the value associated with \fIsecret\fR (specified by its \s-1UUID\s0) to the value Base64\-encoded value \fIbase64\fR. .IP "\fBsecret-get-value\fR \fIsecret\fR" 4 .IX Item "secret-get-value secret" Output the value associated with \fIsecret\fR (specified by its \s-1UUID\s0) to stdout, encoded using Base64. .IP "\fBsecret-undefine\fR \fIsecret\fR" 4 .IX Item "secret-undefine secret" Delete a \fIsecret\fR (specified by its \s-1UUID\s0), including the associated value, if any. .IP "\fBsecret-list\fR [\fI\-\-ephemeral\fR] [\fI\-\-no\-ephemeral\fR] [\fI\-\-private\fR] [\fI\-\-no\-private\fR]" 4 .IX Item "secret-list [--ephemeral] [--no-ephemeral] [--private] [--no-private]" Returns the list of secrets. You may also want to filter the returned secrets by \fI\-\-ephemeral\fR to list the ephemeral ones, \fI\-\-no\-ephemeral\fR to list the non-ephemeral ones, \fI\-\-private\fR to list the private ones, and \&\fI\-\-no\-private\fR to list the non-private ones. .SH "SNAPSHOT COMMANDS" .IX Header "SNAPSHOT COMMANDS" The following commands manipulate domain snapshots. Snapshots take the disk, memory, and device state of a domain at a point-of-time, and save it for future use. They have many uses, from saving a \*(L"clean\*(R" copy of an \s-1OS\s0 image to saving a domain's state before a potentially destructive operation. Snapshots are identified with a unique name. See for documentation of the \s-1XML\s0 format used to represent properties of snapshots. .IP "\fBsnapshot-create\fR \fIdomain\fR [\fIxmlfile\fR] {[\fI\-\-redefine\fR [\fI\-\-current\fR]] | [\fI\-\-no\-metadata\fR] [\fI\-\-halt\fR] [\fI\-\-disk\-only\fR] [\fI\-\-reuse\-external\fR] [\fI\-\-quiesce\fR] [\fI\-\-atomic\fR] [\fI\-\-live\fR]}" 4 .IX Item "snapshot-create domain [xmlfile] {[--redefine [--current]] | [--no-metadata] [--halt] [--disk-only] [--reuse-external] [--quiesce] [--atomic] [--live]}" Create a snapshot for domain \fIdomain\fR with the properties specified in \&\fIxmlfile\fR. Normally, the only properties settable for a domain snapshot are the and elements, as well as if \&\fI\-\-disk\-only\fR is given; the rest of the fields are ignored, and automatically filled in by libvirt. If \fIxmlfile\fR is completely omitted, then libvirt will choose a value for all fields. The new snapshot will become current, as listed by \fBsnapshot-current\fR. .Sp If \fI\-\-halt\fR is specified, the domain will be left in an inactive state after the snapshot is created. .Sp If \fI\-\-disk\-only\fR is specified, the snapshot will only include disk state rather than the usual system checkpoint with vm state. Disk snapshots are faster than full system checkpoints, but reverting to a disk snapshot may require fsck or journal replays, since it is like the disk state at the point when the power cord is abruptly pulled; and mixing \fI\-\-halt\fR and \fI\-\-disk\-only\fR loses any data that was not flushed to disk at the time. .Sp If \fI\-\-redefine\fR is specified, then all \s-1XML\s0 elements produced by \&\fBsnapshot-dumpxml\fR are valid; this can be used to migrate snapshot hierarchy from one machine to another, to recreate hierarchy for the case of a transient domain that goes away and is later recreated with the same name and \s-1UUID,\s0 or to make slight alterations in the snapshot metadata (such as host-specific aspects of the domain \s-1XML\s0 embedded in the snapshot). When this flag is supplied, the \fIxmlfile\fR argument is mandatory, and the domain's current snapshot will not be altered unless the \fI\-\-current\fR flag is also given. .Sp If \fI\-\-no\-metadata\fR is specified, then the snapshot data is created, but any metadata is immediately discarded (that is, libvirt does not treat the snapshot as current, and cannot revert to the snapshot unless \fI\-\-redefine\fR is later used to teach libvirt about the metadata again). .Sp If \fI\-\-reuse\-external\fR is specified, and the snapshot \s-1XML\s0 requests an external snapshot with a destination of an existing file, then the destination must exist and be pre-created with correct format and metadata. The file is then reused; otherwise, a snapshot is refused to avoid losing contents of the existing files. .Sp If \fI\-\-quiesce\fR is specified, libvirt will try to use guest agent to freeze and unfreeze domain's mounted file systems. However, if domain has no guest agent, snapshot creation will fail. Currently, this requires \fI\-\-disk\-only\fR to be passed as well. .Sp If \fI\-\-atomic\fR is specified, libvirt will guarantee that the snapshot either succeeds, or fails with no changes; not all hypervisors support this. If this flag is not specified, then some hypervisors may fail after partially performing the action, and \fBdumpxml\fR must be used to see whether any partial changes occurred. .Sp If \fI\-\-live\fR is specified, libvirt takes the snapshot (checkpoint) while the guest is running. Both disk snapshot and domain memory snapshot are taken. This increases the size of the memory image of the external checkpoint. This is currently supported only for external checkpoints. .Sp Existence of snapshot metadata will prevent attempts to \fBundefine\fR a persistent domain. However, for transient domains, snapshot metadata is silently lost when the domain quits running (whether by command such as \fBdestroy\fR or by internal guest action). .IP "\fBsnapshot-create-as\fR \fIdomain\fR {[\fI\-\-print\-xml\fR] | [\fI\-\-no\-metadata\fR] [\fI\-\-halt\fR] [\fI\-\-reuse\-external\fR]} [\fIname\fR] [\fIdescription\fR] [\fI\-\-disk\-only\fR [\fI\-\-quiesce\fR]] [\fI\-\-atomic\fR] [[\fI\-\-live\fR] [\fI\-\-memspec\fR \fBmemspec\fR]] [\fI\-\-diskspec\fR] \fBdiskspec\fR]..." 4 .IX Item "snapshot-create-as domain {[--print-xml] | [--no-metadata] [--halt] [--reuse-external]} [name] [description] [--disk-only [--quiesce]] [--atomic] [[--live] [--memspec memspec]] [--diskspec] diskspec]..." Create a snapshot for domain \fIdomain\fR with the given and ; if either value is omitted, libvirt will choose a value. If \fI\-\-print\-xml\fR is specified, then \s-1XML\s0 appropriate for \&\fIsnapshot-create\fR is output, rather than actually creating a snapshot. Otherwise, if \fI\-\-halt\fR is specified, the domain will be left in an inactive state after the snapshot is created, and if \fI\-\-disk\-only\fR is specified, the snapshot will not include vm state. .Sp The \fI\-\-memspec\fR option can be used to control whether a checkpoint is internal or external. The \fI\-\-memspec\fR flag is mandatory, followed by a \fBmemspec\fR of the form \fB[file=]name[,snapshot=type]\fR, where type can be \fBno\fR, \fBinternal\fR, or \fBexternal\fR. To include a literal comma in \fBfile=name\fR, escape it with a second comma. \fI\-\-memspec\fR cannot be used together with \fI\-\-disk\-only\fR. .Sp The \fI\-\-diskspec\fR option can be used to control how \fI\-\-disk\-only\fR and external checkpoints create external files. This option can occur multiple times, according to the number of elements in the domain xml. Each is in the form \fBdisk[,snapshot=type][,driver=type][,file=name]\fR. A \fIdiskspec\fR must be provided for disks backed by block devices as libvirt doesn't auto-generate file names for those. To include a literal comma in \fBdisk\fR or in \fBfile=name\fR, escape it with a second comma. A literal \fI\-\-diskspec\fR must precede each \fBdiskspec\fR unless all three of \fIdomain\fR, \fIname\fR, and \fIdescription\fR are also present. For example, a diskspec of \*(L"vda,snapshot=external,file=/path/to,,new\*(R" results in the following \s-1XML: \s0 .Sp If \fI\-\-reuse\-external\fR is specified, and the domain \s-1XML\s0 or \fIdiskspec\fR option requests an external snapshot with a destination of an existing file, then the destination must exist and be pre-created with correct format and metadata. The file is then reused; otherwise, a snapshot is refused to avoid losing contents of the existing files. .Sp If \fI\-\-quiesce\fR is specified, libvirt will try to use guest agent to freeze and unfreeze domain's mounted file systems. However, if domain has no guest agent, snapshot creation will fail. Currently, this requires \fI\-\-disk\-only\fR to be passed as well. .Sp If \fI\-\-no\-metadata\fR is specified, then the snapshot data is created, but any metadata is immediately discarded (that is, libvirt does not treat the snapshot as current, and cannot revert to the snapshot unless \fBsnapshot-create\fR is later used to teach libvirt about the metadata again). This flag is incompatible with \fI\-\-print\-xml\fR. .Sp If \fI\-\-atomic\fR is specified, libvirt will guarantee that the snapshot either succeeds, or fails with no changes; not all hypervisors support this. If this flag is not specified, then some hypervisors may fail after partially performing the action, and \fBdumpxml\fR must be used to see whether any partial changes occurred. .Sp If \fI\-\-live\fR is specified, libvirt takes the snapshot while the guest is running. This increases the size of the memory image of the external checkpoint. This is currently supported only for external checkpoints. .IP "\fBsnapshot-current\fR \fIdomain\fR {[\fI\-\-name\fR] | [\fI\-\-security\-info\fR] | [\fIsnapshotname\fR]}" 4 .IX Item "snapshot-current domain {[--name] | [--security-info] | [snapshotname]}" Without \fIsnapshotname\fR, this will output the snapshot \s-1XML\s0 for the domain's current snapshot (if any). If \fI\-\-name\fR is specified, just the current snapshot name instead of the full xml. Otherwise, using \&\fI\-\-security\-info\fR will also include security sensitive information in the \s-1XML.\s0 .Sp With \fIsnapshotname\fR, this is a request to make the existing named snapshot become the current snapshot, without reverting the domain. .IP "\fBsnapshot-edit\fR \fIdomain\fR [\fIsnapshotname\fR] [\fI\-\-current\fR] {[\fI\-\-rename\fR] | [\fI\-\-clone\fR]}" 4 .IX Item "snapshot-edit domain [snapshotname] [--current] {[--rename] | [--clone]}" Edit the \s-1XML\s0 configuration file for \fIsnapshotname\fR of a domain. If both \fIsnapshotname\fR and \fI\-\-current\fR are specified, also force the edited snapshot to become the current snapshot. If \fIsnapshotname\fR is omitted, then \fI\-\-current\fR must be supplied, to edit the current snapshot. .Sp This is equivalent to: .Sp .Vb 3 \& virsh snapshot\-dumpxml dom name > snapshot.xml \& vi snapshot.xml (or make changes with your other text editor) \& virsh snapshot\-create dom snapshot.xml \-\-redefine [\-\-current] .Ve .Sp except that it does some error checking. .Sp The editor used can be supplied by the \f(CW$VISUAL\fR or \f(CW$EDITOR\fR environment variables, and defaults to \f(CW\*(C`vi\*(C'\fR. .Sp If \fI\-\-rename\fR is specified, then the edits can change the snapshot name. If \fI\-\-clone\fR is specified, then changing the snapshot name will create a clone of the snapshot metadata. If neither is specified, then the edits must not change the snapshot name. Note that changing a snapshot name must be done with care, since the contents of some snapshots, such as internal snapshots within a single qcow2 file, are accessible only from the original name. .IP "\fBsnapshot-info\fR \fIdomain\fR {\fIsnapshot\fR | \fI\-\-current\fR}" 4 .IX Item "snapshot-info domain {snapshot | --current}" Output basic information about a named , or the current snapshot with \fI\-\-current\fR. .IP "\fBsnapshot-list\fR \fIdomain\fR [\fI\-\-metadata\fR] [\fI\-\-no\-metadata\fR] [{\fI\-\-parent\fR | \fI\-\-roots\fR | [{\fI\-\-tree\fR | \fI\-\-name\fR}]}] [{[\fI\-\-from\fR] \fBsnapshot\fR | \fI\-\-current\fR} [\fI\-\-descendants\fR]] [\fI\-\-leaves\fR] [\fI\-\-no\-leaves\fR] [\fI\-\-inactive\fR] [\fI\-\-active\fR] [\fI\-\-disk\-only\fR] [\fI\-\-internal\fR] [\fI\-\-external\fR]" 4 .IX Item "snapshot-list domain [--metadata] [--no-metadata] [{--parent | --roots | [{--tree | --name}]}] [{[--from] snapshot | --current} [--descendants]] [--leaves] [--no-leaves] [--inactive] [--active] [--disk-only] [--internal] [--external]" List all of the available snapshots for the given domain, defaulting to show columns for the snapshot name, creation time, and domain state. .Sp If \fI\-\-parent\fR is specified, add a column to the output table giving the name of the parent of each snapshot. If \fI\-\-roots\fR is specified, the list will be filtered to just snapshots that have no parents. If \fI\-\-tree\fR is specified, the output will be in a tree format, listing just snapshot names. These three options are mutually exclusive. If \&\fI\-\-name\fR is specified only the snapshot name is printed. This option is mutually exclusive with \fI\-\-tree\fR. .Sp If \fI\-\-from\fR is provided, filter the list to snapshots which are children of the given \fBsnapshot\fR; or if \fI\-\-current\fR is provided, start at the current snapshot. When used in isolation or with \&\fI\-\-parent\fR, the list is limited to direct children unless \&\fI\-\-descendants\fR is also present. When used with \fI\-\-tree\fR, the use of \fI\-\-descendants\fR is implied. This option is not compatible with \fI\-\-roots\fR. Note that the starting point of \fI\-\-from\fR or \&\fI\-\-current\fR is not included in the list unless the \fI\-\-tree\fR option is also present. .Sp If \fI\-\-leaves\fR is specified, the list will be filtered to just snapshots that have no children. Likewise, if \fI\-\-no\-leaves\fR is specified, the list will be filtered to just snapshots with children. (Note that omitting both options does no filtering, while providing both options will either produce the same list or error out depending on whether the server recognizes the flags). Filtering options are not compatible with \fI\-\-tree\fR. .Sp If \fI\-\-metadata\fR is specified, the list will be filtered to just snapshots that involve libvirt metadata, and thus would prevent \&\fBundefine\fR of a persistent domain, or be lost on \fBdestroy\fR of a transient domain. Likewise, if \fI\-\-no\-metadata\fR is specified, the list will be filtered to just snapshots that exist without the need for libvirt metadata. .Sp If \fI\-\-inactive\fR is specified, the list will be filtered to snapshots that were taken when the domain was shut off. If \fI\-\-active\fR is specified, the list will be filtered to snapshots that were taken when the domain was running, and where the snapshot includes the memory state to revert to that running state. If \fI\-\-disk\-only\fR is specified, the list will be filtered to snapshots that were taken when the domain was running, but where the snapshot includes only disk state. .Sp If \fI\-\-internal\fR is specified, the list will be filtered to snapshots that use internal storage of existing disk images. If \fI\-\-external\fR is specified, the list will be filtered to snapshots that use external files for disk images or memory state. .IP "\fBsnapshot-dumpxml\fR \fIdomain\fR \fIsnapshot\fR [\fI\-\-security\-info\fR]" 4 .IX Item "snapshot-dumpxml domain snapshot [--security-info]" Output the snapshot \s-1XML\s0 for the domain's snapshot named \fIsnapshot\fR. Using \fI\-\-security\-info\fR will also include security sensitive information. Use \fBsnapshot-current\fR to easily access the \s-1XML\s0 of the current snapshot. .IP "\fBsnapshot-parent\fR \fIdomain\fR {\fIsnapshot\fR | \fI\-\-current\fR}" 4 .IX Item "snapshot-parent domain {snapshot | --current}" Output the name of the parent snapshot, if any, for the given \&\fIsnapshot\fR, or for the current snapshot with \fI\-\-current\fR. .IP "\fBsnapshot-revert\fR \fIdomain\fR {\fIsnapshot\fR | \fI\-\-current\fR} [{\fI\-\-running\fR | \fI\-\-paused\fR}] [\fI\-\-force\fR]" 4 .IX Item "snapshot-revert domain {snapshot | --current} [{--running | --paused}] [--force]" Revert the given domain to the snapshot specified by \fIsnapshot\fR, or to the current snapshot with \fI\-\-current\fR. Be aware that this is a destructive action; any changes in the domain since the last snapshot was taken will be lost. Also note that the state of the domain after snapshot-revert is complete will be the state of the domain at the time the original snapshot was taken. .Sp Normally, reverting to a snapshot leaves the domain in the state it was at the time the snapshot was created, except that a disk snapshot with no vm state leaves the domain in an inactive state. Passing either the \&\fI\-\-running\fR or \fI\-\-paused\fR flag will perform additional state changes (such as booting an inactive domain, or pausing a running domain). Since transient domains cannot be inactive, it is required to use one of these flags when reverting to a disk snapshot of a transient domain. .Sp There are two cases where a snapshot revert involves extra risk, which requires the use of \fI\-\-force\fR to proceed. One is the case of a snapshot that lacks full domain information for reverting configuration (such as snapshots created prior to libvirt 0.9.5); since libvirt cannot prove that the current configuration matches what was in use at the time of the snapshot, supplying \fI\-\-force\fR assures libvirt that the snapshot is compatible with the current configuration (and if it is not, the domain will likely fail to run). The other is the case of reverting from a running domain to an active state where a new hypervisor has to be created rather than reusing the existing hypervisor, because it implies drawbacks such as breaking any existing \&\s-1VNC\s0 or Spice connections; this condition happens with an active snapshot that uses a provably incompatible configuration, as well as with an inactive snapshot that is combined with the \fI\-\-start\fR or \&\fI\-\-pause\fR flag. .IP "\fBsnapshot-delete\fR \fIdomain\fR {\fIsnapshot\fR | \fI\-\-current\fR} [\fI\-\-metadata\fR] [{\fI\-\-children\fR | \fI\-\-children\-only\fR}]" 4 .IX Item "snapshot-delete domain {snapshot | --current} [--metadata] [{--children | --children-only}]" Delete the snapshot for the domain named \fIsnapshot\fR, or the current snapshot with \fI\-\-current\fR. If this snapshot has child snapshots, changes from this snapshot will be merged into the children. If \fI\-\-children\fR is passed, then delete this snapshot and any children of this snapshot. If \fI\-\-children\-only\fR is passed, then delete any children of this snapshot, but leave this snapshot intact. These two flags are mutually exclusive. .Sp If \fI\-\-metadata\fR is specified, then only delete the snapshot metadata maintained by libvirt, while leaving the snapshot contents intact for access by external tools; otherwise deleting a snapshot also removes the data contents from that point in time. .SH "NWFILTER COMMANDS" .IX Header "NWFILTER COMMANDS" The following commands manipulate network filters. Network filters allow filtering of the network traffic coming from and going to virtual machines. Individual network traffic filters are written in \s-1XML\s0 and may contain references to other network filters, describe traffic filtering rules, or contain both. Network filters are referenced by virtual machines from within their interface description. A network filter may be referenced by multiple virtual machines' interfaces. .IP "\fBnwfilter-define\fR \fIxmlfile\fR" 4 .IX Item "nwfilter-define xmlfile" Make a new network filter known to libvirt. If a network filter with the same name already exists, it will be replaced with the new \s-1XML.\s0 Any running virtual machine referencing this network filter will have its network traffic rules adapted. If for any reason the network traffic filtering rules cannot be instantiated by any of the running virtual machines, then the new \s-1XML\s0 will be rejected. .IP "\fBnwfilter-undefine\fR \fInwfilter-name\fR" 4 .IX Item "nwfilter-undefine nwfilter-name" Delete a network filter. The deletion will fail if any running virtual machine is currently using this network filter. .IP "\fBnwfilter-list\fR" 4 .IX Item "nwfilter-list" List all of the available network filters. .IP "\fBnwfilter-dumpxml\fR \fInwfilter-name\fR" 4 .IX Item "nwfilter-dumpxml nwfilter-name" Output the network filter \s-1XML.\s0 .IP "\fBnwfilter-edit\fR \fInwfilter-name\fR" 4 .IX Item "nwfilter-edit nwfilter-name" Edit the \s-1XML\s0 of a network filter. .Sp This is equivalent to: .Sp .Vb 3 \& virsh nwfilter\-dumpxml myfilter > myfilter.xml \& vi myfilter.xml (or make changes with your other text editor) \& virsh nwfilter\-define myfilter.xml .Ve .Sp except that it does some error checking. The new network filter may be rejected due to the same reason as mentioned in \fInwfilter-define\fR. .Sp The editor used can be supplied by the \f(CW$VISUAL\fR or \f(CW$EDITOR\fR environment variables, and defaults to \f(CW\*(C`vi\*(C'\fR. .SH "HYPERVISOR-SPECIFIC COMMANDS" .IX Header "HYPERVISOR-SPECIFIC COMMANDS" \&\s-1NOTE:\s0 Use of the following commands is \fBstrongly\fR discouraged. They can cause libvirt to become confused and do the wrong thing on subsequent operations. Once you have used these commands, please do not report problems to the libvirt developers; the reports will be ignored. If you find that these commands are the only way to accomplish something, then it is better to request that the feature be added as a first-class citizen in the regular libvirt library. .IP "\fBqemu-attach\fR \fIpid\fR" 4 .IX Item "qemu-attach pid" Attach an externally launched \s-1QEMU\s0 process to the libvirt \s-1QEMU\s0 driver. The \s-1QEMU\s0 process must have been created with a monitor connection using the \s-1UNIX\s0 driver. Ideally the process will also have had the \&'\-name' argument specified. .RS 4 .Sp .Vb 6 \& $ qemu\-kvm \-cdrom ~/demo.iso \e \& \-monitor unix:/tmp/demo,server,nowait \e \& \-name foo \e \& \-uuid cece4f9f\-dff0\-575d\-0e8e\-01fe380f12ea & \& $ QEMUPID=$! \& $ virsh qemu\-attach $QEMUPID .Ve .RE .RS 4 .Sp Not all functions of libvirt are expected to work reliably after attaching to an externally launched \s-1QEMU\s0 process. There may be issues with the guest \s-1ABI\s0 changing upon migration and device hotplug or hotunplug may not work. The attached environment should be considered primarily read-only. .RE .IP "\fBqemu-monitor-command\fR \fIdomain\fR { [\fI\-\-hmp\fR] | [\fI\-\-pretty\fR] } \fIcommand\fR..." 4 .IX Item "qemu-monitor-command domain { [--hmp] | [--pretty] } command..." Send an arbitrary monitor command \fIcommand\fR to domain \fIdomain\fR through the qemu monitor. The results of the command will be printed on stdout. If \&\fI\-\-hmp\fR is passed, the command is considered to be a human monitor command and libvirt will automatically convert it into \s-1QMP\s0 if needed. In that case the result will also be converted back from \s-1QMP. \s0 If \fI\-\-pretty\fR is given, and the monitor uses \s-1QMP,\s0 then the output will be pretty-printed. If more than one argument is provided for \fIcommand\fR, they are concatenated with a space in between before passing the single command to the monitor. .IP "\fBqemu-agent-command\fR \fIdomain\fR [\fI\-\-timeout\fR \fIseconds\fR | \fI\-\-async\fR | \fI\-\-block\fR] \fIcommand\fR..." 4 .IX Item "qemu-agent-command domain [--timeout seconds | --async | --block] command..." Send an arbitrary guest agent command \fIcommand\fR to domain \fIdomain\fR through qemu agent. \&\fI\-\-timeout\fR, \fI\-\-async\fR and \fI\-\-block\fR options are exclusive. \&\fI\-\-timeout\fR requires timeout seconds \fIseconds\fR and it must be positive. When \fI\-\-aysnc\fR is given, the command waits for timeout whether success or failed. And when \fI\-\-block\fR is given, the command waits forever with blocking timeout. .IP "\fBqemu-monitor-event\fR [\fIdomain\fR] [\fI\-\-event\fR \fIevent-name\fR] [\fI\-\-loop\fR] [\fI\-\-timeout\fR \fIseconds\fR] [\fI\-\-pretty\fR] [\fI\-\-regex\fR] [\fI\-\-no\-case\fR] [\fI\-\-timestamp\fR]" 4 .IX Item "qemu-monitor-event [domain] [--event event-name] [--loop] [--timeout seconds] [--pretty] [--regex] [--no-case] [--timestamp]" Wait for arbitrary \s-1QEMU\s0 monitor events to occur, and print out the details of events as they happen. The events can optionally be filtered by \fIdomain\fR or \fIevent-name\fR. The 'query\-events' \s-1QMP\s0 command can be used via \fIqemu-monitor-command\fR to learn what events are supported. If \fI\-\-regex\fR is used, \fIevent-name\fR is a basic regular expression instead of a literal string. If \fI\-\-no\-case\fR is used, \fIevent-name\fR will match case-insensitively. .Sp By default, this command is one-shot, and returns success once an event occurs; you can send \s-1SIGINT \s0(usually via \f(CW\*(C`Ctrl\-C\*(C'\fR) to quit immediately. If \fI\-\-timeout\fR is specified, the command gives up waiting for events after \fIseconds\fR have elapsed. With \fI\-\-loop\fR, the command prints all events until a timeout or interrupt key. If \fI\-\-pretty\fR is specified, any \s-1JSON\s0 event details are pretty-printed for better legibility. .Sp When \fI\-\-timestamp\fR is used, a human-readable timestamp will be printed before the event, and the timing information provided by \s-1QEMU\s0 will be omitted. .IP "\fBlxc-enter-namespace\fR \fIdomain\fR [\fI\-\-noseclabel\fR] \*(-- /path/to/binary [arg1, [arg2, ...]]" 4 .IX Item "lxc-enter-namespace domain [--noseclabel] /path/to/binary [arg1, [arg2, ...]]" Enter the namespace of \fIdomain\fR and execute the command \f(CW\*(C`/path/to/binary\*(C'\fR passing the requested args. The binary path is relative to the container root filesystem, not the host root filesystem. The binary will inherit the environment variables / console visible to virsh. The command will be run with the same sVirt context and cgroups placement as processes within the container. This command only works when connected to the \s-1LXC\s0 hypervisor driver. This command succeeds only if \f(CW\*(C`/path/to/binary\*(C'\fR has 0 exit status. .Sp By default the new process will run with the security label of the new parent container. Use the \fI\-\-noseclabel\fR option to instead have the process keep the same security label as \f(CW\*(C`virsh\*(C'\fR. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" The following environment variables can be set to alter the behaviour of \f(CW\*(C`virsh\*(C'\fR .IP "VIRSH_DEBUG=<0 to 4>" 4 .IX Item "VIRSH_DEBUG=<0 to 4>" Turn on verbose debugging of virsh commands. Valid levels are .RS 4 .IP "\(bu" 4 VIRSH_DEBUG=0 .Sp \&\s-1DEBUG \-\s0 Messages at \s-1ALL\s0 levels get logged .IP "\(bu" 4 VIRSH_DEBUG=1 .Sp \&\s-1INFO \-\s0 Logs messages at levels \s-1INFO, NOTICE, WARNING\s0 and \s-1ERROR\s0 .IP "\(bu" 4 VIRSH_DEBUG=2 .Sp \&\s-1NOTICE \-\s0 Logs messages at levels \s-1NOTICE, WARNING\s0 and \s-1ERROR\s0 .IP "\(bu" 4 VIRSH_DEBUG=3 .Sp \&\s-1WARNING \-\s0 Logs messages at levels \s-1WARNING\s0 and \s-1ERROR\s0 .IP "\(bu" 4 VIRSH_DEBUG=4 .Sp \&\s-1ERROR \-\s0 Messages at only \s-1ERROR\s0 level gets logged. .RE .RS 4 .RE .ie n .IP "VIRSH_LOG_FILE=""LOGFILE""" 4 .el .IP "VIRSH_LOG_FILE=\f(CWLOGFILE\fR" 4 .IX Item "VIRSH_LOG_FILE=LOGFILE" The file to log virsh debug messages. .IP "\s-1VIRSH_DEFAULT_CONNECT_URI\s0" 4 .IX Item "VIRSH_DEFAULT_CONNECT_URI" The hypervisor to connect to by default. Set this to a \s-1URI,\s0 in the same format as accepted by the \fBconnect\fR option. This environment variable is deprecated in favour of the global \fB\s-1LIBVIRT_DEFAULT_URI\s0\fR variable which serves the same purpose. .IP "\s-1LIBVIRT_DEFAULT_URI\s0" 4 .IX Item "LIBVIRT_DEFAULT_URI" The hypervisor to connect to by default. Set this to a \s-1URI,\s0 in the same format as accepted by the \fBconnect\fR option. This overrides the default \s-1URI\s0 set in any client config file and prevents libvirt from probing for drivers. .IP "\s-1VISUAL\s0" 4 .IX Item "VISUAL" The editor to use by the \fBedit\fR and related options. .IP "\s-1EDITOR\s0" 4 .IX Item "EDITOR" The editor to use by the \fBedit\fR and related options, if \f(CW\*(C`VISUAL\*(C'\fR is not set. .IP "\s-1VIRSH_HISTSIZE\s0" 4 .IX Item "VIRSH_HISTSIZE" The number of commands to remember in the command history. The default value is 500. .IP "LIBVIRT_DEBUG=LEVEL" 4 .IX Item "LIBVIRT_DEBUG=LEVEL" Turn on verbose debugging of all libvirt \s-1API\s0 calls. Valid levels are .RS 4 .IP "\(bu" 4 LIBVIRT_DEBUG=1 .Sp Messages at level \s-1DEBUG\s0 or above .IP "\(bu" 4 LIBVIRT_DEBUG=2 .Sp Messages at level \s-1INFO\s0 or above .IP "\(bu" 4 LIBVIRT_DEBUG=3 .Sp Messages at level \s-1WARNING\s0 or above .IP "\(bu" 4 LIBVIRT_DEBUG=4 .Sp Messages at level \s-1ERROR\s0 or above .RE .RS 4 .Sp For further information about debugging options consult .RE .SH "BUGS" .IX Header "BUGS" Report any bugs discovered to the libvirt community via the mailing list or bug tracker . Alternatively report bugs to your software distributor / vendor. .SH "AUTHORS" .IX Header "AUTHORS" .Vb 1 \& Please refer to the AUTHORS file distributed with libvirt. \& \& Based on the xm man page by: \& Sean Dague \& Daniel Stekloff .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2005, 2007\-2015 Red Hat, Inc., and the authors listed in the libvirt \s-1AUTHORS\s0 file. .SH "LICENSE" .IX Header "LICENSE" virsh is distributed under the terms of the \s-1GNU LGPL\s0 v2+. This is free software; see the source for copying conditions. There is \s-1NO\s0 warranty; not even for \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE\s0 .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIvirt\-install\fR\|(1), \fIvirt\-xml\-validate\fR\|(1), \fIvirt\-top\fR\|(1), \fIvirt\-df\fR\|(1),