.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "VIRSH" "1" "" "" "Virtualization Support" .SH NAME virsh \- management user interface .SH SYNOPSIS .sp \fBvirsh\fP [\fIOPTION\fP]... [\fICOMMAND_STRING\fP] .sp \fBvirsh\fP [\fIOPTION\fP]... \fICOMMAND\fP [\fIARG\fP]... .SH DESCRIPTION .sp The \fBvirsh\fP 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 GNU 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 API. It currently supports Xen, QEMU, KVM, LXC, OpenVZ, VirtualBox and VMware ESX. .sp The basic structure of most virsh usage is: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh [OPTION]... [ARG]... .EE .UNINDENT .UNINDENT .sp Where \fIcommand\fP is one of the commands listed below; \fIdomain\fP is the numeric domain id, or the domain name, or the domain UUID; and \fIARGS\fP 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. Any \fIcommand\fP starting with \fB#\fP is treated as a comment and silently ignored, all other unrecognized \fIcommands\fP are diagnosed. .sp The \fBvirsh\fP program can be used either to run one \fICOMMAND\fP by giving the command and its arguments on the shell command line, or a \fICOMMAND_STRING\fP which is a single shell argument consisting of multiple \fICOMMAND\fP actions and their arguments joined with whitespace and separated by semicolons or newlines between commands, where unquoted backslash\-newline pairs are elided. Within \fICOMMAND_STRING\fP, 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, and any word starting with unquoted \fI#\fP begins a comment that ends at newline. If no command is given in the command line, \fBvirsh\fP will then start a minimal interpreter waiting for your commands, and the \fBquit\fP command will then exit the program. .sp The \fBvirsh\fP program understands the following \fIOPTIONS\fP\&. .sp \fB\-c\fP, \fB\-\-connect\fP \fIURI\fP .sp Connect to the specified \fIURI\fP, as if by the \fBconnect\fP command, instead of the default connection. .sp \fB\-d\fP, \fB\-\-debug\fP \fILEVEL\fP .sp Enable debug messages at integer \fILEVEL\fP and above. \fILEVEL\fP can range from 0 to 4 (default). See the documentation of \fBVIRSH_DEBUG\fP environment variable below for the description of each \fILEVEL\fP\&. .INDENT 0.0 .IP \(bu 2 \fB\-e\fP, \fB\-\-escape\fP \fIstring\fP .UNINDENT .sp Set alternative escape sequence for \fIconsole\fP command. By default, telnet\(aqs \fB^]\fP is used. Allowed characters when using hat notation are: alphabetic character, @, [, ], , ^, _. .INDENT 0.0 .IP \(bu 2 \fB\-h\fP, \fB\-\-help\fP .UNINDENT .sp Ignore all other arguments, and behave as if the \fBhelp\fP command were given instead. .INDENT 0.0 .IP \(bu 2 \fB\-k\fP, \fB\-\-keepalive\-interval\fP \fIINTERVAL\fP .UNINDENT .sp Set an \fIINTERVAL\fP (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. .INDENT 0.0 .IP \(bu 2 \fB\-K\fP, \fB\-\-keepalive\-count\fP \fICOUNT\fP .UNINDENT .sp 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 \fIINTERVAL\fP is set to 0. .INDENT 0.0 .IP \(bu 2 \fB\-l\fP, \fB\-\-log\fP \fIFILE\fP .UNINDENT .sp Output logging details to \fIFILE\fP\&. .INDENT 0.0 .IP \(bu 2 \fB\-q\fP, \fB\-\-quiet\fP .UNINDENT .sp Avoid extra informational messages. .INDENT 0.0 .IP \(bu 2 \fB\-r\fP, \fB\-\-readonly\fP .UNINDENT .sp Make the initial connection read\-only, as if by the \fI\-\-readonly\fP option of the \fBconnect\fP command. .INDENT 0.0 .IP \(bu 2 \fB\-t\fP, \fB\-\-timing\fP .UNINDENT .sp Output elapsed time information for each command. .INDENT 0.0 .IP \(bu 2 \fB\-v\fP, \fB\-\-version[=short]\fP .UNINDENT .sp Ignore all other arguments, and prints the version of the libvirt library virsh is coming from .INDENT 0.0 .IP \(bu 2 \fB\-V\fP, \fB\-\-version=long\fP .UNINDENT .sp 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 .sp Most \fBvirsh\fP operations rely upon the libvirt library being able to connect to an already running libvirtd service. This can usually be done using the command \fBservice libvirtd start\fP\&. .sp Most \fBvirsh\fP 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. .sp Most \fBvirsh\fP commands act synchronously, except maybe shutdown, setvcpus and setmem. In those cases the fact that the \fBvirsh\fP program returned, may not mean the action is complete and you must poll periodically to detect that the guest completed the operation. .sp \fBvirsh\fP strives for backward compatibility. Although the \fBhelp\fP command only lists the preferred usage of a command, if an older version of \fBvirsh\fP supported an alternate spelling of a command or option (such as \fI\-\-tunnelled\fP instead of \fI\-\-tunneled\fP), then scripts using that older spelling will continue to work. .sp Several \fBvirsh\fP 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: .INDENT 0.0 .INDENT 3.5 .sp .EX b, byte byte 1 KB kilobyte 1,000 k, KiB kibibyte 1,024 MB megabyte 1,000,000 M, MiB mebibyte 1,048,576 GB gigabyte 1,000,000,000 G, GiB gibibyte 1,073,741,824 TB terabyte 1,000,000,000,000 T, TiB tebibyte 1,099,511,627,776 PB petabyte 1,000,000,000,000,000 P, PiB pebibyte 1,125,899,906,842,624 EB exabyte 1,000,000,000,000,000,000 E, EiB exbibyte 1,152,921,504,606,846,976 .EE .UNINDENT .UNINDENT .SH GENERIC COMMANDS .sp The following commands are generic i.e. not specific to a domain. .SS help .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX help [command\-or\-group] .EE .UNINDENT .UNINDENT .sp 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 \fBExample 1:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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 .EE .UNINDENT .UNINDENT .sp To display detailed information for a specific command, give its name as the option instead. For example: .sp \fBExample 2:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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 .EE .UNINDENT .UNINDENT .SS quit, exit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX quit exit .EE .UNINDENT .UNINDENT .sp quit this interactive terminal .SS version .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX version [\-\-daemon] .EE .UNINDENT .UNINDENT .sp Will print out the major version info about what this built from. If \fI\-\-daemon\fP is specified then the version of the libvirt daemon is included in the output. .sp \fBExample:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX $ 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 .EE .UNINDENT .UNINDENT .SS cd .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX cd [directory] .EE .UNINDENT .UNINDENT .sp Will change current directory to \fIdirectory\fP\&. The default directory for the \fBcd\fP command is the home directory or, if there is no \fIHOME\fP variable in the environment, the root directory. .SS pwd .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pwd .EE .UNINDENT .UNINDENT .sp Will print the current directory. .SS connect .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX connect [URI] [\-\-readonly] .EE .UNINDENT .UNINDENT .sp (Re)\-Connect to the hypervisor. When the shell is first started, this is automatically run with the \fIURI\fP parameter requested by the \fB\-c\fP option on the command line. The \fIURI\fP parameter specifies how to connect to the hypervisor. The URI docs list the values supported, but the most common are: .INDENT 0.0 .IP \(bu 2 xen:///system .sp this is used to connect to the local Xen hypervisor .IP \(bu 2 qemu:///system .sp connect locally as root to the daemon supervising QEMU and KVM domains .IP \(bu 2 qemu:///session .sp connect locally as a normal user to his own set of QEMU and KVM domains .IP \(bu 2 lxc:///system .sp connect to a local linux container .UNINDENT .sp To find the currently used URI, check the \fIuri\fP command documented below. .sp For remote access see the URI docs on how to make URIs. The \fI\-\-readonly\fP option allows for read\-only connection .SS uri .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX uri .EE .UNINDENT .UNINDENT .sp Prints the hypervisor canonical URI, can be useful in shell mode. .SS hostname .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX hostname .EE .UNINDENT .UNINDENT .sp Print the hypervisor hostname. .SS sysinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX sysinfo .EE .UNINDENT .UNINDENT .sp Print the XML representation of the hypervisor sysinfo, if available. .SS nodeinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodeinfo .EE .UNINDENT .UNINDENT .sp Returns basic information about the node, like number and type of CPU, and size of the physical memory. The output corresponds to virNodeInfo structure. Specifically, the \(dqCPU socket(s)\(dq field means number of CPU sockets per NUMA cell. The information libvirt displays is dependent upon what each architecture may provide. .SS nodecpumap .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodecpumap [\-\-pretty] .EE .UNINDENT .UNINDENT .sp Displays the node\(aqs total number of CPUs, the number of online CPUs and the list of online CPUs. .sp With \fI\-\-pretty\fP the online CPUs are printed as a range instead of a list. .SS nodecpustats .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodecpustats [cpu] [\-\-percent] .EE .UNINDENT .UNINDENT .sp Returns cpu stats of the node. If \fIcpu\fP is specified, this will print the specified cpu statistics only. If \fI\-\-percent\fP is specified, this will print the percentage of each kind of cpu statistics during 1 second. .SS nodememstats .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodememstats [cell] .EE .UNINDENT .UNINDENT .sp Returns memory stats of the node. If \fIcell\fP is specified, this will print the specified cell statistics only. .SS nodesevinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodesevinfo .EE .UNINDENT .UNINDENT .sp Reports information about the AMD SEV launch security features for the node, if any. Some of this information is also reported in the domain capabilities XML document. .SS nodesuspend .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodesuspend [target] [duration] .EE .UNINDENT .UNINDENT .sp Puts the node (host machine) into a system\-wide sleep state and schedule the node\(aqs Real\-Time\-Clock interrupt to resume the node after the time duration specified by \fIduration\fP is out. \fItarget\fP specifies the state to which the host will be suspended to, it can be \(dqmem\(dq (suspend to RAM), \(dqdisk\(dq (suspend to disk), or \(dqhybrid\(dq (suspend to both RAM and disk). \fIduration\fP specifies the time duration in seconds for which the host has to be suspended, it should be at least 60 seconds. .SS node\-memory\-tune .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX node\-memory\-tune [shm\-pages\-to\-scan] [shm\-sleep\-millisecs] [shm\-merge\-across\-nodes] .EE .UNINDENT .UNINDENT .sp Allows you to display or set the node memory parameters. \fIshm\-pages\-to\-scan\fP can be used to set the number of pages to scan before the shared memory service goes to sleep; \fIshm\-sleep\-millisecs\fP can be used to set the number of millisecs the shared memory service should sleep before next scan; \fIshm\-merge\-across\-nodes\fP 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 NUMA node can be merged. When set to 1, pages from all nodes can be merged. Default to 1. .sp \fBNote\fP: Currently the \(dqshared memory service\(dq only means KSM (Kernel Samepage Merging). .SS capabilities .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX capabilities [\-\-xpath EXPRESSION] [\-\-wrap] .EE .UNINDENT .UNINDENT .sp Print an XML document describing the capabilities of the hypervisor we are currently connected to. This includes a section on the host capabilities in terms of CPU and features, and a set of description for each kind of guest which can be virtualized. For a more complete description see: .sp .sp The XML also show the NUMA topology information if available. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS domcapabilities .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domcapabilities [virttype] [emulatorbin] [arch] [machine] [\-\-xpath EXPRESSION] [\-\-wrap] .EE .UNINDENT .UNINDENT .sp Print an XML 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\fP output. This may be useful if you intend to create a new domain and are curious if for instance it could make use of VFIO 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\fP option specifies the virtualization type used. The value to be used is either from the \(aqtype\(aq attribute of the top level element from the domain XML or the \(aqtype\(aq attribute found within each element from the \fBvirsh capabilities\fP output. The \fIemulatorbin\fP option specifies the path to the emulator. The value to be used is either the element in the domain XML or the \fBvirsh capabilities\fP output. The \fIarch\fP option specifies the architecture to be used for the domain. The value to be used is either the \(dqarch\(dq attribute from the domain\(aqs XML element and subelement or the \(dqname\(dq attribute of an element from the \fBvirsh capabililites\fP output. The \fImachine\fP specifies the machine type for the emulator. The value to be used is either the \(dqmachine\(dq attribute from the domain\(aqs XML element and subelement or one from a list of machines from the \fBvirsh capabilities\fP output for a specific architecture and domain type. .sp For the QEMU hypervisor, a \fIvirttype\fP of either \(aqqemu\(aq or \(aqkvm\(aq must be supplied along with either the \fIemulatorbin\fP or \fIarch\fP in order to generate output for the default \fImachine\fP\&. Supplying a \fImachine\fP value will generate output for the specific machine. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS pool\-capabilities .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-capabilities .EE .UNINDENT .UNINDENT .sp Print an XML document describing the storage pool capabilities for the connected storage driver. This may be useful if you intend to create a new storage pool and need to know the available pool types and supported storage pool source and target volume formats as well as the required source elements to create the pool. .SS inject\-nmi .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX inject\-nmi domain .EE .UNINDENT .UNINDENT .sp Inject NMI to the guest. .SS list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX list [\-\-inactive | \-\-all] [\-\-managed\-save] [\-\-title] { [\-\-table] | \-\-name | \-\-id } [\-\-uuid] [\-\-persistent] [\-\-transient] [\-\-with\-managed\-save] [\-\-without\-managed\-save] [\-\-autostart] [\-\-no\-autostart] [\-\-with\-snapshot] [\-\-without\-snapshot] [\-\-with\-checkpoint] [\-\-without\-checkpoint] [\-\-state\-running] [\-\-state\-paused] [\-\-state\-shutoff] [\-\-state\-other] .EE .UNINDENT .UNINDENT .sp Prints information about existing domains. If no options are specified it prints out information about running domains. .sp \fBExample 1:\fP .sp An example format for the list is as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX \(ga\(gavirsh\(ga\(ga list Id Name State \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 Domain\-0 running 2 fedora paused .EE .UNINDENT .UNINDENT .sp Name is the name of the domain. ID the domain numeric id. State is the run state (see below). .sp \fBSTATES\fP .sp The State field lists what state each domain is currently in. A domain can be in one of the following possible states: .INDENT 0.0 .IP \(bu 2 \fBrunning\fP .sp The domain is currently running on a CPU .IP \(bu 2 \fBidle\fP .sp The domain is idle, and not running or runnable. This can be caused because the domain is waiting on IO (a traditional wait state) or has gone to sleep because there was nothing else for it to do. .IP \(bu 2 \fBpaused\fP .sp The domain has been paused, usually occurring through the administrator running \fBvirsh suspend\fP\&. 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 \(bu 2 \fBin shutdown\fP .sp 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 \(bu 2 \fBshut off\fP .sp The domain is not running. Usually this indicates the domain has been shut down completely, or has not been started. .IP \(bu 2 \fBcrashed\fP .sp 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 \(bu 2 \fBpmsuspended\fP .sp The domain has been suspended by guest power management, e.g. entered into s3 state. .UNINDENT .sp Normally only active domains are listed. To list inactive domains specify \fI\-\-inactive\fP or \fI\-\-all\fP to list both active and inactive domains. .sp \fBFiltering\fP .sp To further filter the list of domains you may specify one or more of filtering flags supported by the \fBlist\fP 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: .SS Persistence .sp Flag \fI\-\-persistent\fP is used to include persistent guests in the returned list. To include transient guests specify \fI\-\-transient\fP\&. .SS Existence of managed save image .sp To list domains having a managed save image specify flag \fI\-\-with\-managed\-save\fP\&. For domains that don\(aqt have a managed save image specify \fI\-\-without\-managed\-save\fP\&. .SS Domain state .sp The following filter flags select a domain by its state: \fI\-\-state\-running\fP for running domains, \fI\-\-state\-paused\fP for paused domains, \fI\-\-state\-shutoff\fP for turned off domains and \fI\-\-state\-other\fP for all other states as a fallback. .SS Autostarting domains .sp To list autostarting domains use the flag \fI\-\-autostart\fP\&. To list domains with this feature disabled use \fI\-\-no\-autostart\fP\&. .SS Snapshot existence .sp Domains that have snapshot images can be listed using flag \fI\-\-with\-snapshot\fP, domains without a snapshot \fI\-\-without\-snapshot\fP\&. .SS Checkpoint existence .sp Domains that have checkpoints can be listed using flag \fI\-\-with\-checkpoint\fP, domains without a checkpoint \fI\-\-without\-checkpoint\fP\&. .sp When talking to older servers, this command is forced to use a series of API 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\fP is specified, then domains that have managed save state (only possible if they are in the \fBshut off\fP state, so you need to specify \fI\-\-inactive\fP or \fI\-\-all\fP to actually list them) will instead show as \fBsaved\fP in the listing. This flag is usable only with the default \fI\-\-table\fP output. Note that this flag does not filter the list of domains. .sp If \fI\-\-name\fP is specified, domain names are printed instead of the table formatted one per line. If \fI\-\-uuid\fP is specified domain\(aqs UUID\(aqs are printed instead of names. If \fI\-\-id\fP is specified then domain\(aqs ID\(aqs are printed indead of names. However, it is possible to combine \fI\-\-name\fP, \fI\-\-uuid\fP and \fI\-\-id\fP to select only desired fields for printing. Flag \fI\-\-table\fP specifies that the legacy table\-formatted output should be used, but it is mutually exclusive with \fI\-\-name\fP, and \fI\-\-id\fP\&. This is the default and will be used if neither of \fI\-\-name\fP, \fI\-\-uuid\fP or \fI\-\-id\fP is specified. If neither \fI\-\-name\fP nor \fI\-\-uuid\fP is specified, but \fI\-\-id\fP is, then only active domains are listed, even with the \fI\-\-all\fP parameter as otherwise the output would just contain bunch of lines with just \fI\-1\fP\&. If \fI\-\-table\fP is combined with \fI\-\-uuid\fP, then domain uuid is printed as an extra column. .sp If \fI\-\-title\fP is specified, then the short domain description (title) is printed in an extra column. This flag is usable only with the default \fI\-\-table\fP output. .sp \fBExample 2:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX $ virsh list \-\-title Id Name State Title \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 Domain\-0 running Mailserver 1 2 fedora paused .EE .UNINDENT .UNINDENT .SS freecell .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX freecell [{ [\-\-cellno] cellno | \-\-all }] .EE .UNINDENT .UNINDENT .sp Prints the available amount of memory on the machine or within a NUMA 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. .SS freepages .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX freepages [{ [\-\-cellno] cellno [\-\-pagesize] pagesize | \-\-all }] .EE .UNINDENT .UNINDENT .sp Prints the available amount of pages within a NUMA cell. \fIcellno\fP refers to the NUMA cell you\(aqre interested in. \fIpagesize\fP is a scaled integer (see \fBNOTES\fP above). Alternatively, if \fI\-\-all\fP is used, info on each possible combination of NUMA cell and page size is printed out. .SS allocpages .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX allocpages [\-\-pagesize] pagesize [\-\-pagecount] pagecount [[\-\-cellno] cellno] [\-\-add] [\-\-all] .EE .UNINDENT .UNINDENT .sp Change the size of pages pool of \fIpagesize\fP on the host. If \fI\-\-add\fP is specified, then \fIpagecount\fP pages are added into the pool. However, if \fI\-\-add\fP wasn\(aqt specified, then the \fIpagecount\fP 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\fP modifier can be used to narrow the modification down to a single host NUMA cell. On the other end of spectrum lies \fI\-\-all\fP which executes the modification on all NUMA cells. .SS cpu\-baseline .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX cpu\-baseline FILE [\-\-features] [\-\-migratable] .EE .UNINDENT .UNINDENT .sp Compute baseline CPU which will be supported by all host CPUs given in . (See \fBhypervisor\-cpu\-baseline\fP command to get a CPU which can be provided by a specific hypervisor.) 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\fP command. If \fI\-\-features\fP is specified, then the resulting XML description will explicitly include all features that make up the CPU, without this option features that are part of the CPU model will not be listed in the XML description. If \fI\-\-migratable\fP is specified, features that block migration will not be included in the resulting CPU. .SS cpu\-compare .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX cpu\-compare FILE [\-\-error] [\-\-validate] .EE .UNINDENT .UNINDENT .sp Compare CPU definition from XML with host CPU. (See \fBhypervisor\-cpu\-compare\fP command for comparing the CPU definition with the CPU which a specific hypervisor is able to provide on the host.) The XML may contain either host or guest CPU definition. The host CPU definition is the element and its contents as printed by \fBcapabilities\fP command. The guest CPU definition is the element and its contents from domain XML definition or the CPU definition created from the host CPU model found in domain capabilities XML (printed by \fBdomcapabilities\fP command). In addition to the element itself, this command accepts full domain XML, capabilities XML, or domain capabilities XML containing the CPU definition. For more information on guest CPU definition see: https://libvirt.org/formatdomain.html#elementsCPU \&. If \fI\-\-error\fP is specified, the command will return an error when the given CPU is incompatible with host CPU and a message providing more details about the incompatibility will be printed out. If \fI\-\-validate\fP is specified, validates the format of the XML document against an internal RNG schema. .SS cpu\-models .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX cpu\-models arch .EE .UNINDENT .UNINDENT .sp Print the list of CPU models known by libvirt for the specified architecture. Whether a specific hypervisor is able to create a domain which uses any of the printed CPU models is a separate question which can be answered by looking at the domain capabilities XML returned by \fBdomcapabilities\fP command. Moreover, for some architectures libvirt does not know any CPU models and the usable CPU models are only limited by the hypervisor. This command will print that all CPU models are accepted for these architectures and the actual list of supported CPU models can be checked in the domain capabilities XML. .SS hypervisor\-cpu\-compare .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX hypervisor\-cpu\-compare FILE [virttype] [emulator] [arch] [machine] [\-\-error] [\-\-validate] .EE .UNINDENT .UNINDENT .sp Compare CPU definition from XML with the CPU the hypervisor is able to provide on the host. (This is different from \fBcpu\-compare\fP which compares the CPU definition with the host CPU without considering any specific hypervisor and its abilities.) .sp The XML \fIFILE\fP may contain either a host or guest CPU definition. The host CPU definition is the element and its contents as printed by the \fBcapabilities\fP command. The guest CPU definition is the element and its contents from the domain XML definition or the CPU definition created from the host CPU model found in the domain capabilities XML (printed by the \fBdomcapabilities\fP command). In addition to the element itself, this command accepts full domain XML, capabilities XML, or domain capabilities XML containing the CPU definition. For more information on guest CPU definition see: https://libvirt.org/formatdomain.html#elementsCPU \&. .sp The \fIvirttype\fP option specifies the virtualization type (usable in the \(aqtype\(aq attribute of the top level element from the domain XML). \fIemulator\fP specifies the path to the emulator, \fIarch\fP specifies the CPU architecture, and \fImachine\fP specifies the machine type. If \fI\-\-error\fP is specified, the command will return an error when the given CPU is incompatible with the host CPU and a message providing more details about the incompatibility will be printed out. If \fI\-\-validate\fP is specified, validates the format of the XML document against an internal RNG schema. .SS hypervisor\-cpu\-baseline .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX hypervisor\-cpu\-baseline [FILE] [virttype] [emulator] [arch] [machine] [\-\-features] [\-\-migratable] [model] .EE .UNINDENT .UNINDENT .sp Compute a baseline CPU which will be compatible with all CPUs defined in an XML \fIfile\fP and with the CPU the hypervisor is able to provide on the host. (This is different from \fBcpu\-baseline\fP which does not consider any hypervisor abilities when computing the baseline CPU.) .sp As an alternative for \fIFILE\fP in case the XML would only contain a CPU model with no additional features the CPU model name itself can be passed as \fImodel\fP\&. Exactly one of \fIFILE\fP and \fImodel\fP must be used. .sp The XML \fIFILE\fP may contain either host or guest CPU definitions describing the host CPU model. The host CPU definition is the element and its contents as printed by \fBcapabilities\fP command. The guest CPU definition may be created from the host CPU model found in domain capabilities XML (printed by \fBdomcapabilities\fP command). In addition to the elements, this command accepts full capabilities XMLs, or domain capabilities XMLs containing the CPU definitions. It is recommended to use only the CPU definitions from domain capabilities, as on some architectures using the host CPU definition may either fail or provide unexpected results. .sp When \fIFILE\fP contains only a single CPU definition, the command will print the same CPU with restrictions imposed by the capabilities of the hypervisor. Specifically, running the \fBvirsh hypervisor\-cpu\-baseline\fP command with no additional options on the result of \fBvirsh domcapabilities\fP will transform the host CPU model from domain capabilities XML to a form directly usable in domain XML. Running the command with \fImodel\fP (or \fIFILE\fP containing just a single CPU definition with model and no feature elements) which is marked as unusable in \fBvirsh domcapabilities\fP will provide a list of features that block this CPU model from being usable. .sp The \fIvirttype\fP option specifies the virtualization type (usable in the \(aqtype\(aq attribute of the top level element from the domain XML). \fIemulator\fP specifies the path to the emulator, \fIarch\fP specifies the CPU architecture, and \fImachine\fP specifies the machine type. If \fI\-\-features\fP is specified, then the resulting XML description will explicitly include all features that make up the CPU, without this option features that are part of the CPU model will not be listed in the XML description. If \fI\-\-migratable\fP is specified, features that block migration will not be included in the resulting CPU. .SH DOMAIN COMMANDS .sp The following commands manipulate domains directly, as stated previously most commands take domain as the first parameter. The \fIdomain\fP can be specified as a short integer, a name or a full UUID. .SS autostart .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX autostart [\-\-disable] domain .EE .UNINDENT .UNINDENT .sp Configure a domain to be automatically started at boot. .sp The option \fI\-\-disable\fP disables autostarting. .SS blkdeviotune .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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] .EE .UNINDENT .UNINDENT .sp Set or query the block disk io parameters for a block device of \fIdomain\fP\&. \fIdevice\fP specifies a unique target name () or source file () for one of the disk devices attached to \fIdomain\fP (see also \fBdomblklist\fP 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\fP specifies total throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \fI\-\-read\-bytes\-sec\fP specifies read throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \fI\-\-write\-bytes\-sec\fP specifies write throughput limit as a scaled integer, the default being bytes per second if no suffix is specified. \fI\-\-total\-iops\-sec\fP specifies total I/O operations limit per second. \fI\-\-read\-iops\-sec\fP specifies read I/O operations limit per second. \fI\-\-write\-iops\-sec\fP specifies write I/O operations limit per second. \fI\-\-total\-bytes\-sec\-max\fP 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\fP 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\fP 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\fP specifies maximum total I/O operations limit per second. \fI\-\-read\-iops\-sec\-max\fP specifies maximum read I/O operations limit per second. \fI\-\-write\-iops\-sec\-max\fP specifies maximum write I/O operations limit per second. \fI\-\-total\-bytes\-sec\-max\-length\fP specifies duration in seconds to allow maximum total throughput limit. \fI\-\-read\-bytes\-sec\-max\-length\fP specifies duration in seconds to allow maximum read throughput limit. \fI\-\-write\-bytes\-sec\-max\-length\fP specifies duration in seconds to allow maximum write throughput limit. \fI\-\-total\-iops\-sec\-max\-length\fP specifies duration in seconds to allow maximum total I/O operations limit. \fI\-\-read\-iops\-sec\-max\-length\fP specifies duration in seconds to allow maximum read I/O operations limit. \fI\-\-write\-iops\-sec\-max\-length\fP specifies duration in seconds to allow maximum write I/O operations limit. \fI\-\-size\-iops\-sec\fP specifies size I/O operations limit per second. \fI\-\-group\-name\fP 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\fP\&. .sp Older versions of virsh only accepted these options with underscore instead of dash, as in \fI\-\-total_bytes_sec\fP\&. .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\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. When setting the disk io parameters both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. For querying only one of \fI\-\-live\fP, \fI\-\-config\fP or \fI\-\-current\fP can be specified. If no flag is specified, behavior is different depending on hypervisor. .SS blkiotune .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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]] .EE .UNINDENT .UNINDENT .sp Display or set the blkio parameters. QEMU/KVM supports \fI\-\-weight\fP\&. \fI\-\-weight\fP is in range [100, 1000]. After kernel 2.6.39, the value could be in the range [10, 1000]. .sp \fBdevice\-weights\fP 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\fP 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\fP 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\fP 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\fP 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\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .SS blockcommit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX blockcommit domain path [bandwidth] [\-\-bytes] [base] [\-\-shallow] [top] [\-\-delete] [\-\-keep\-relative] [\-\-wait [\-\-async] [\-\-verbose]] [\-\-timeout seconds] [\-\-active] [{\-\-pivot | \-\-keep\-overlay}] .EE .UNINDENT .UNINDENT .sp 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\fP and/or \fItop\fP are specified as files within the backing chain, then the operation is constrained to committing just that portion of the chain; \fI\-\-shallow\fP can be used instead of \fIbase\fP 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\fP flag will attempt to remove these invalidated files at the successful completion of the commit operation. When the \fI\-\-keep\-relative\fP flag is used, the backing file paths will be kept relative. .sp When \fItop\fP is omitted or specified as the active image, it is also possible to specify \fI\-\-active\fP to trigger a two\-phase active commit. In the first phase, \fItop\fP is copied into \fIbase\fP and the job can only be canceled, with top still containing data not yet in base. In the second phase, \fItop\fP and \fIbase\fP remain identical until a call to \fBblockjob\fP with the \fI\-\-abort\fP flag (keeping top as the active image that tracks changes from that point in time) or the \fI\-\-pivot\fP 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\fP\&. However, if \fI\-\-wait\fP is specified, then this command will block until the operation completes (or for \fI\-\-active\fP, enters the second phase), or until the operation is canceled because the optional \fItimeout\fP in seconds elapses or SIGINT is sent (usually with \fBCtrl\-C\fP). Using \fI\-\-verbose\fP along with \fI\-\-wait\fP will produce periodic status updates. If job cancellation is triggered, \fI\-\-async\fP 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\fP is shorthand for combining \fI\-\-active\fP \fI\-\-wait\fP with an automatic \fBblockjob\fP \fI\-\-pivot\fP; and using \fI\-\-keep\-overlay\fP is shorthand for combining \fI\-\-active\fP \fI\-\-wait\fP with an automatic \fBblockjob\fP \fI\-\-abort\fP\&. .sp \fIpath\fP 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\fP (see also \fBdomblklist\fP for listing these names). \fIbandwidth\fP 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\fP argument see the corresponding section for the \fBblockjob\fP command. .SS blockcopy .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX blockcopy domain path { dest [format] [\-\-blockdev] | \-\-xml file } [\-\-shallow] [\-\-reuse\-external] [bandwidth] [\-\-wait [\-\-async] [\-\-verbose]] [{\-\-pivot | \-\-finish}] [\-\-timeout seconds] [granularity] [buf\-size] [\-\-bytes] [\-\-transient\-job] [\-\-synchronous\-writes] [\-\-print\-xml] .EE .UNINDENT .UNINDENT .sp Copy a disk backing image chain to a destination. Either \fIdest\fP as the destination file name, or \fI\-\-xml\fP with the name of an XML file containing a top\-level element describing the destination, must be present. Additionally, if \fIdest\fP is given, \fIformat\fP should be specified to declare the format of the destination (if \fIformat\fP is omitted, then libvirt will reuse the format of the source, or with \fI\-\-reuse\-external\fP will be forced to probe the destination format, which could be a potential security hole). The command supports \fI\-\-raw\fP as a boolean flag synonym for \fI\-\-format=raw\fP\&. When using \fIdest\fP, the destination is treated as a regular file unless \fI\-\-blockdev\fP is used to signal that it is a block device. By default, this command flattens the entire chain; but if \fI\-\-shallow\fP is specified, the copy shares the backing chain. .sp If \fI\-\-reuse\-external\fP is specified, then the destination must exist and have sufficient space to hold the copy. If \fI\-\-shallow\fP is used in conjunction with \fI\-\-reuse\-external\fP 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\fP with the \fI\-\-abort\fP and \fI\-\-pivot\fP flags pivots over to the copy, or a call without \fI\-\-pivot\fP leaves the destination as a faithful copy of that point in time. However, if \fI\-\-wait\fP is specified, then this command will block until the mirroring phase begins, or cancel the operation if the optional \fItimeout\fP in seconds elapses or SIGINT is sent (usually with \fBCtrl\-C\fP). Using \fI\-\-verbose\fP along with \fI\-\-wait\fP will produce periodic status updates. Using \fI\-\-pivot\fP (similar to \fBblockjob\fP \fI\-\-pivot\fP) or \fI\-\-finish\fP (similar to \fBblockjob\fP \fI\-\-abort\fP) implies \fI\-\-wait\fP, 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\fP, \fI\-\-async\fP 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\fP specifies fully\-qualified path of the disk. \fIbandwidth\fP 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\fP argument see the corresponding section for the \fBblockjob\fP command. Specifying \fIgranularity\fP 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\fP 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). .sp \fI\-\-transient\-job\fP allows specifying that the user does not require the job to be recovered if the VM crashes or is turned off before the job completes. This flag removes the restriction of copy jobs to transient domains if that restriction is applied by the hypervisor. .sp If \fI\-\-synchronous\-writes\fP is specified the block job will wait for guest writes to be propagated both to the original image and to the destination of the copy so that it\(aqs guaranteed that the job converges if the destination storage is slower. This may impact performance of writes while the blockjob is running. .sp If \fI\-\-print\-xml\fP is specified, then the XML used to start the block copy job is printed instead of starting the job. .SS blockjob .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX blockjob domain path { [\-\-abort] [\-\-async] [\-\-pivot] | [\-\-info] [\-\-raw] [\-\-bytes] | [bandwidth] } .EE .UNINDENT .UNINDENT .sp Manage active block operations. There are three mutually\-exclusive modes: \fI\-\-info\fP, \fIbandwidth\fP, and \fI\-\-abort\fP\&. \fI\-\-async\fP and \fI\-\-pivot\fP imply abort mode; \fI\-\-raw\fP implies info mode; and if no mode was given, \fI\-\-info\fP mode is assumed. .sp \fIpath\fP 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\fP (see also \fBdomblklist\fP for listing these names). .sp In \fI\-\-abort\fP mode, the active job on the specified disk will be aborted. If \fI\-\-async\fP is also specified, this command will return immediately, rather than waiting for the cancellation to complete. If \fI\-\-pivot\fP is specified, this requests that an active copy or active commit job be pivoted over to the new image. .sp In \fI\-\-info\fP 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\fP lists each field of the struct, in a stable format. If the \fI\-\-bytes\fP 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\fP can be used to set bandwidth limit for the active job in MiB/s. If \fI\-\-bytes\fP 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 \fBNOTES\fP above). Using \fI\-\-bytes\fP with a scaled value permits a finer granularity to be selected. A scaled value used without \fI\-\-bytes\fP will be rounded down to MiB/s. Note that the \fI\-\-bytes\fP may be unsupported by the hypervisor. .sp Note that the progress reported for blockjobs corresponding to a pull\-mode backup don\(aqt report progress of the backup but rather usage of temporary space required for the backup. .SS blockpull .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX blockpull domain path [bandwidth] [\-\-bytes] [base] [\-\-wait [\-\-verbose] [\-\-timeout seconds] [\-\-async]] [\-\-keep\-relative] .EE .UNINDENT .UNINDENT .sp Populate a disk from its backing image chain. By default, this command flattens the entire chain; but if \fIbase\fP 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\fP\&. However, if \fI\-\-wait\fP is specified, then this command will block until the operation completes, or cancel the operation if the optional \fItimeout\fP in seconds elapses or SIGINT is sent (usually with \fBCtrl\-C\fP). Using \fI\-\-verbose\fP along with \fI\-\-wait\fP will produce periodic status updates. If job cancellation is triggered, \fI\-\-async\fP 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\fP flag will keep the backing chain names relative. .sp \fIpath\fP 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\fP (see also \fBdomblklist\fP for listing these names). \fIbandwidth\fP specifies copying bandwidth limit in MiB/s. For further information on the \fIbandwidth\fP argument see the corresponding section for the \fBblockjob\fP command. .SS blockresize .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX blockresize domain path ([size] | [\-\-capacity]) .EE .UNINDENT .UNINDENT .sp Resize a block device of domain while the domain is running, \fIpath\fP 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\fP (see also \fBdomblklist\fP for listing these names). .sp For image formats without metadata (raw) stored inside fixed\-size storage (e.g. block devices) the \-\-capacity flag can be used to resize the device to the full size of the backing device. .sp \fIsize\fP is a scaled integer (see \fBNOTES\fP above) which defaults to KiB (blocks of 1024 bytes) if there is no suffix. You must use a suffix of \(dqB\(dq to get bytes (note that for historical reasons, this differs from \fBvol\-resize\fP which defaults to bytes without a suffix). .SS console .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX console domain [devname] [\-\-safe] [\-\-force] [\-\-resume] .EE .UNINDENT .UNINDENT .sp Connect the virtual serial console for the guest. The optional \fIdevname\fP 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\fP 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\fP flag may be specified, requesting to disconnect any existing sessions, such as in a case of a broken connection. .sp If the flag \fI\-\-resume\fP is specified then the guest is resumed after connecting to the console. .SS cpu\-stats .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX cpu\-stats domain [\-\-total] [start] [count] .EE .UNINDENT .UNINDENT .sp 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\fP for only the total stats, \fIstart\fP for only the per\-cpu stats of the CPUs from \fIstart\fP, \fIcount\fP for only \fIcount\fP CPUs\(aq stats. .SS create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX create FILE [\-\-console] [\-\-paused] [\-\-autodestroy] [\-\-pass\-fds N,M,...] [\-\-validate] [\-\-reset\-nvram] .EE .UNINDENT .UNINDENT .sp Create a domain from an XML . Optionally, \fI\-\-validate\fP option can be passed to validate the format of the input XML file against an internal RNG schema (identical to using virt\-xml\-validate(1) tool). Domains created using this command are going to be either transient (temporary ones that will vanish once destroyed) or existing persistent guests that will run with one\-time use configuration, leaving the persistent XML untouched (this can come handy during an automated testing of various configurations all based on the original XML). See the example below for usage demonstration. .sp The domain will be paused if the \fI\-\-paused\fP option is used and supported by the driver; otherwise it will be running. If \fI\-\-console\fP is requested, attach to the console after creation. If \fI\-\-autodestroy\fP is requested, then the guest will be automatically destroyed when virsh closes its connection to libvirt, or otherwise exits. .sp If \fI\-\-pass\-fds\fP 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 If \fI\-\-reset\-nvram\fP is specified, any existing NVRAM file will be deleted and re\-initialized from its pristine template. .sp \fBExample:\fP .INDENT 0.0 .IP 1. 3 prepare a template from an existing domain (skip directly to 3a if writing one from scratch) .INDENT 3.0 .INDENT 3.5 .sp .EX # virsh dumpxml > domain.xml .EE .UNINDENT .UNINDENT .IP 2. 3 edit the template using an editor of your choice and: .INDENT 3.0 .IP a. 3 DO CHANGE! and ( can also be removed), or .IP b. 3 DON\(aqT CHANGE! either or .UNINDENT .INDENT 3.0 .INDENT 3.5 .sp .EX # $EDITOR domain.xml .EE .UNINDENT .UNINDENT .IP 3. 3 create a domain from domain.xml, depending on whether following 2a or 2b respectively: .INDENT 3.0 .IP a. 3 the domain is going to be transient .IP b. 3 an existing persistent guest will run with a modified one\-time configuration .UNINDENT .INDENT 3.0 .INDENT 3.5 .sp .EX # virsh create domain.xml .EE .UNINDENT .UNINDENT .UNINDENT .SS define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX define FILE [\-\-validate] .EE .UNINDENT .UNINDENT .sp Define a domain from an XML . Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP (identical to using virt\-xml\-validate(1) tool). The domain definition is registered but not started. If domain is already running, the changes will take effect on the next boot. .SS desc .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX desc domain [[\-\-live] [\-\-config] | [\-\-current]] [\-\-title] [\-\-edit] [\-\-new\-desc New description or title message] .EE .UNINDENT .UNINDENT .sp Show or modify description and title of a domain. These values are user fields that allow storing arbitrary textual data to allow easy identification of domains. Title should be short, although it\(aqs not enforced. (See also \fBmetadata\fP that works with XML based domain metadata.) .sp Flags \fI\-\-live\fP or \fI\-\-config\fP select whether this command works on live or persistent definitions of the domain. If both \fI\-\-live\fP and \fI\-\-config\fP are specified, the \fI\-\-config\fP option takes precedence on getting the current description and both live configuration and config are updated while setting the description. \fI\-\-current\fP is exclusive and implied if none of these was specified. .sp Flag \fI\-\-edit\fP 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\fP selects operation on the title field instead of description. .sp If neither of \fI\-\-edit\fP and \fI\-\-new\-desc\fP are specified the note or description is displayed instead of being modified. .SS destroy .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX destroy domain [\-\-graceful] [\-\-remove\-logs] .EE .UNINDENT .UNINDENT .sp Immediately terminate the domain \fIdomain\fP\&. This doesn\(aqt give the domain OS any chance to react, and it\(aqs the equivalent of ripping the power cord out on a physical machine. In most cases you will want to use the \fBshutdown\fP 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\fP 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 UUID can restore the snapshot metadata with \fBsnapshot\-create\fP\&. Similarly, the metadata of any checkpoints will be lost, but can be restored with \fBcheckpoint\-create\fP\&. .sp If \fI\-\-graceful\fP is specified, don\(aqt resort to extreme measures (e.g. SIGKILL) when the guest doesn\(aqt stop after a reasonable timeout; return an error instead. .sp If \fI\-\-remove\-logs\fP is specified, remove per \fIdomain\fP log files. Not all deployment configuration can be supported. .sp In case of QEMU the flag is only supported if virlogd is used to handle QEMU process output. Otherwise the flag is ignored. .SS domblkerror .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domblkerror domain .EE .UNINDENT .UNINDENT .sp Show errors on block devices. This command usually comes handy when \fBdomstate\fP command says that a domain was paused due to I/O error. The \fBdomblkerror\fP command lists all block devices in error state and the error seen on each of them. .SS domblkinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domblkinfo domain [block\-device \-\-all] [\-\-human] .EE .UNINDENT .UNINDENT .sp Get block device size info for a domain. A \fIblock\-device\fP corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fP (see also \fBdomblklist\fP for listing these names). If \fI\-\-human\fP is set, the output will have a human readable output. If \fI\-\-all\fP is set, the output will be a table showing all block devices size info associated with \fIdomain\fP\&. The \fI\-\-all\fP option takes precedence of the others. .SS domblklist .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domblklist domain [\-\-inactive] [\-\-details] .EE .UNINDENT .UNINDENT .sp Print a table showing the brief information of all block devices associated with \fIdomain\fP\&. If \fI\-\-inactive\fP 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\fP is specified, disk type and device value will also be printed. Other contexts that require a block device name (such as \fIdomblkinfo\fP or \fIsnapshot\-create\fP for disk snapshots) will accept either target or unique source names printed by this command. .SS domblkstat .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domblkstat domain [block\-device] [\-\-human] .EE .UNINDENT .UNINDENT .sp Get device block stats for a running domain. A \fIblock\-device\fP corresponds to a unique target name () or source file () for one of the disk devices attached to \fIdomain\fP (see also \fBdomblklist\fP for listing these names). On a LXC or QEMU domain, omitting the \fIblock\-device\fP yields device block stats summarily for the entire domain. .sp Use \fI\-\-human\fP 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 Explanation of fields (fields appear in the following order): .INDENT 0.0 .IP \(bu 2 rd_req \- count of read operations .IP \(bu 2 rd_bytes \- count of read bytes .IP \(bu 2 wr_req \- count of write operations .IP \(bu 2 wr_bytes \- count of written bytes .IP \(bu 2 errs \- error count .IP \(bu 2 flush_operations \- count of flush operations .IP \(bu 2 rd_total_times \- total time read operations took (ns) .IP \(bu 2 wr_total_times \- total time write operations took (ns) .IP \(bu 2 flush_total_times \- total time flush operations took (ns) .IP \(bu 2 <\-\- other fields provided by hypervisor \-\-> .UNINDENT .SS domblkthreshold .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domblkthreshold domain dev threshold .EE .UNINDENT .UNINDENT .sp Set the threshold value for delivering the block\-threshold event. \fIdev\fP specifies the disk device target or backing chain element of given device using the \(aqtarget[1]\(aq syntax. \fIthreshold\fP is a scaled value of the offset. If the block device should write beyond that offset the event will be delivered. .SS domcontrol .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domcontrol domain .EE .UNINDENT .UNINDENT .sp Returns state of an interface to VMM used to control a domain. For states other than \(dqok\(dq or \(dqerror\(dq the command also prints number of seconds elapsed since the control interface entered its current state. .SS domdirtyrate\-calc .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domdirtyrate\-calc [\-\-seconds ] \-\-mode=[page\-sampling | dirty\-bitmap | dirty\-ring] .EE .UNINDENT .UNINDENT .sp Calculate an active domain\(aqs memory dirty rate which may be expected by user in order to decide whether it\(aqs proper to be migrated out or not. The \fBseconds\fP parameter can be used to calculate dirty rate in a specific time which allows 60s at most now and would be default to 1s if missing. These three \fIpage\-sampling, dirty\-bitmap, dirty\-ring\fP modes are mutually exclusive and alternative when specify calculation mode, \fIpage\-sampling\fP is the default mode if missing. The calculated dirty rate information is available by calling \(aqdomstats \-\-dirtyrate\(aq. .SS domdisplay .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domdisplay domain [\-\-include\-password] [[\-\-type] type] [\-\-all] .EE .UNINDENT .UNINDENT .sp Output a URI which can be used to connect to the graphical display of the domain via VNC, SPICE or RDP. The particular graphical display type can be selected using the \fBtype\fP parameter (e.g. \(dqvnc\(dq, \(dqspice\(dq, \(dqrdp\(dq). If \fI\-\-include\-password\fP is specified, the SPICE channel password will be included in the URI. If \fI\-\-all\fP is specified, then all show all possible graphical displays, for a VM could have more than one graphical displays. .SS domdisplay\-reload .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domdisplay\-reload [\-\-type ] .EE .UNINDENT .UNINDENT .sp Reload the domain\(aqs graphical display. This reloads its TLS certificates without restarting the domain. \fBtype\fP can be any constant from the \fIvirDomainGraphicsReloadType\fP enum. By default any supported type is reloaded (so far only VNC). .SS domfsfreeze .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domfsfreeze domain [[\-\-mountpoint] mountpoint...] .EE .UNINDENT .UNINDENT .sp Freeze mounted filesystems within a running domain to prepare for consistent snapshots. .sp The \fI\-\-mountpoint\fP option takes a parameter \fBmountpoint\fP, 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\fP command has a \fI\-\-quiesce\fP option to freeze and thaw the filesystems automatically to keep snapshots consistent. \fBdomfsfreeze\fP command is only needed when a user wants to utilize the native snapshot features of storage devices not supported by libvirt. .SS domfsinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domfsinfo domain .EE .UNINDENT .UNINDENT .sp 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 XML (). .sp Note that this command requires a guest agent configured and running in the domain\(aqs guest OS. .SS domfsthaw .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domfsthaw domain [[\-\-mountpoint] mountpoint...] .EE .UNINDENT .UNINDENT .sp Thaw mounted filesystems within a running domain, which have been frozen by domfsfreeze command. .sp The \fI\-\-mountpoint\fP option takes a parameter \fBmountpoint\fP, 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. .SS domfstrim .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domfstrim domain [\-\-minimum bytes] [\-\-mountpoint mountPoint] .EE .UNINDENT .UNINDENT .sp 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\fP \fBbytes\fP 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 \(dqdiscard every free block\(dq. Moreover, if a user wants to trim only one mount point, it can be specified via optional \fI\-\-mountpoint\fP parameter. .SS domhostname .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domhostname domain [\-\-source lease|agent] .EE .UNINDENT .UNINDENT .sp Returns the hostname of a domain, if the hypervisor makes it available. .sp The \fI\-\-source\fP argument specifies what data source to use for the hostnames, currently \(aqlease\(aq to read DHCP leases or \(aqagent\(aq to query the guest OS via an agent. If unspecified, driver returns the default method available (some drivers support only one type of source). .SS domid .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domid domain\-name\-or\-uuid .EE .UNINDENT .UNINDENT .sp Convert a domain name (or UUID) to a domain id .SS domif\-getlink .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domif\-getlink domain interface\-device [\-\-config] .EE .UNINDENT .UNINDENT .sp Query link state of the domain\(aqs virtual interface. If \fI\-\-config\fP is specified, query the persistent configuration, for compatibility purposes, \fI\-\-persistent\fP is alias of \fI\-\-config\fP\&. .sp \fIinterface\-device\fP can be the interface\(aqs target name or the MAC address. .SS domif\-setlink .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domif\-setlink domain interface\-device state [\-\-config] [\-\-print\-xml] .EE .UNINDENT .UNINDENT .sp Modify link state of the domain\(aqs virtual interface. Possible values for state are \(dqup\(dq and \(dqdown\(dq. If \fI\-\-config\fP is specified, only the persistent configuration of the domain is modified, for compatibility purposes, \fI\-\-persistent\fP is alias of \fI\-\-config\fP\&. \fIinterface\-device\fP can be the interface\(aqs target name or the MAC address. .sp If \fI\-\-print\-xml\fP is specified, then the XML used to update the interface is printed instead. .SS domifaddr .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domifaddr domain [interface] [\-\-full] [\-\-source lease|agent|arp] .EE .UNINDENT .UNINDENT .sp Get a list of interfaces of a running domain along with their IP and MAC addresses, or limited output just for one interface if \fIinterface\fP is specified. Note that \fIinterface\fP can be driver dependent, it can be the name within guest OS or the name you would see in domain XML. Moreover, the whole command may require a guest agent to be configured for the queried domain under some hypervisors, notably QEMU. .sp If \fI\-\-full\fP is specified, the interface name and MAC address is always displayed when the interface has multiple IP addresses or aliases; otherwise, only the interface name and MAC address is displayed for the first name and MAC address with \(dq\-\(dq for the others using the same name and MAC address. .sp The \fI\-\-source\fP argument specifies what data source to use for the addresses, currently \(aqlease\(aq to read DHCP leases, \(aqagent\(aq to query the guest OS via an agent, or \(aqarp\(aq to get IP from host\(aqs arp tables. If unspecified, \(aqlease\(aq is the default. .SS backup\-begin .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX backup\-begin domain [backupxml] [checkpointxml] [\-\-reuse\-external] .EE .UNINDENT .UNINDENT .sp Begin a new backup job. If \fIbackupxml\fP is omitted, this defaults to a full backup using a push model to filenames generated by libvirt; supplying XML allows fine\-tuning such as requesting an incremental backup relative to an earlier checkpoint, controlling which disks participate or which filenames are involved, or requesting the use of a pull model backup. The \fIbackup\-dumpxml\fP command shows any resulting values assigned by libvirt. For more information on backup XML, see: .sp If \fI\-\-reuse\-external\fP is used it instructs libvirt to reuse temporary and output files provided by the user in \fIbackupxml\fP\&. .sp If \fIcheckpointxml\fP is specified, a second file with a top\-level element of \fIdomaincheckpoint\fP is used to create a simultaneous checkpoint, for doing a later incremental backup relative to the time the backup was created. See \fIcheckpoint\-create\fP for more details on checkpoints. .sp This command returns as soon as possible, and the backup job runs in the background; the progress of a push model backup can be checked with \fIdomjobinfo\fP or by waiting for an event with \fIevent\fP (the progress of a pull model backup is under the control of whatever third party connects to the NBD export). The job is ended with \fIdomjobabort\fP\&. .SS backup\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX backup\-dumpxml [\-\-xpath EXPRESSION] [\-\-wrap] domain .EE .UNINDENT .UNINDENT .sp Output XML describing the current backup job. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS domiflist .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domiflist domain [\-\-inactive] .EE .UNINDENT .UNINDENT .sp Print a table showing the brief information of all virtual interfaces associated with \fIdomain\fP\&. If \fI\-\-inactive\fP 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 MAC address of virtual interface (such as \fIdetach\-interface\fP or \fIdomif\-setlink\fP) will accept the MAC address printed by this command. .SS domifstat .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domifstat domain interface\-device .EE .UNINDENT .UNINDENT .sp Get network interface stats for a running domain. The network interface stats are only available for interfaces that have a physical source interface. This does not include, for example, a \(aquser\(aq interface type since it is a virtual LAN with NAT to the outside world. \fIinterface\-device\fP can be the interface target by name or MAC address. Please note, for an unmanaged \fIethernet\fP type returned stats might have RX/TX swapped. .SS domiftune .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domiftune domain interface\-device [[\-\-config] [\-\-live] | [\-\-current]] [*\-\-inbound average,peak,burst,floor*] [*\-\-outbound average,peak,burst*] .EE .UNINDENT .UNINDENT .sp Set or query the domain\(aqs network interface\(aqs bandwidth parameters. \fIinterface\-device\fP can be the interface\(aqs target name (), or the MAC address. .sp If no \fI\-\-inbound\fP or \fI\-\-outbound\fP is specified, this command will query and show the bandwidth settings. Otherwise, it will set the inbound or outbound bandwidth. \fIaverage,peak,burst,floor\fP is the same as in command \fIattach\-interface\fP\&. Values for \fIaverage\fP, \fIpeak\fP and \fIfloor\fP are expressed in kilobytes per second, while \fIburst\fP is expressed in kilobytes in a single burst at \fIpeak\fP speed as described in the Network XML documentation at \&. .sp To clear inbound or outbound settings, use \fI\-\-inbound\fP or \fI\-\-outbound\fP respectfully with average value of zero. .sp If \fI\-\-live\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .SS dominfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX dominfo domain .EE .UNINDENT .UNINDENT .sp Returns basic information about the domain. .SS domjobabort .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domjobabort domain [\-\-postcopy] .EE .UNINDENT .UNINDENT .sp Abort the currently running domain job. .sp When the job to be aborted is a migration which entered post\-copy mode, it cannot be aborted as none of the hosts involved in migration has a complete state of the domain. Optional \fI\-\-postcopy\fP can be used to interrupt such migration although doing so may effectively suspend the domain until the migration is resumed (see also \fI\-\-postcopy\-resume\fP option of \fBmigrate\fP). .SS domjobinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domjobinfo domain [\-\-completed [\-\-keep\-completed]] [\-\-anystats] [\-\-rawstats] .EE .UNINDENT .UNINDENT .sp Returns information about jobs running on a domain. \fI\-\-completed\fP tells virsh to return information about a recently finished job. Statistics of a completed job are automatically destroyed once read (unless \fI\-\-keep\-completed\fP is used) or when libvirtd is restarted. .sp Normally only statistics for running and successful completed jobs are printed. \fI\-\-anystats\fP can be used to also display statistics for failed jobs. .sp In case \fI\-\-rawstats\fP is used, all fields are printed as received from the server without any attempts to interpret the data. The \(dqJob type:\(dq field is special, since it\(aqs reported by the API and not part of stats. .sp Note that time information returned for completed migrations may be completely irrelevant unless both source and destination hosts have synchronized time (i.e., NTP daemon is running on both of them). .SS domlaunchsecinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domlaunchsecinfo domain .EE .UNINDENT .UNINDENT .sp Returns information about the launch security parameters associated with a running domain. .sp The set of parameters reported will vary depending on which type of launch security protection is active. If none is active, no parameters will be reported. .SS domsetlaunchsecstate .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domsetlaunchsecstate domain \-\-secrethdr hdr\-filename \-\-secret secret\-filename [\-\-set\-address address] .EE .UNINDENT .UNINDENT .sp Set a launch security secret in the guest\(aqs memory. The guest must have a launchSecurity type enabled in its configuration and be in a paused state. On success, the guest can be transitioned to a running state. On failure, the guest should be destroyed. .sp \fI\-\-secrethdr\fP specifies a filename containing the base64\-encoded secret header. The header includes artifacts needed by the hypervisor firmware to recover the plain text of the launch secret. \fI\-\-secret\fP specifies the filename containing the base64\-encoded encrypted launch secret. .sp The \fI\-\-set\-address\fP option can be used to specify a physical address within the guest\(aqs memory to set the secret. If not specified, the address will be determined by the hypervisor. .SS dommemstat .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX dommemstat domain [\-\-period seconds] [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp 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 Explanation of fields: .INDENT 0.0 .IP \(bu 2 \fBswap_in\fP \- The amount of data read from swap space (in KiB) .IP \(bu 2 \fBswap_out\fP \- The amount of memory written out to swap space (in KiB) .IP \(bu 2 \fBmajor_fault\fP \- The number of page faults where disk IO was required .IP \(bu 2 \fBminor_fault\fP \- The number of other page faults .IP \(bu 2 \fBunused\fP \- The amount of memory left unused by the system (in KiB) .IP \(bu 2 \fBavailable\fP \- The amount of usable memory as seen by the domain (in KiB) .IP \(bu 2 \fBactual\fP \- Current balloon value (in KiB) .IP \(bu 2 \fBrss\fP \- Resident Set Size of the running domain\(aqs process (in KiB) .IP \(bu 2 \fBusable\fP \- The amount of memory which can be reclaimed by balloon without causing host swapping (in KiB) .IP \(bu 2 \fBlast\-update\fP \- Timestamp of the last update of statistics (in seconds) .IP \(bu 2 \fBdisk_caches\fP \- The amount of memory that can be reclaimed without additional I/O, typically disk caches (in KiB) .IP \(bu 2 \fBhugetlb_pgalloc\fP \- The number of successful huge page allocations initiated from within the domain .IP \(bu 2 \fBhugetlb_pgfail\fP \- The number of failed huge page allocations initiated from within the domain .UNINDENT .sp For QEMU/KVM with a memory balloon, setting the optional \fI\-\-period\fP to a value larger than 0 in seconds will allow the balloon driver to return additional statistics which will be displayed by subsequent \fBdommemstat\fP commands. Setting the \fI\-\-period\fP to 0 will stop the balloon driver collection, but does not clear the statistics in the balloon driver. Requires at least QEMU/KVM 1.5 to be running on the host. .sp The \fI\-\-live\fP, \fI\-\-config\fP, and \fI\-\-current\fP flags are only valid when using the \fI\-\-period\fP option in order to set the collection period for the balloon driver. If \fI\-\-live\fP is specified, only the running guest collection period is affected. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. .sp Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on the guest state. .SS domname .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domname domain\-id\-or\-uuid .EE .UNINDENT .UNINDENT .sp Convert a domain Id (or UUID) to domain name .SS dompmsuspend .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX dompmsuspend domain target [\-\-duration] .EE .UNINDENT .UNINDENT .sp Suspend a running domain into one of these states (possible \fItarget\fP values): .INDENT 0.0 .IP \(bu 2 \fBmem\fP \- equivalent of S3 ACPI state .IP \(bu 2 \fBdisk\fP \- equivalent of S4 ACPI state .IP \(bu 2 \fBhybrid\fP \- RAM is saved to disk but not powered off .UNINDENT .sp The \fI\-\-duration\fP argument specifies number of seconds before the domain is woken up after it was suspended (see also \fBdompmwakeup\fP). Default is 0 for unlimited suspend time. (This feature isn\(aqt 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\(aqs guest OS. .sp Beware that at least for QEMU, the domain\(aqs 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\fP flag. .SS dompmwakeup .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX dompmwakeup domain .EE .UNINDENT .UNINDENT .sp 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 does not necessarily fail if the domain is running. .SS domrename .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domrename domain new\-name .EE .UNINDENT .UNINDENT .sp Rename a domain. This command changes current domain name to the new name specified in the second argument. .sp \fBNote\fP: Domain must be inactive. .SS domstate .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domstate domain [\-\-reason] .EE .UNINDENT .UNINDENT .sp Returns state about a domain. \fI\-\-reason\fP tells virsh to also print reason for the state. .SS domstats .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domstats [\-\-raw] [\-\-enforce] [\-\-backing] [\-\-nowait] [\-\-state] [\-\-cpu\-total] [\-\-balloon] [\-\-vcpu] [\-\-interface] [\-\-block] [\-\-perf] [\-\-iothread] [\-\-memory] [\-\-dirtyrate] [\-\-vm] [[\-\-list\-active] [\-\-list\-inactive] [\-\-list\-persistent] [\-\-list\-transient] [\-\-list\-running]y [\-\-list\-paused] [\-\-list\-shutoff] [\-\-list\-other]] | [domain ...] .EE .UNINDENT .UNINDENT .sp 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\-NNN\fP\&. (The approaches can\(aqt 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\fP 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\fP, \fI\-\-cpu\-total\fP, \fI\-\-balloon\fP, \fI\-\-vcpu\fP, \fI\-\-interface\fP, \fI\-\-block\fP, \fI\-\-perf\fP, \fI\-\-iothread\fP, \fI\-\-memory\fP, \fI\-\-dirtyrate\fP, \fI\-\-vm\fP\&. .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\fP group the following fields are returned: .INDENT 0.0 .IP \(bu 2 \fBstate.state\fP \- state of the VM, returned as number from virDomainState enum .IP \(bu 2 \fBstate.reason\fP \- reason for entering given state, returned as int from virDomain*Reason enum corresponding to given state .UNINDENT .sp \fI\-\-cpu\-total\fP returns: .INDENT 0.0 .IP \(bu 2 \fBcpu.time\fP \- total cpu time spent for this domain in nanoseconds .IP \(bu 2 \fBcpu.user\fP \- user cpu time spent in nanoseconds .IP \(bu 2 \fBcpu.system\fP \- system cpu time spent in nanoseconds .IP \(bu 2 \fBcpu.haltpoll.success.time\fP \- cpu halt polling success time spent in nanoseconds .IP \(bu 2 \fBcpu.haltpoll.fail.time\fP \- cpu halt polling fail time spent in nanoseconds .IP \(bu 2 \fBcpu.cache.monitor.count\fP \- the number of cache monitors for this domain .IP \(bu 2 \fBcpu.cache.monitor..name\fP \- the name of cache monitor .IP \(bu 2 \fBcpu.cache.monitor..vcpus\fP \- vcpu list of cache monitor .IP \(bu 2 \fBcpu.cache.monitor..bank.count\fP \- the number of cache banks in cache monitor .IP \(bu 2 \fBcpu.cache.monitor..bank..id\fP \- host allocated cache id for bank in cache monitor .IP \(bu 2 \fBcpu.cache.monitor..bank..bytes\fP \- the number of bytes of last level cache that the domain is using on cache bank .UNINDENT .sp \fI\-\-balloon\fP returns: .INDENT 0.0 .IP \(bu 2 \fBballoon.current\fP \- the memory in KiB currently used .IP \(bu 2 \fBballoon.maximum\fP \- the maximum memory in KiB allowed .IP \(bu 2 \fBballoon.swap_in\fP \- the amount of data read from swap space (in KiB) .IP \(bu 2 \fBballoon.swap_out\fP \- the amount of memory written out to swap space (in KiB) .IP \(bu 2 \fBballoon.major_fault\fP \- the number of page faults when disk IO was required .IP \(bu 2 \fBballoon.minor_fault\fP \- the number of other page faults .IP \(bu 2 \fBballoon.unused\fP \- the amount of memory left unused by the system (in KiB) .IP \(bu 2 \fBballoon.available\fP \- the amount of usable memory as seen by the domain (in KiB) .IP \(bu 2 \fBballoon.rss\fP \- Resident Set Size of running domain\(aqs process (in KiB) .IP \(bu 2 \fBballoon.usable\fP \- the amount of memory which can be reclaimed by balloon without causing host swapping (in KiB) .IP \(bu 2 \fBballoon.last\-update\fP \- timestamp of the last update of statistics (in seconds) .IP \(bu 2 \fBballoon.disk_caches\fP \- the amount of memory that can be reclaimed without additional I/O, typically disk (in KiB) .IP \(bu 2 \fBballoon.hugetlb_pgalloc\fP \- the number of successful huge page allocations from inside the domain via virtio balloon .IP \(bu 2 \fBballoon.hugetlb_pgfail\fP \- the number of failed huge page allocations from inside the domain via virtio balloon .UNINDENT .sp \fI\-\-vcpu\fP returns: .INDENT 0.0 .IP \(bu 2 \fBvcpu.current\fP \- current number of online virtual CPUs .IP \(bu 2 \fBvcpu.maximum\fP \- maximum number of online virtual CPUs .IP \(bu 2 \fBvcpu..state\fP \- state of the virtual CPU , as number from virVcpuState enum .IP \(bu 2 \fBvcpu..time\fP \- virtual cpu time spent by virtual CPU (in microseconds) .IP \(bu 2 \fBvcpu..wait\fP \- virtual cpu time spent by virtual CPU waiting on I/O (in microseconds) .IP \(bu 2 \fBvcpu..halted\fP \- virtual CPU is halted: yes or no (may indicate the processor is idle or even disabled, depending on the architecture) .IP \(bu 2 \fBvcpu..delay\fP \- time the vCPU thread was enqueued by the host scheduler, but was waiting in the queue instead of running. Exposed to the VM as a steal time. .UNINDENT .sp This group of statistics also reports additional hypervisor\-originating per\-vCPU stats. The hypervisor\-specific statistics in this group have the following naming scheme: .INDENT 0.0 .INDENT 3.5 \fBvcpu..$NAME.$TYPE\fP .INDENT 0.0 .TP .B \fB$NAME\fP name of the statistics field provided by the hypervisor .TP .B \fB$TYPE\fP Type of the value. The following types are returned: .INDENT 7.0 .TP .B \fBcur\fP current instant value .TP .B \fBsum\fP aggregate value .TP .B \fBmax\fP peak value .UNINDENT .UNINDENT .sp The returned value may be either an unsigned long long or a boolean. Meaning is hypervisor specific. Please see the disclaimer for the \fI\-\-vm\fP group which also consists of hypervisor\-specific stats. .UNINDENT .UNINDENT .sp \fI\-\-interface\fP returns: .INDENT 0.0 .IP \(bu 2 \fBnet.count\fP \- number of network interfaces on this domain .IP \(bu 2 \fBnet..name\fP \- name of the interface .IP \(bu 2 \fBnet..rx.bytes\fP \- number of bytes received .IP \(bu 2 \fBnet..rx.pkts\fP \- number of packets received .IP \(bu 2 \fBnet..rx.errs\fP \- number of receive errors .IP \(bu 2 \fBnet..rx.drop\fP \- number of receive packets dropped .IP \(bu 2 \fBnet..tx.bytes\fP \- number of bytes transmitted .IP \(bu 2 \fBnet..tx.pkts\fP \- number of packets transmitted .IP \(bu 2 \fBnet..tx.errs\fP \- number of transmission errors .IP \(bu 2 \fBnet..tx.drop\fP \- number of transmit packets dropped .UNINDENT .sp \fI\-\-perf\fP returns the statistics of all enabled perf events: .INDENT 0.0 .IP \(bu 2 \fBperf.cmt\fP \- the cache usage in Byte currently used .IP \(bu 2 \fBperf.mbmt\fP \- total system bandwidth from one level of cache .IP \(bu 2 \fBperf.mbml\fP \- bandwidth of memory traffic for a memory controller .IP \(bu 2 \fBperf.cpu_cycles\fP \- the count of cpu cycles (total/elapsed) .IP \(bu 2 \fBperf.instructions\fP \- the count of instructions .IP \(bu 2 \fBperf.cache_references\fP \- the count of cache hits .IP \(bu 2 \fBperf.cache_misses\fP \- the count of caches misses .IP \(bu 2 \fBperf.branch_instructions\fP \- the count of branch instructions .IP \(bu 2 \fBperf.branch_misses\fP \- the count of branch misses .IP \(bu 2 \fBperf.bus_cycles\fP \- the count of bus cycles .IP \(bu 2 \fBperf.stalled_cycles_frontend\fP \- the count of stalled frontend cpu cycles .IP \(bu 2 \fBperf.stalled_cycles_backend\fP \- the count of stalled backend cpu cycles .IP \(bu 2 \fBperf.ref_cpu_cycles\fP \- the count of ref cpu cycles .IP \(bu 2 \fBperf.cpu_clock\fP \- the count of cpu clock time .IP \(bu 2 \fBperf.task_clock\fP \- the count of task clock time .IP \(bu 2 \fBperf.page_faults\fP \- the count of page faults .IP \(bu 2 \fBperf.context_switches\fP \- the count of context switches .IP \(bu 2 \fBperf.cpu_migrations\fP \- the count of cpu migrations .IP \(bu 2 \fBperf.page_faults_min\fP \- the count of minor page faults .IP \(bu 2 \fBperf.page_faults_maj\fP \- the count of major page faults .IP \(bu 2 \fBperf.alignment_faults\fP \- the count of alignment faults .IP \(bu 2 \fBperf.emulation_faults\fP \- the count of emulation faults .UNINDENT .sp See the \fBperf\fP command for more details about each event. .sp \fI\-\-block\fP returns information about disks associated with each domain. Using the \fI\-\-backing\fP 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: .INDENT 0.0 .IP \(bu 2 \fBblock.count\fP \- number of block devices being listed .IP \(bu 2 \fBblock..name\fP \- name of the target of the block device (the same name for multiple entries if \fI\-\-backing\fP is present) .IP \(bu 2 \fBblock..backingIndex\fP \- when \fI\-\-backing\fP is present, matches up with the index listed in domain XML for backing files .IP \(bu 2 \fBblock..path\fP \- file source of block device , if it is a local file or block device .IP \(bu 2 \fBblock..rd.reqs\fP \- number of read requests .IP \(bu 2 \fBblock..rd.bytes\fP \- number of read bytes .IP \(bu 2 \fBblock..rd.times\fP \- total time (ns) spent on reads .IP \(bu 2 \fBblock..wr.reqs\fP \- number of write requests .IP \(bu 2 \fBblock..wr.bytes\fP \- number of written bytes .IP \(bu 2 \fBblock..wr.times\fP \- total time (ns) spent on writes .IP \(bu 2 \fBblock..fl.reqs\fP \- total flush requests .IP \(bu 2 \fBblock..fl.times\fP \- total time (ns) spent on cache flushing .IP \(bu 2 \fBblock..errors\fP \- Xen only: the \(aqoo_req\(aq value .IP \(bu 2 \fBblock..allocation\fP \- offset of highest written sector in bytes .IP \(bu 2 \fBblock..capacity\fP \- logical size of source file in bytes .IP \(bu 2 \fBblock..physical\fP \- physical size of source file in bytes .IP \(bu 2 \fBblock..threshold\fP \- threshold (in bytes) for delivering the VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event. See domblkthreshold. .UNINDENT .sp \fI\-\-iothread\fP returns information about IOThreads on the running guest if supported by the hypervisor. .sp The \(dqpoll\-max\-ns\(dq for each thread is the maximum nanoseconds to allow each polling interval to occur. A polling interval is a period of time allowed for a thread to process data before being the guest gives up its CPU quantum back to the host. A value set too small will not allow the IOThread to run long enough on a CPU to process data. A value set too high will consume too much CPU time per IOThread failing to allow other threads running on the CPU to get time. The polling interval is not available for statistical purposes. .INDENT 0.0 .IP \(bu 2 .INDENT 2.0 .TP .B \fBiothread.count\fP \- maximum number of IOThreads in the subsequent list as unsigned int. Each IOThread in the list will will use it\(aqs iothread_id value as the . There may be fewer entries than the iothread.count value if the polling values are not supported. .UNINDENT .IP \(bu 2 \fBiothread..poll\-max\-ns\fP \- maximum polling time in nanoseconds used by the IOThread. A value of 0 (zero) indicates polling is disabled. .IP \(bu 2 \fBiothread..poll\-grow\fP \- polling time grow value. A value of 0 (zero) growth is managed by the hypervisor. .IP \(bu 2 \fBiothread..poll\-shrink\fP \- polling time shrink value. A value of (zero) indicates shrink is managed by hypervisor. .UNINDENT .sp \fI\-\-memory\fP returns: .INDENT 0.0 .IP \(bu 2 \fBmemory.bandwidth.monitor.count\fP \- the number of memory bandwidth monitors for this domain .IP \(bu 2 \fBmemory.bandwidth.monitor..name\fP \- the name of monitor .IP \(bu 2 \fBmemory.bandwidth.monitor..vcpus\fP \- the vcpu list of monitor .IP \(bu 2 .INDENT 2.0 .TP .B \fBmemory.bandwidth.monitor..node.count\fP \- the number of memory controller in monitor .UNINDENT .IP \(bu 2 \fBmemory.bandwidth.monitor..node..id\fP \- host allocated memory controller id for controller of monitor .IP \(bu 2 \fBmemory.bandwidth.monitor..node..bytes.local\fP \- the accumulative bytes consumed by @vcpus that passing through the memory controller in the same processor that the scheduled host CPU belongs to. .IP \(bu 2 \fBmemory.bandwidth.monitor..node..bytes.total\fP \- the total bytes consumed by @vcpus that passing through all memory controllers, either local or remote controller. .UNINDENT .sp \fI\-\-dirtyrate\fP returns: .INDENT 0.0 .IP \(bu 2 \fBdirtyrate.calc_status\fP \- the status of last memory dirty rate calculation, returned as number from virDomainDirtyRateStatus enum. .IP \(bu 2 \fBdirtyrate.calc_start_time\fP \- the start time of last memory dirty rate calculation. .IP \(bu 2 \fBdirtyrate.calc_period\fP \- the period of last memory dirty rate calculation. .IP \(bu 2 \fBdirtyrate.megabytes_per_second\fP \- the calculated memory dirty rate in MiB/s. .IP \(bu 2 \fBdirtyrate.calc_mode\fP \- the calculation mode used last measurement (\fBpage\-sampling\fP/\fBdirty\-bitmap\fP/\fBdirty\-ring\fP) .IP \(bu 2 \fBdirtyrate.vcpu..megabytes_per_second\fP \- the calculated memory dirty rate for a virtual cpu in MiB/s .UNINDENT .sp \fI\-\-vm\fP returns: .sp The \fI\-\-vm\fP option enables reporting of hypervisor\-specific statistics. Naming and meaning of the fields is entirely hypervisor dependent. .sp The statistics in this group have the following naming scheme: .INDENT 0.0 .INDENT 3.5 \fBvm.$NAME.$TYPE\fP .INDENT 0.0 .TP .B \fB$NAME\fP name of the statistics field provided by the hypervisor .TP .B \fB$TYPE\fP Type of the value. The following types are returned: .INDENT 7.0 .TP .B \fBcur\fP current instant value .TP .B \fBsum\fP aggregate value .TP .B \fBmax\fP peak value .UNINDENT .UNINDENT .sp The returned value may be either an unsigned long long or a boolean. .sp \fBWARNING\fP: The stats reported in this group are runtime\-collected and hypervisor originated, thus fall outside of the usual stable API policies of libvirt. .sp Libvirt can\(aqt guarantee that the statistics reported from the outside source will be present in further versions of the hypervisor, or that naming or meaning will stay consistent. Changes to existing fields, however, are expected to be rare. .UNINDENT .UNINDENT .sp Selecting a specific statistics groups doesn\(aqt guarantee that the daemon supports the selected group of stats. Flag \fI\-\-enforce\fP forces the command to fail if the daemon doesn\(aqt support the selected group. .sp When collecting stats libvirtd may wait for some time if there\(aqs already another job running on given domain for it to finish. This may cause unnecessary delay in delivering stats. Using \fI\-\-nowait\fP suppresses this behaviour. On the other hand some statistics might be missing for such domain. .SS domtime .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domtime domain { [\-\-now] [\-\-pretty] [\-\-sync] [\-\-time time] } .EE .UNINDENT .UNINDENT .sp Gets or sets the domain\(aqs system time. When run without any arguments (but \fIdomain\fP), the current domain\(aqs system time is printed out. The \fI\-\-pretty\fP modifier can be used to print the time in more human readable form. .sp When \fI\-\-time\fP \fBtime\fP is specified, the domain\(aqs time is not gotten but set instead. The \fI\-\-now\fP modifier acts like if it was an alias for \fI\-\-time\fP \fB$now\fP, 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 UTC. The \fI\-\-sync\fP modifies the set behavior a bit: The time passed is ignored, but the time to set is read from domain\(aqs RTC instead. Please note, that some hypervisors may require a guest agent to be configured in order to get or set the guest time. .SS domuuid .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domuuid domain\-name\-or\-id .EE .UNINDENT .UNINDENT .sp Convert a domain name or id to domain UUID .SS domxml\-from\-native .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domxml\-from\-native format config .EE .UNINDENT .UNINDENT .sp Convert the file \fIconfig\fP in the native guest configuration format named by \fIformat\fP to a domain XML format. For QEMU/KVM hypervisor, the \fIformat\fP argument must be \fBqemu\-argv\fP\&. For Xen hypervisor, the \fIformat\fP argument may be \fBxen\-xm\fP, \fBxen\-xl\fP, or \fBxen\-sxpr\fP\&. For LXC hypervisor, the \fIformat\fP argument must be \fBlxc\-tools\fP\&. For VMware/ESX hypervisor, the \fIformat\fP argument must be \fBvmware\-vmx\fP\&. For the Bhyve hypervisor, the \fIformat\fP argument must be \fBbhyve\-argv\fP\&. .SS domxml\-to\-native .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX domxml\-to\-native format { [\-\-xml] xml | \-\-domain domain\-name\-or\-id\-or\-uuid } .EE .UNINDENT .UNINDENT .sp Convert the file \fIxml\fP into domain XML format or convert an existing \fI\-\-domain\fP to the native guest configuration format named by \fIformat\fP\&. The \fIxml\fP and \fI\-\-domain\fP arguments are mutually exclusive. For the types of \fIformat\fP argument, refer to \fBdomxml\-from\-native\fP\&. .SS dump .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX dump domain corefilepath [\-\-bypass\-cache] { [\-\-live] | [\-\-crash] | [\-\-reset] } [\-\-verbose] [\-\-memory\-only] [\-\-format string] .EE .UNINDENT .UNINDENT .sp Dumps the core of a domain to a file for analysis. If \fI\-\-live\fP is specified, the domain continues to run until the core dump is complete, rather than pausing up front. If \fI\-\-crash\fP is specified, the domain is halted with a crashed status, rather than merely left in a paused state. If \fI\-\-reset\fP is specified, the domain is reset after successful dump. Note, these three switches are mutually exclusive. If \fI\-\-bypass\-cache\fP is specified, the save will avoid the file system cache, although this may slow down the operation. If \fI\-\-memory\-only\fP is specified, the file is elf file, and will only include domain\(aqs memory and cpu common register value. It is very useful if the domain uses host devices directly. \fI\-\-format\fP \fIstring\fP is used to specify the format of \(aqmemory\-only\(aq dump, and \fIstring\fP can be one of: 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), win\-dmp(Windows full crashdump format). .sp The progress may be monitored using \fBdomjobinfo\fP virsh command and canceled with \fBdomjobabort\fP command (sent by another virsh instance). Another option is to send SIGINT (usually with \fBCtrl\-C\fP) to the virsh process running \fBdump\fP command. \fI\-\-verbose\fP displays the progress of dump. .sp NOTE: Some hypervisors may require the user to manually ensure proper permissions on file and path specified by argument \fIcorefilepath\fP\&. .sp NOTE: 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 ELF file which can be later processed by the crash utility. .SS dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX dumpxml [\-\-inactive] [\-\-security\-info] [\-\-update\-cpu] [\-\-migratable] [\-\-xpath EXPRESSION] [\-\-wrap] domain .EE .UNINDENT .UNINDENT .sp Output the domain information as an XML dump to stdout, this format can be used by the \fBcreate\fP command. Additional options affecting the XML dump may be used. \fI\-\-inactive\fP 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\fP will also include security sensitive information in the XML dump. \fI\-\-update\-cpu\fP updates domain CPU requirements according to host CPU. With \fI\-\-migratable\fP one can request an XML 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\fP, \fI\-\-security\-info\fP, ...) as necessary. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX edit domain .EE .UNINDENT .UNINDENT .sp Edit the XML configuration file for a domain, which will affect the next boot of the guest. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh dumpxml \-\-inactive \-\-security\-info domain > domain.xml vi domain.xml (or make changes with your other text editor) virsh define domain.xml .EE .UNINDENT .UNINDENT .sp except that it does some error checking. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SS emulatorpin .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX emulatorpin domain [cpulist] [[\-\-live] [\-\-config] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Query or change the pinning of domain\(aqs emulator threads to host physical CPUs. .sp See \fBvcpupin\fP for \fIcpulist\fP\&. .sp If \fI\-\-live\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given if \fIcpulist\fP is present, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .SS event .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX event {[domain] { event | \-\-all } [\-\-loop] [\-\-timeout seconds] [\-\-timestamp] | \-\-list} .EE .UNINDENT .UNINDENT .sp 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\fP\&. Using \fI\-\-list\fP as the only argument will provide a list of possible \fIevent\fP values known by this client, although the connection might not allow registering for all these events. It is also possible to use \fI\-\-all\fP instead of \fIevent\fP 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 SIGINT (usually via \fBCtrl\-C\fP) to quit immediately. If \fI\-\-timeout\fP is specified, the command gives up waiting for events after \fIseconds\fP have elapsed. With \fI\-\-loop\fP, the command prints all events until a timeout or interrupt key. .sp When \fI\-\-timestamp\fP is used, a human\-readable timestamp will be printed before the event. .SS get\-user\-sshkeys .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX get\-user\-sshkeys domain user .EE .UNINDENT .UNINDENT .sp Print SSH authorized keys for given \fIuser\fP in the guest \fIdomain\fP\&. Please note, that an entry in the file has internal structure as defined by \fIsshd(8)\fP and virsh/libvirt does handle keys as opaque strings, i.e. does not interpret them. .SS guest\-agent\-timeout .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX guest\-agent\-timeout domain [\-\-timeout value] .EE .UNINDENT .UNINDENT .sp Set how long to wait for a response from guest agent commands. By default, agent commands block forever waiting for a response. \fBvalue\fP must be a positive value (wait for given amount of seconds) or one of the following values: .INDENT 0.0 .IP \(bu 2 \-2 \- block forever waiting for a result (used when \-\-timeout is omitted), .IP \(bu 2 \-1 \- reset timeout to the default value (currently defined as 5 seconds in libvirt daemon), .IP \(bu 2 0 \- do not wait at all, .UNINDENT .SS guestinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX guestinfo domain [\-\-user] [\-\-os] [\-\-timezone] [\-\-hostname] [\-\-filesystem] [\-\-disk] [\-\-interface] .EE .UNINDENT .UNINDENT .sp Print information about the guest from the point of view of the guest agent. Note that this command requires a guest agent to be configured and running in the domain\(aqs guest OS. .sp When run without any arguments, this command prints all information types that are supported by the guest agent at that point, omitting unavailable ones. Success is always reported in this case. .sp You can limit the types of information that are returned by specifying one or more flags. Available information types flags are \fI\-\-user\fP, \fI\-\-os\fP, \fI\-\-timezone\fP, \fI\-\-hostname\fP, \fI\-\-filesystem\fP, \fI\-\-disk\fP and \fI\-\-interface\fP\&. If an explicitly requested information type is not supported by the guest agent at that point, the processes will provide an exit code of 1. .sp Note that depending on the hypervisor type and the version of the guest agent running within the domain, not all of the following information may be returned. .sp When selecting the \fI\-\-user\fP information type, the following fields may be returned: .INDENT 0.0 .IP \(bu 2 \fBuser.count\fP \- the number of active users on this domain .IP \(bu 2 \fBuser..name\fP \- username of user .IP \(bu 2 \fBuser..domain\fP \- domain of the user (may only be present on certain guets types) .IP \(bu 2 \fBuser..login\-time\fP \- the login time of user in milliseconds since the epoch .UNINDENT .sp \fI\-\-os\fP returns: .INDENT 0.0 .IP \(bu 2 \fBos.id\fP \- a string identifying the operating system .IP \(bu 2 \fBos.name\fP \- the name of the operating system .IP \(bu 2 \fBos.pretty\-name\fP \- a pretty name for the operating system .IP \(bu 2 \fBos.version\fP \- the version of the operating system .IP \(bu 2 \fBos.version\-id\fP \- the version id of the operating system .IP \(bu 2 \fBos.kernel\-release\fP \- the release of the operating system kernel .IP \(bu 2 \fBos.kernel\-version\fP \- the version of the operating system kernel .IP \(bu 2 \fBos.machine\fP \- the machine hardware name .IP \(bu 2 \fBos.variant\fP \- a specific variant or edition of the operating system .IP \(bu 2 \fBos.variant\-id\fP \- the id for a specific variant or edition of the operating system .UNINDENT .sp \fI\-\-timezone\fP returns: .INDENT 0.0 .IP \(bu 2 \fBtimezone.name\fP \- the name of the timezone .IP \(bu 2 \fBtimezone.offset\fP \- the offset to UTC in seconds .UNINDENT .sp \fI\-\-hostname\fP returns: .INDENT 0.0 .IP \(bu 2 \fBhostname\fP \- the hostname of the domain .UNINDENT .sp \fI\-\-filesystem\fP returns: .INDENT 0.0 .IP \(bu 2 \fBfs.count\fP \- the number of filesystems defined on this domain .IP \(bu 2 \fBfs..mountpoint\fP \- the path to the mount point for filesystem .IP \(bu 2 \fBfs..name\fP \- device name in the guest (e.g. \fBsda1\fP) for filesystem .IP \(bu 2 \fBfs..fstype\fP \- the type of filesystem .IP \(bu 2 \fBfs..total\-bytes\fP \- the total size of filesystem .IP \(bu 2 \fBfs..used\-bytes\fP \- the number of bytes used in filesystem .IP \(bu 2 \fBfs..disk.count\fP \- the number of disks targeted by filesystem .IP \(bu 2 \fBfs..disk..alias\fP \- the device alias of disk (e.g. sda) .IP \(bu 2 \fBfs..disk..serial\fP \- the serial number of disk .IP \(bu 2 \fBfs..disk..device\fP \- the device node of disk .UNINDENT .sp \fI\-\-disk\fP returns: .INDENT 0.0 .IP \(bu 2 \fBdisk.count\fP \- the number of disks defined on this domain .IP \(bu 2 \fBdisk..name\fP \- device node (Linux) or device UNC (Windows) .IP \(bu 2 \fBdisk..partition\fP \- whether this is a partition or disk .IP \(bu 2 \fBdisk..dependency.count\fP \- the number of device dependencies .IP \(bu 2 \fBdisk..dependency..name\fP \- a dependency name .IP \(bu 2 \fBdisk..serial\fP \- optional disk serial number .IP \(bu 2 \fBdisk..alias\fP \- the device alias of the disk (e.g. sda) .IP \(bu 2 \fBdisk..guest_alias\fP \- optional alias assigned to the disk .UNINDENT .sp \fI\-\-interface\fP returns: * \fBif.count\fP \- the number of interfaces defined on this domain * \fBif..name\fP \- name in the guest (e.g. \fBeth0\fP) for interface * \fBif..hwaddr\fP \- hardware address in the guest for interface * \fBif..addr.count\fP \- the number of IP addresses of interface * \fBif..addr..type\fP \- the IP address type of addr (e.g. ipv4) * \fBif..addr..addr\fP \- the IP address of addr * \fBif..addr..prefix\fP \- the prefix of IP address of addr .SS guestvcpus .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX guestvcpus domain [[\-\-enable] | [\-\-disable]] [cpulist] .EE .UNINDENT .UNINDENT .sp Query or change state of vCPUs from guest\(aqs point of view using the guest agent. When invoked without \fIcpulist\fP the guest is queried for available guest vCPUs, their state and possibility to be offlined. .sp If \fIcpulist\fP is provided then one of \fI\-\-enable\fP or \fI\-\-disable\fP must be provided too. The desired operation is then executed on the domain. .sp See \fBvcpupin\fP for information on \fIcpulist\fP\&. .SS iothreadadd .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iothreadadd domain iothread_id [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Add a new IOThread to the domain using the specified \fIiothread_id\fP\&. If the \fIiothread_id\fP already exists, the command will fail. The \fIiothread_id\fP must be greater than zero. .sp If \fI\-\-live\fP is specified, affect a running guest. If the guest is not running an error is returned. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. .SS iothreaddel .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iothreaddel domain iothread_id [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Delete an IOThread from the domain using the specified \fIiothread_id\fP\&. If an IOThread is currently assigned to a disk resource such as via the \fBattach\-disk\fP command, then the attempt to remove the IOThread will fail. If the \fIiothread_id\fP does not exist an error will occur. .sp If \fI\-\-live\fP is specified, affect a running guest. If the guest is not running an error is returned. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. .SS iothreadinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iothreadinfo domain [[\-\-live] [\-\-config] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Display basic domain IOThreads information including the IOThread ID and the CPU Affinity for each IOThread. .sp If \fI\-\-live\fP is specified, get the IOThreads data from the running guest. If the guest is not running, an error is returned. If \fI\-\-config\fP is specified, get the IOThreads data from the next start of a persistent guest. If \fI\-\-current\fP is specified or \fI\-\-live\fP and \fI\-\-config\fP are not specified, then get the IOThread data based on the current guest state, which can either be live or offline. .SS iothreadpin .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iothreadpin domain iothread cpulist [[\-\-live] [\-\-config] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Change the pinning of a domain IOThread to host physical CPUs. In order to retrieve a list of all IOThreads, use \fBiothreadinfo\fP\&. To pin an \fIiothread\fP specify the \fIcpulist\fP desired for the IOThread ID as listed in the \fBiothreadinfo\fP output. .sp \fIcpulist\fP is a list of physical CPU numbers. Its syntax is a comma separated list and a special markup using \(aq\-\(aq and \(aq^\(aq (ex. \(aq0\-4\(aq, \(aq0\-3,^2\(aq) can also be allowed. The \(aq\-\(aq denotes the range and the \(aq^\(aq denotes exclusive. If you want to reset iothreadpin setting, that is, to pin an \fIiothread\fP to all physical cpus, simply specify \(aqr\(aq as a \fIcpulist\fP\&. .sp If \fI\-\-live\fP is specified, affect a running guest. If the guest is not running, an error is returned. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given if \fIcpulist\fP is present, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .sp \fBNote\fP: The expression is sequentially evaluated, so \(dq0\-15,^8\(dq is identical to \(dq9\-14,0\-7,15\(dq but not identical to \(dq^8,0\-15\(dq. .SS iothreadset .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iothreadset domain iothread_id [[\-\-poll\-max\-ns ns] [\-\-poll\-grow factor] [\-\-poll\-shrink divisor] [\-\-thread\-pool\-min value] [\-\-thread\-pool\-max value]] [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Modifies an existing iothread of the domain using the specified \fIiothread_id\fP\&. The \fI\-\-poll\-max\-ns\fP provides the maximum polling interval to be allowed for an IOThread in ns. If a 0 (zero) is provided, then polling for the IOThread is disabled. The \fI\-\-poll\-grow\fP is the factor by which the current polling time will be adjusted in order to reach the maximum polling time. If a 0 (zero) is provided, then the default factor will be used. The \fI\-\-poll\-shrink\fP is the quotient by which the current polling time will be reduced in order to get below the maximum polling interval. If a 0 (zero) is provided, then the default quotient will be used. The polling values are purely dynamic for a running guest. Saving, destroying, stopping, etc. the guest will result in the polling values returning to hypervisor defaults at the next start, restore, etc. .sp The \fI\-\-thread\-pool\-min\fP and \fI\-\-thread\-pool\-max\fP options then set lower and upper bound, respectively of number of threads in worker pool of given iothread. For changes to an inactive configuration \-1 can be specified to remove corresponding boundary from the domain configuration. For changes to a running guest it\(aqs recommended to set the upper boundary first (\fI\-\-thread\-pool\-max\fP) and only after that set the lower boundary (\fI\-\-thread\-pool\-min\fP). It is allowed for the lower boundary to be the same as the upper boundary, however it\(aqs not allowed for the upper boundary to be value of zero. .sp If \fI\-\-live\fP is specified, affect a running guest. If the guest is not running an error is returned. If \fI\-\-current\fP is specified or \fI\-\-live\fP is not specified, then handle as if \fI\-\-live\fP was specified. (Where \(dqcurrent\(dq here means whatever the present guest state is: live or offline.) .SS managedsave .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX managedsave domain [\-\-bypass\-cache] [{\-\-running | \-\-paused}] [\-\-verbose] .EE .UNINDENT .UNINDENT .sp Save and destroy (stop) a running domain, so it can be restarted from the same state at a later time. When the virsh \fBstart\fP command is next run for the domain, it will automatically be started from this saved state. If \fI\-\-bypass\-cache\fP 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\fP virsh command and canceled with \fBdomjobabort\fP command (sent by another virsh instance). Another option is to send SIGINT (usually with \fBCtrl\-C\fP) to the virsh process running \fBmanagedsave\fP command. \fI\-\-verbose\fP 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\fP or \fI\-\-paused\fP flag will allow overriding which state the \fBstart\fP should use. .sp The \fBdominfo\fP command can be used to query whether a domain currently has any managed save image. .SS managedsave\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX managedsave\-define domain xml [{\-\-running | \-\-paused}] .EE .UNINDENT .UNINDENT .sp Update the domain XML that will be used when \fIdomain\fP is later started. The \fIxml\fP argument must be a file name containing the alternative XML, with changes only in the host\-specific portions of the domain XML. For example, it can be used to change disk file paths. .sp The managed save image records whether the domain should be started to a running or paused state. Normally, this command does not alter the recorded state; passing either the \fI\-\-running\fP or \fI\-\-paused\fP flag will allow overriding which state the \fBstart\fP should use. .SS managedsave\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX managedsave\-dumpxml [\-\-security\-info] [\-\-xpath EXPRESSION] [\-\-wrap] domain .EE .UNINDENT .UNINDENT .sp Extract the domain XML that was in effect at the time the saved state file \fIfile\fP was created with the \fBmanagedsave\fP command. Using \fI\-\-security\-info\fP will also include security sensitive information. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS managedsave\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX managedsave\-edit domain [{\-\-running | \-\-paused}] .EE .UNINDENT .UNINDENT .sp Edit the XML configuration associated with a saved state file of a \fIdomain\fP was created by the \fBmanagedsave\fP command. .sp The managed save image records whether the domain should be started to a running or paused state. Normally, this command does not alter the recorded state; passing either the \fI\-\-running\fP or \fI\-\-paused\fP flag will allow overriding which state the \fBrestore\fP should use. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh managedsave\-dumpxml domain\-name > state\-file.xml vi state\-file.xml (or make changes with your other text editor) virsh managedsave\-define domain\-name state\-file\-xml .EE .UNINDENT .UNINDENT .sp except that it does some error checking. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SS managedsave\-remove .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX managedsave\-remove domain .EE .UNINDENT .UNINDENT .sp Remove the \fBmanagedsave\fP state file for a domain, if it exists. This ensures the domain will do a full boot the next time it is started. .SS maxvcpus .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX maxvcpus [type] .EE .UNINDENT .UNINDENT .sp Provide the maximum number of virtual CPUs supported for a guest VM on this connection. If provided, the \fItype\fP parameter must be a valid type attribute for the element of XML. .SS memtune .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX memtune domain [\-\-hard\-limit size] [\-\-soft\-limit size] [\-\-swap\-hard\-limit size] [\-\-min\-guarantee size] [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp 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. LXC and QEMU/KVM support \fI\-\-hard\-limit\fP, \fI\-\-soft\-limit\fP, and \fI\-\-swap\-hard\-limit\fP\&. \fI\-\-min\-guarantee\fP is supported only by ESX hypervisor. Each of these limits are scaled integers (see \fBNOTES\fP 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\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .sp For QEMU/KVM, the parameters are applied to the QEMU process as a whole. Thus, when counting them, one needs to add up guest RAM, guest video RAM, and some memory overhead of QEMU itself. The last piece is hard to determine so one needs guess and try. .sp For LXC, the displayed hard_limit value is the current memory setting from the XML or the results from a \fBvirsh setmem\fP command. .INDENT 0.0 .IP \(bu 2 \fI\-\-hard\-limit\fP .sp The maximum memory the guest can use. .IP \(bu 2 \fI\-\-soft\-limit\fP .sp The memory limit to enforce during memory contention. .IP \(bu 2 \fI\-\-swap\-hard\-limit\fP .sp The maximum memory plus swap the guest can use. This has to be more than hard\-limit value provided. .IP \(bu 2 \fI\-\-min\-guarantee\fP .sp The guaranteed minimum memory allocation for the guest. .UNINDENT .sp Specifying \-1 as a value for these limits is interpreted as unlimited. .SS metadata .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX metadata domain [[\-\-live] [\-\-config] | [\-\-current]] [\-\-edit] [uri] [key] [set] [\-\-remove] .EE .UNINDENT .UNINDENT .sp Show or modify custom XML metadata of a domain. The metadata is a user defined XML that allows storing arbitrary XML data in the domain definition. Multiple separate custom metadata pieces can be stored in the domain XML. The pieces are identified by a private XML namespace provided via the \fIuri\fP argument. (See also \fBdesc\fP that works with textual metadata of a domain.) .sp Flags \fI\-\-live\fP or \fI\-\-config\fP select whether this command works on live or persistent definitions of the domain. If both \fI\-\-live\fP and \fI\-\-config\fP are specified, the \fI\-\-config\fP option takes precedence on getting the current description and both live configuration and config are updated while setting the description. \fI\-\-current\fP is exclusive and implied if none of these was specified. .sp Flag \fI\-\-remove\fP specifies that the metadata element specified by the \fIuri\fP argument should be removed rather than updated. .sp Flag \fI\-\-edit\fP specifies that an editor with the metadata identified by the \fIuri\fP argument should be opened and the contents saved back afterwards. Otherwise the new contents can be provided via the \fIset\fP argument. .sp When setting metadata via \fI\-\-edit\fP or \fIset\fP the \fIkey\fP 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\fP and \fIset\fP are specified the XML metadata corresponding to the \fIuri\fP namespace is displayed instead of being modified. .SS migrate .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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] [\-\-postcopy\-resume] [\-\-zerocopy] domain desturi [migrateuri] [graphicsuri] [listen\-address] [dname] [\-\-timeout seconds [\-\-timeout\-suspend | \-\-timeout\-postcopy]] [\-\-xml file] [\-\-migrate\-disks disk\-list] [\-\-migrate\-disks\-detect\-zeroes disk\-list] [\-\-disks\-port port] [\-\-compressed] [\-\-comp\-methods method\-list] [\-\-comp\-mt\-level] [\-\-comp\-mt\-threads] [\-\-comp\-mt\-dthreads] [\-\-comp\-xbzrle\-cache] [\-\-comp\-zlib\-level] [\-\-comp\-zstd\-level] [\-\-auto\-converge] [auto\-converge\-initial] [auto\-converge\-increment] [\-\-persistent\-xml file] [\-\-tls] [\-\-postcopy\-bandwidth bandwidth] [\-\-parallel [\-\-parallel\-connections connections]] [\-\-bandwidth bandwidth] [\-\-tls\-destination hostname] [\-\-disks\-uri URI] [\-\-copy\-storage\-synchronous\-writes] .EE .UNINDENT .UNINDENT .sp Migrate domain to another host. Add \fI\-\-live\fP for live migration; <\-\-p2p> for peer\-2\-peer migration; \fI\-\-direct\fP for direct migration; or \fI\-\-tunnelled\fP for tunnelled migration. \fI\-\-offline\fP 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\fP option. .sp \fI\-\-persistent\fP leaves the domain persistent on destination host, \fI\-\-undefinesource\fP undefines the domain on the source host, and \fI\-\-suspend\fP leaves the domain paused on the destination host. .sp \fI\-\-copy\-storage\-all\fP indicates migration with non\-shared storage with full disk copy, \fI\-\-copy\-storage\-inc\fP 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\-...\fP 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\fP to explicitly specify a list of disk targets to transfer via the comma separated \fBdisk\-list\fP argument. The \fI\-\-migrate\-disks\-detect\-zeroes\fP option which takes a comma separated list of disk target names enables zeroed block detection for the listed migrated disks. These blocks are not transferred or allocated on destination, effectively sparsifying the disk at the cost of CPU overhead. Users must ensure that any pre\-created storage source is cleared and thus reads all\-zeroes before using this option as otherwise the destination image may become corrupted. With \fI\-\-copy\-storage\-synchronous\-writes\fP flag used the disk data migration will synchronously handle guest disk writes to both the original source and the destination to ensure that the disk migration converges at the price of possibly decreased burst performance. .sp \fI\-\-change\-protection\fP 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. .sp \fI\-\-verbose\fP displays the progress of migration. .sp \fI\-\-abort\-on\-error\fP cancels the migration if a soft error (for example I/O error) happens during the migration. .sp \fI\-\-postcopy\fP 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\fP command sent from another virsh instance or use \fI\-\-postcopy\-after\-precopy\fP along with \fI\-\-postcopy\fP to let libvirt automatically switch to post\-copy after the first pass of pre\-copy is finished. The maximum bandwidth consumed during the post\-copy phase may be limited using \fI\-\-postcopy\-bandwidth\fP\&. The maximum bandwidth consumed during the pre\-copy phase may be limited using \fI\-\-bandwidth\fP\&. In case connection between the hosts breaks while migration is in post\-copy mode, the domain cannot be resumed on either source or destination host and the \fBmigrate\fP command will report an error leaving the domain active on both hosts. To recover from such situation repeat the original \fBmigrate\fP command with an additional \fI\-\-postcopy\-resume\fP flag. .sp \fI\-\-auto\-converge\fP forces convergence during live migration. The initial guest CPU throttling rate can be set with \fIauto\-converge\-initial\fP\&. If the initial throttling rate is not enough to ensure convergence, the rate is periodically increased by \fIauto\-converge\-increment\fP\&. .sp \fI\-\-rdma\-pin\-all\fP can be used with RDMA migration (i.e., when \fImigrateuri\fP starts with rdma://) to tell the hypervisor to pin all domain\(aqs memory at once before migration starts rather than letting it pin memory pages as needed. For QEMU/KVM this requires hard_limit memory tuning element (in the domain XML) to be used and set to the maximum memory configured for the domain plus any memory consumed by the QEMU process itself. Beware of setting the memory limit too high (and thus allowing the domain to lock most of the host\(aqs memory). Doing so may be dangerous to both the domain and the host itself since the host\(aqs kernel may run out of memory. .sp \fI\-\-zerocopy\fP requests zero\-copy mechanism to be used for migrating memory pages. For QEMU/KVM this means QEMU will be temporarily allowed to lock all guest pages in host\(aqs memory, although only those that are queued for transfer will be locked at the same time. .sp \fBNote\fP: Individual hypervisors usually do not support all possible types of migration. For example, QEMU 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 QEMU domain, this may happen if the domain uses disks without explicitly setting cache mode to \(dqnone\(dq. Migrating such domains is unsafe unless the disk images are stored on coherent clustered filesystem, such as GFS2 or GPFS. If you are sure the migration is safe or you just do not care, use \fI\-\-unsafe\fP to force the migration. .sp \fIdname\fP is used for renaming the domain to new name during migration, which also usually can be omitted. Likewise, \fI\-\-xml\fP \fBfile\fP is usually omitted, but can be used to supply an alternative XML file for use on the destination to supply a larger set of changes to any host\-specific portions of the domain XML, such as accounting for naming differences between source and destination in accessing underlying storage. If \fI\-\-persistent\fP is enabled, \fI\-\-persistent\-xml\fP \fBfile\fP can be used to supply an alternative XML file which will be used as the persistent guest definition on the destination host. .sp \fI\-\-timeout\fP \fBseconds\fP tells virsh to run a specified action when live migration exceeds that many seconds. It can only be used with \fI\-\-live\fP\&. If \fI\-\-timeout\-suspend\fP is specified, the domain will be suspended after the timeout and the migration will complete offline; this is the default if no \fI\-\-timeout\-\e\(ga\(ga option is specified on the command line. When *\-\-timeout\-postcopy\fP is used, virsh will switch migration from pre\-copy to post\-copy upon timeout; migration has to be started with \fI\-\-postcopy\fP option for this to work. .sp \fI\-\-compressed\fP activates compression, the compression method is chosen with \fI\-\-comp\-methods\fP\&. Supported methods are \(dqmt\(dq, \(dqxbzrle\(dq, \(dqzlib\(dq, and \(dqzstd\(dq. The supported set of methods and their combinations depend on a hypervisor and migration options. QEMU only supports \(dqzlib\(dq and \(dqzstd\(dq methods when \fI\-\-parallel\fP is used and they cannot be used at once. When no methods are specified, a hypervisor default methods will be used. QEMU defaults to \(dqxbzrle\(dq as long as \fI\-\-parallel\fP is not used. For \fI\-\-parallel\fP migrations QEMU does not provide any default compression method and thus it has to be specified explicitly using \fI\-\-comp\-method\fP\&. Compression methods can be tuned further. \fI\-\-comp\-mt\-level\fP sets compression level for \(dqmt\(dq method. Values are in range from 0 to 9, where 1 is maximum speed and 9 is maximum compression. \fI\-\-comp\-mt\-threads\fP and \fI\-\-comp\-mt\-dthreads\fP set the number of compress threads on source and the number of decompress threads on target respectively. \fI\-\-comp\-xbzrle\-cache\fP sets size of page cache in bytes. \fI\-\-comp\-zlib\-level\fP sets the compression level when using \(dqzlib\(dq method. Values are in range from 0 to 9 and defaults to 1, where 0 is no compression, 1 is maximum speed and 9 is maximum compression. \fI\-\-comp\-zstd\-level\fP sets the compression level when using \(dqzstd\(dq method. Values are in range from 0 to 20 and defaults to 1, where 0 is no compression, 1 is maximum speed and 20 is maximum compression. .sp Providing \fI\-\-tls\fP causes the migration to use the host configured TLS setup (see migrate_tls_x509_cert_dir in /etc/libvirt/qemu.conf) in order to perform the migration of the domain. Usage requires proper TLS setup for both source and target. Normally the TLS certificate from the destination host must match the host\(aqs name for TLS verification to succeed. When the certificate does not match the destination hostname and the expected certificate\(aqs hostname is known, \fI\-\-tls\-destination\fP can be used to pass the expected \fIhostname\fP when starting the migration. .sp \fI\-\-parallel\fP option will cause migration data to be sent over multiple parallel connections. The number of such connections can be set using \fI\-\-parallel\-connections\fP\&. Parallel connections may help with saturating the network link between the source and the target and thus speeding up the migration. .sp Running migration can be canceled by interrupting virsh (usually using \fBCtrl\-C\fP) or by \fBdomjobabort\fP command sent from another virsh instance. .sp The \fIdesturi\fP and \fImigrateuri\fP parameters can be used to control which destination the migration uses. \fIdesturi\fP is important for managed migration, but unused for direct migration; \fImigrateuri\fP is required for direct migration, but can usually be automatically determined for managed migration. .sp \fBNote\fP: The \fIdesturi\fP parameter for normal migration and peer2peer migration has different semantics: .INDENT 0.0 .IP \(bu 2 normal migration: the \fIdesturi\fP is an address of the target host as seen from the client machine. .IP \(bu 2 peer2peer migration: the \fIdesturi\fP is an address of the target host as seen from the source machine. .UNINDENT .sp In a special circumstance where you require a complete control of the connection and/or libvirt does not have network access to the remote side you can use a UNIX transport in the URI and specify a socket path in the query, for example with the qemu driver you could use this: .INDENT 0.0 .INDENT 3.5 .sp .EX qemu+unix:///system?socket=/path/to/socket .EE .UNINDENT .UNINDENT .sp When \fImigrateuri\fP is not specified, libvirt will automatically determine the hypervisor specific URI. Some hypervisors, including QEMU, have an optional \(dqmigration_host\(dq configuration parameter (useful when the host has multiple network interfaces). If this is unspecified, libvirt determines a name by looking up the target host\(aqs configured hostname. .sp There are a few scenarios where specifying \fImigrateuri\fP may help: .INDENT 0.0 .IP \(bu 2 The configured hostname is incorrect, or DNS is broken. If a host has a hostname which will not resolve to match one of its public IP addresses, then libvirt will generate an incorrect URI. In this case \fImigrateuri\fP should be explicitly specified, using an IP address, or a correct hostname. .IP \(bu 2 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\fP should be explicitly specified, using an IP address associated with the network to be used. .IP \(bu 2 The firewall restricts what ports are available. When libvirt generates a migration URI, 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\fP might be specified to choose a specific port number outside the default range in order to comply with local firewall policies. .IP \(bu 2 The \fIdesturi\fP uses UNIX transport method. In this advanced case libvirt should not guess a \fImigrateuri\fP and it should be specified using UNIX socket path URI: .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX unix:///path/to/socket .EE .UNINDENT .UNINDENT .sp See for more details on migration URIs. .sp Optional \fIgraphicsuri\fP 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 IP 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\fP may be used to specify the address the client should connect to. The URI is formed as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX protocol://hostname[:port]/[?parameters] .EE .UNINDENT .UNINDENT .sp where protocol is either \(dqspice\(dq or \(dqvnc\(dq and parameters is a list of protocol specific parameters separated by \(aq&\(aq. Currently recognized parameters are \(dqtlsPort\(dq and \(dqtlsSubject\(dq. For example, .INDENT 0.0 .INDENT 3.5 .sp .EX spice://target.host.com:1234/?tlsPort=4567 .EE .UNINDENT .UNINDENT .sp Optional \fIlisten\-address\fP 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 specifying the listen address and will return an error if this parameter is used. This parameter cannot be used if \fIdesturi\fP uses UNIX transport method. .sp Optional \fIdisks\-port\fP sets the port that hypervisor on destination side should bind to for incoming disks traffic. Currently it is supported only by QEMU. .sp Optional \fIdisks\-uri\fP can also be specified (mutually exclusive with \fIdisks\-port\fP) to specify what the remote hypervisor should bind/connect to when migrating disks. This can be \fItcp://address:port\fP to specify a listen address (which overrides \fI\-\-migrate\-uri\fP and \fI\-\-listen\-address\fP for the disk migration) and a port or \fIunix:///path/to/socket\fP in case you need the disk migration to happen over a UNIX socket with that specified path. In this case you need to make sure the same socket path is accessible to both source and destination hypervisors and connecting to the socket on the source (after hypervisor creates it on the destination) will actually connect to the destination. If you are using SELinux (at least on the source host) you need to make sure the socket on the source is accessible to libvirtd/QEMU for connection. Libvirt cannot change the context of the existing socket because it is different from the file representation of the socket and the context is chosen by its creator (usually by using \fIsetsockcreatecon{,_raw}()\fP functions). .SS migrate\-compcache .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX migrate\-compcache domain [\-\-size bytes] .EE .UNINDENT .UNINDENT .sp Sets and/or gets size of the cache (in bytes) used for compressing repeatedly transferred memory pages during live migration. When called without \fIsize\fP, the command just prints current size of the compression cache. When \fIsize\fP is specified, the hypervisor is asked to change compression cache to \fIsize\fP 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\fP 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. .SS migrate\-getmaxdowntime .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX migrate\-getmaxdowntime domain .EE .UNINDENT .UNINDENT .sp Get the maximum tolerable downtime for a domain which is being live\-migrated to another host. This is the number of milliseconds the guest is allowed to be down at the end of live migration. .SS migrate\-getspeed .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX migrate\-getspeed domain [\-\-postcopy] .EE .UNINDENT .UNINDENT .sp Get the maximum migration bandwidth (in MiB/s) for a domain. If the \fI\-\-postcopy\fP option is specified, the command will get the maximum bandwidth allowed during a post\-copy migration phase. .SS migrate\-postcopy .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX migrate\-postcopy domain .EE .UNINDENT .UNINDENT .sp Switch the current migration from pre\-copy to post\-copy. This is only supported for a migration started with \fI\-\-postcopy\fP option. .SS migrate\-setmaxdowntime .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX migrate\-setmaxdowntime domain downtime .EE .UNINDENT .UNINDENT .sp Set maximum tolerable downtime for a domain which is being live\-migrated to another host. The \fIdowntime\fP is a number of milliseconds the guest is allowed to be down at the end of live migration. .SS migrate\-setspeed .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX migrate\-setspeed domain bandwidth [\-\-postcopy] .EE .UNINDENT .UNINDENT .sp Set the maximum migration bandwidth (in MiB/s) for a domain which is being migrated to another host. \fIbandwidth\fP 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. If the \fI\-\-postcopy\fP option is specified, the command will set the maximum bandwidth allowed during a post\-copy migration phase. .SS numatune .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX numatune domain [\-\-mode mode] [\-\-nodeset nodeset] [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Set or get a domain\(aqs numa parameters, corresponding to the element of domain XML. Without flags, the current settings are displayed. .sp \fImode\fP can be one of \(gastrict\(aq, \(gainterleave\(aq, \(gapreferred\(aq and \(aqrestrictive\(aq or any valid number from the virDomainNumatuneMemMode enum in case the daemon supports it. For a running domain, the mode can\(aqt be changed, and the nodeset can be changed only if the domain was started with \(garestrictive\(aq mode. .sp \fInodeset\fP is a list of numa nodes used by the host for running the domain. Its syntax is a comma separated list, with \(aq\-\(aq for ranges and \(aq^\(aq for excluding a node. .sp If \fI\-\-live\fP is specified, set scheduler information of a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. .sp For running guests in Linux hosts, the changes made in the domain\(aqs numa parameters does not imply that the guest memory will be moved to a different nodeset immediately. The memory migration depends on the guest activity, and the memory of an idle guest will remain in its previous nodeset for longer. The presence of VFIO devices will also lock parts of the guest memory in the same nodeset used to start the guest, regardless of nodeset changes. .SS perf .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX perf domain [\-\-enable eventSpec] [\-\-disable eventSpec] [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp 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 CPU 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 QEMU/KVM supports this command. The \fI\-\-enable\fP and \fI\-\-disable\fP option combined with \fBeventSpec\fP can be used to enable or disable specific performance event. \fBeventSpec\fP is a string list of one or more events separated by commas. Valid event names are as follows: .sp \fBValid perf event names\fP .INDENT 0.0 .IP \(bu 2 \fBcmt\fP \- A PQos (Platform Qos) feature to monitor the usage of cache by applications running on the platform. .IP \(bu 2 \fBmbmt\fP \- Provides a way to monitor the total system memory bandwidth between one level of cache and another. .IP \(bu 2 \fBmbml\fP \- Provides a way to limit the amount of data (bytes/s) send through the memory controller on the socket. .IP \(bu 2 \fBcache_misses\fP \- Provides the count of cache misses by applications running on the platform. .IP \(bu 2 \fBcache_references\fP \- Provides the count of cache hits by applications running on th e platform. .IP \(bu 2 \fBinstructions\fP \- Provides the count of instructions executed by applications running on the platform. .IP \(bu 2 \fBcpu_cycles\fP \- Provides the count of cpu cycles (total/elapsed). May be used with instructions in order to get a cycles per instruction. .IP \(bu 2 \fBbranch_instructions\fP \- Provides the count of branch instructions executed by applications running on the platform. .IP \(bu 2 \fBbranch_misses\fP \- Provides the count of branch misses executed by applications running on the platform. .IP \(bu 2 \fBbus_cycles\fP \- Provides the count of bus cycles executed by applications running on the platform. .IP \(bu 2 \fBstalled_cycles_frontend\fP \- Provides the count of stalled cpu cycles in the frontend of the instruction processor pipeline by applications running on the platform. .IP \(bu 2 \fBstalled_cycles_backend\fP \- Provides the count of stalled cpu cycles in the backend of the instruction processor pipeline by applications running on the platform. .IP \(bu 2 \fBref_cpu_cycles\fP \- Provides the count of total cpu cycles not affected by CPU frequency scaling by applications running on the platform. .IP \(bu 2 \fBcpu_clock\fP \- Provides the cpu clock time consumed by applications running on the platform. .IP \(bu 2 \fBtask_clock\fP \- Provides the task clock time consumed by applications running on the platform. .IP \(bu 2 \fBpage_faults\fP \- Provides the count of page faults by applications running on the platform. .IP \(bu 2 \fBcontext_switches\fP \- Provides the count of context switches by applications running on the platform. .IP \(bu 2 \fBcpu_migrations\fP \- Provides the count cpu migrations by applications running on the platform. .IP \(bu 2 \fBpage_faults_min\fP \- Provides the count minor page faults by applications running on the platform. .IP \(bu 2 \fBpage_faults_maj\fP \- Provides the count major page faults by applications running on the platform. .IP \(bu 2 \fBalignment_faults\fP \- Provides the count alignment faults by applications running on the platform. .IP \(bu 2 \fBemulation_faults\fP \- Provides the count emulation faults by applications running on the platform. .UNINDENT .sp \fBNote\fP: The statistics can be retrieved using the \fBdomstats\fP command using the \fI\-\-perf\fP flag. .sp If \fI\-\-live\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .SS reboot .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX reboot domain [\-\-mode MODE\-LIST] .EE .UNINDENT .UNINDENT .sp Reboot a domain. This acts just as if the domain had the \fBreboot\fP 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\fP parameter in the domain\(aqs XML definition. .sp By default the hypervisor will try to pick a suitable shutdown method. To specify an alternative method, the \fI\-\-mode\fP parameter can specify a comma separated list which includes \fBacpi\fP, \fBagent\fP, \fBinitctl\fP, \fBsignal\fP and \fBparavirt\fP\&. 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. .SS reset .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX reset domain .EE .UNINDENT .UNINDENT .sp Reset a domain immediately without any guest shutdown. \fBreset\fP emulates the power reset button on a machine, where all guest hardware sees the RST line set and reinitializes internal state. .sp \fBNote\fP: Reset without any guest OS shutdown risks data loss. .SS restore .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX restore state\-file [\-\-bypass\-cache] [\-\-xml file] [{\-\-running | \-\-paused}] [\-\-reset\-nvram] .EE .UNINDENT .UNINDENT .sp Restores a domain from a \fBvirsh save\fP state file. See \fIsave\fP for more info. .sp If \fI\-\-bypass\-cache\fP is specified, the restore will avoid the file system cache, although this may slow down the operation. .sp \fI\-\-xml\fP \fBfile\fP is usually omitted, but can be used to supply an alternative XML file for use on the restored guest with changes only in the host\-specific portions of the domain XML. 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\fP or \fI\-\-paused\fP flag will allow overriding which state the domain should be started in. .sp If \fI\-\-reset\-nvram\fP is specified, any existing NVRAM file will be deleted and re\-initialized from its pristine template. .sp \fBNote\fP: To avoid corrupting file system contents within the domain, you should not reuse the saved state file for a second \fBrestore\fP unless you have also reverted all storage volumes back to the same contents as when the state file was created. .SS resume .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX resume domain .EE .UNINDENT .UNINDENT .sp 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. .SS save .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX save domain state\-file [\-\-bypass\-cache] [\-\-xml file] [{\-\-running | \-\-paused}] [\-\-verbose] .EE .UNINDENT .UNINDENT .sp Saves a running domain (RAM, 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\fP restores from this state file. If \fI\-\-bypass\-cache\fP 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\fP virsh command and canceled with \fBdomjobabort\fP command (sent by another virsh instance). Another option is to send SIGINT (usually with \fBCtrl\-C\fP) to the virsh process running \fBsave\fP command. \fI\-\-verbose\fP 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 TCP timeouts may have expired. .sp \fI\-\-xml\fP \fBfile\fP is usually omitted, but can be used to supply an alternative XML file for use on the restored guest with changes only in the host\-specific portions of the domain XML. 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\fP or \fI\-\-paused\fP flag will allow overriding which state the \fBrestore\fP 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\fP family of commands. .SS save\-image\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX save\-image\-define file xml [{\-\-running | \-\-paused}] .EE .UNINDENT .UNINDENT .sp Update the domain XML that will be used when \fIfile\fP is later used in the \fBrestore\fP command. The \fIxml\fP argument must be a file name containing the alternative XML, with changes only in the host\-specific portions of the domain XML. 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\fP or \fI\-\-paused\fP flag will allow overriding which state the \fBrestore\fP should use. .SS save\-image\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX save\-image\-dumpxml [\-\-security\-info] [\-\-xpath EXPRESSION] [\-\-wrap] file .EE .UNINDENT .UNINDENT .sp Extract the domain XML that was in effect at the time the saved state file \fIfile\fP was created with the \fBsave\fP command. Using \fI\-\-security\-info\fP will also include security sensitive information. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS save\-image\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX save\-image\-edit file [{\-\-running | \-\-paused}] .EE .UNINDENT .UNINDENT .sp Edit the XML configuration associated with a saved state file \fIfile\fP created by the \fBsave\fP 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\fP or \fI\-\-paused\fP flag will allow overriding which state the \fBrestore\fP should use. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX 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 .EE .UNINDENT .UNINDENT .sp except that it does some error checking. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SS schedinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX schedinfo domain [[\-\-config] [\-\-live] | [\-\-current]] [[\-\-set] parameter=value]... schedinfo [\-\-weight number] [\-\-cap number] domain .EE .UNINDENT .UNINDENT .sp Allows you to show (and set) the domain scheduler parameters. The parameters available for each hypervisor are: .sp LXC (posix scheduler) : cpu_shares, vcpu_period, vcpu_quota .sp QEMU/KVM (posix scheduler): cpu_shares, vcpu_period, vcpu_quota, emulator_period, emulator_quota, global_period, global_quota, iothread_period, iothread_quota .sp Xen (credit scheduler): weight, cap .sp ESX (allocation scheduler): reservation, limit, shares .sp If \fI\-\-live\fP is specified, set scheduler information of a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. .sp \fBNote\fP: The cpu_shares parameter has a valid value range of 2\-262144 with cgroups v1, 1\-10000 with cgroups v2. .sp \fBNote\fP: The weight and cap parameters are defined only for the XEN_CREDIT scheduler. .sp \fBNote\fP: 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\-17592186044415 or less than 0. The value 0 for either parameter is the same as not specifying that parameter. .SS screenshot .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX screenshot domain [imagefilepath] [\-\-screen screenID] .EE .UNINDENT .UNINDENT .sp Takes a screenshot of a current domain console and stores it into a file. Optionally, if the hypervisor supports more displays for a domain, \fIscreenID\fP allows specifying 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 ID 5 addresses the second head on the second card. .SS send\-key .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX send\-key domain [\-\-codeset codeset] [\-\-holdtime holdtime] keycode... .EE .UNINDENT .UNINDENT .sp Parse the \fIkeycode\fP sequence as keystrokes to send to \fIdomain\fP\&. Each \fIkeycode\fP can either be a numeric value or a symbolic name from the corresponding codeset. If \fI\-\-holdtime\fP is given, each keystroke will be held for that many milliseconds. The default codeset is \fBlinux\fP, but use of the \fI\-\-codeset\fP 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. .INDENT 0.0 .IP \(bu 2 \fBlinux\fP .sp The numeric values are those defined by the Linux generic input event subsystem. The symbolic names match the corresponding Linux key constant macro names. .sp See virkeycode\-linux(7) and virkeyname\-linux(7) .IP \(bu 2 \fBxt\fP .sp The numeric values are those defined by the original XT keyboard controller. No symbolic names are provided .sp See virkeycode\-xt(7) .IP \(bu 2 \fBatset1\fP .sp The numeric values are those defined by the AT keyboard controller, set 1 (aka XT compatible set). Extended keycoes from \fBatset1\fP may differ from extended keycodes in the \fBxt\fP codeset. No symbolic names are provided .sp See virkeycode\-atset1(7) .IP \(bu 2 \fBatset2\fP .sp The numeric values are those defined by the AT keyboard controller, set 2. No symbolic names are provided .sp See virkeycode\-atset2(7) .IP \(bu 2 \fBatset3\fP .sp The numeric values are those defined by the AT keyboard controller, set 3 (aka PS/2 compatible set). No symbolic names are provided .sp See virkeycode\-atset3(7) .IP \(bu 2 \fBos_x\fP .sp The numeric values are those defined by the macOS keyboard input subsystem. The symbolic names match the corresponding macOS key constant macro names .sp See virkeycode\-osx(7) and virkeyname\-osx(7) .IP \(bu 2 \fBxt_kbd\fP .sp The numeric values are those defined by the Linux KBD device. These are a variant on the original XT codeset, but often with different encoding for extended keycodes. No symbolic names are provided. .sp See virkeycode\-xtkbd(7) .IP \(bu 2 \fBwin32\fP .sp The numeric values are those defined by the Win32 keyboard input subsystem. The symbolic names match the corresponding Win32 key constant macro names .sp See virkeycode\-win32(7) and virkeyname\-win32(7) .IP \(bu 2 \fBusb\fP .sp The numeric values are those defined by the USB HID specification for keyboard input. No symbolic names are provided .sp See virkeycode\-usb(7) .IP \(bu 2 \fBqnum\fP .sp The numeric values are those defined by the QNUM extension for sending raw keycodes. These are a variant on the XT 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. .sp See virkeycode\-qnum(7) .UNINDENT .sp \fBExamples:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX # send three strokes \(aqk\(aq, \(aqe\(aq, \(aqy\(aq, 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 # 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 .EE .UNINDENT .UNINDENT .SS send\-process\-signal .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX send\-process\-signal domain\-id pid signame .EE .UNINDENT .UNINDENT .sp Send a signal \fIsigname\fP to the process identified by \fIpid\fP running in the virtual domain \fIdomain\-id\fP\&. The \fIpid\fP is a process ID in the virtual domain namespace. .sp The \fIsigname\fP argument may be either an integer signal constant number, or one of the symbolic names: .INDENT 0.0 .INDENT 3.5 .sp .EX \(dqnop\(dq, \(dqhup\(dq, \(dqint\(dq, \(dqquit\(dq, \(dqill\(dq, \(dqtrap\(dq, \(dqabrt\(dq, \(dqbus\(dq, \(dqfpe\(dq, \(dqkill\(dq, \(dqusr1\(dq, \(dqsegv\(dq, \(dqusr2\(dq, \(dqpipe\(dq, \(dqalrm\(dq, \(dqterm\(dq, \(dqstkflt\(dq, \(dqchld\(dq, \(dqcont\(dq, \(dqstop\(dq, \(dqtstp\(dq, \(dqttin\(dq, \(dqttou\(dq, \(dqurg\(dq, \(dqxcpu\(dq, \(dqxfsz\(dq, \(dqvtalrm\(dq, \(dqprof\(dq, \(dqwinch\(dq, \(dqpoll\(dq, \(dqpwr\(dq, \(dqsys\(dq, \(dqrt0\(dq, \(dqrt1\(dq, \(dqrt2\(dq, \(dqrt3\(dq, \(dqrt4\(dq, \(dqrt5\(dq, \(dqrt6\(dq, \(dqrt7\(dq, \(dqrt8\(dq, \(dqrt9\(dq, \(dqrt10\(dq, \(dqrt11\(dq, \(dqrt12\(dq, \(dqrt13\(dq, \(dqrt14\(dq, \(dqrt15\(dq, \(dqrt16\(dq, \(dqrt17\(dq, \(dqrt18\(dq, \(dqrt19\(dq, \(dqrt20\(dq, \(dqrt21\(dq, \(dqrt22\(dq, \(dqrt23\(dq, \(dqrt24\(dq, \(dqrt25\(dq, \(dqrt26\(dq, \(dqrt27\(dq, \(dqrt28\(dq, \(dqrt29\(dq, \(dqrt30\(dq, \(dqrt31\(dq, \(dqrt32\(dq .EE .UNINDENT .UNINDENT .sp The symbol name may optionally be prefixed with \fBsig\fP or \fBsig_\fP and may be in uppercase or lowercase. .sp \fBExamples:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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 SIG_HUP .EE .UNINDENT .UNINDENT .SS set\-lifecycle\-action .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX set\-lifecycle\-action domain type action [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Set the lifecycle \fIaction\fP for specified lifecycle \fItype\fP\&. The valid types are \(dqpoweroff\(dq, \(dqreboot\(dq and \(dqcrash\(dq, and for each of them valid \fIaction\fP is one of \(dqdestroy\(dq, \(dqrestart\(dq, \(dqrename\-restart\(dq, \(dqpreserve\(dq. For \fItype\fP \(dqcrash\(dq, additional actions \(dqcoredump\-destroy\(dq and \(dqcoredump\-restart\(dq are supported. .SS set\-user\-password .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX set\-user\-password domain user password [\-\-encrypted] .EE .UNINDENT .UNINDENT .sp Set the password for the \fIuser\fP account in the guest domain. .sp If \fI\-\-encrypted\fP is specified, the password is assumed to be already encrypted by the method required by the guest OS. .sp For QEMU/KVM, this requires the guest agent to be configured and running. .SS set\-user\-sshkeys .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX set\-user\-sshkeys domain user [\-\-file FILE] [{\-\-reset | \-\-remove}] .EE .UNINDENT .UNINDENT .sp Append keys read from \fIFILE\fP into \fIuser\fP\(aqs SSH authorized keys file in the guest \fIdomain\fP\&. In the \fIFILE\fP keys must be on separate lines and each line must follow authorized keys format as defined by \fIsshd(8)\fP\&. .sp If \fI\-\-reset\fP is specified, then the guest authorized keys file content is removed before appending new keys. As a special case, if \fI\-\-reset\fP is provided and no \fIFILE\fP was provided then no new keys are added and the authorized keys file is cleared out. .sp If \fI\-\-remove\fP is specified, then instead of adding any new keys then keys read from \fIFILE\fP are removed from the authorized keys file. It is not considered an error if the key does not exist in the file. .SS setmaxmem .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX setmaxmem domain size [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Change the maximum memory allocation limit for a guest domain. If \fI\-\-live\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .sp Some hypervisors such as QEMU/KVM don\(aqt 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 NUMA enabled domains on QEMU). For complex configuration changes use command \fBedit\fP instead). .sp \fIsize\fP is a scaled integer (see \fBNOTES\fP above); it defaults to kibibytes (blocks of 1024 bytes) unless you provide a suffix (and the older option name \fI\-\-kilobytes\fP 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). .SS setmem .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX setmem domain size [[\-\-config] [\-\-live] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Change the memory allocation for a guest domain. If \fI\-\-live\fP is specified, perform a memory balloon of a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .sp \fIsize\fP is a scaled integer (see \fBNOTES\fP above); it defaults to kibibytes (blocks of 1024 bytes) unless you provide a suffix (and the older option name \fI\-\-kilobytes\fP 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 PV balloon driver. .sp For LXC, 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 \(dqMemTotal\(dq value. When viewing the value from the host, use the \fBvirsh memtune\fP command. In order to view the current memory in use and the maximum value allowed to set memory, use the \fBvirsh dominfo\fP command. .SS setvcpus .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX setvcpus domain count [\-\-maximum] [[\-\-config] [\-\-live] | [\-\-current]] [\-\-guest] [\-\-hotpluggable] .EE .UNINDENT .UNINDENT .sp 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\fP flag. .sp The \fIcount\fP 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\fP flag is specified, the change is made to the stored XML configuration for the guest domain, and will only take effect when the guest domain is next started. .sp If \fI\-\-live\fP is specified, the guest domain must be active, and the change takes place immediately. Both the \fI\-\-config\fP and \fI\-\-live\fP 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\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. .sp When no flags are given, the \fI\-\-live\fP flag is assumed and the guest domain must be active. In this situation it is up to the hypervisor whether the \fI\-\-config\fP flag is also assumed, and therefore whether the XML configuration is adjusted to make the change persistent. .sp If \fI\-\-guest\fP 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\fP flag. Vcpus added to live domains supporting vcpu unplug are automatically marked as hotpluggable. .sp The \fI\-\-maximum\fP 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\fP flag, and not with the \fI\-\-live\fP or the \fI\-\-current\fP flag. Note that it may not be possible to change the maximum vcpu count if the processor topology is specified for the guest. .SS setvcpu .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX setvcpu domain vcpulist [\-\-enable] | [\-\-disable] [[\-\-live] [\-\-config] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Change state of individual vCPUs using hot(un)plug mechanism. .sp See \fBvcpupin\fP for information on format of \fIvcpulist\fP\&. Hypervisor drivers may require that \fIvcpulist\fP contains exactly vCPUs belonging to one hotpluggable entity. This is usually just a single vCPU but certain architectures such as ppc64 require a full core to be specified at once. .sp Note that hypervisors may refuse to disable certain vcpus such as vcpu 0 or others. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. This is the default. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. .SS shutdown .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX shutdown domain [\-\-mode MODE\-LIST] .EE .UNINDENT .UNINDENT .sp Gracefully shuts down a domain. This coordinates with the domain OS 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\fP parameter in the domain\(aqs XML definition. .sp If \fIdomain\fP is transient, then the metadata of any snapshots and checkpoints will be lost once the guest stops running, but the underlying contents still exist, and a new domain with the same name and UUID can restore the snapshot metadata with \fBsnapshot\-create\fP, and the checkpoint metadata with \fBcheckpoint\-create\fP\&. .sp By default the hypervisor will try to pick a suitable shutdown method. To specify an alternative method, the \fI\-\-mode\fP parameter can specify a comma separated list which includes \fBacpi\fP, \fBagent\fP, \fBinitctl\fP, \fBsignal\fP and \fBparavirt\fP\&. 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. .SS start .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX start domain\-name\-or\-uuid [\-\-console] [\-\-paused] [\-\-autodestroy] [\-\-bypass\-cache] [\-\-force\-boot] [\-\-pass\-fds N,M,...] [\-\-reset\-nvram] .EE .UNINDENT .UNINDENT .sp Start a (previously defined) inactive domain, either from the last \fBmanagedsave\fP state, or via a fresh boot if no managedsave state is present. The domain will be paused if the \fI\-\-paused\fP option is used and supported by the driver; otherwise it will be running. If \fI\-\-console\fP is requested, attach to the console after creation. If \fI\-\-autodestroy\fP is requested, then the guest will be automatically destroyed when virsh closes its connection to libvirt, or otherwise exits. If \fI\-\-bypass\-cache\fP 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\fP is specified, then any managedsave state is discarded and a fresh boot occurs. .sp If \fI\-\-pass\-fds\fP 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 If \fI\-\-reset\-nvram\fP is specified, any existing NVRAM file will be deleted and re\-initialized from its pristine template. .SS suspend .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX suspend domain .EE .UNINDENT .UNINDENT .sp Suspend a running domain. It is kept in memory but won\(aqt be scheduled anymore. .SS ttyconsole .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX ttyconsole domain .EE .UNINDENT .UNINDENT .sp Output the device used for the TTY console of the domain. If the information is not available the processes will provide an exit code of 1. .SS undefine .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX undefine domain [\-\-managed\-save] [\-\-snapshots\-metadata] [\-\-checkpoints\-metadata] [\-\-nvram] [\-\-keep\-nvram] [ {\-\-storage volumes | \-\-remove\-all\-storage [\-\-delete\-storage\-volume\-snapshots]} \-\-wipe\-storage] [\-\-tpm] [\-\-keep\-tpm] .EE .UNINDENT .UNINDENT .sp 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\fP flag guarantees that any managed save image (see the \fBmanagedsave\fP 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\fP flag guarantees that any snapshots (see the \fBsnapshot\-list\fP 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 The \fI\-\-checkpoints\-metadata\fP flag guarantees that any checkpoints (see the \fBcheckpoint\-list\fP command) are also cleaned up when undefining an inactive domain. Without the flag, attempts to undefine an inactive domain with checkpoint metadata will fail. If the domain is active, this flag is ignored. .sp \fI\-\-nvram\fP and \fI\-\-keep\-nvram\fP 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\fP flag takes a parameter \fBvolumes\fP, 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\(aqs treated as if the volume was successfully deleted. Only volumes managed by libvirt in storage pools can be removed this way. Note that this also removes only the top level image of a backing chain, any backing stores of the image are kept as they may be shared. (See \fBdomblklist\fP for list of target names associated to a domain). Example: \-\-storage vda,/path/to/storage.img .sp The \fI\-\-remove\-all\-storage\fP flag specifies that all of the domain\(aqs storage volumes should be deleted as if they were specified via \fI\-\-storage\fP\&. .sp The \fI\-\-delete\-storage\-volume\-snapshots\fP (previously \fI\-\-delete\-snapshots\fP) flag specifies that any snapshots associated with the storage volume should be deleted as well. Requires the \fI\-\-remove\-all\-storage\fP flag to be provided. Not all storage drivers support this option, presently only rbd. Using this when also removing volumes handled by a storage driver which does not support the flag will result in failure. .sp The flag \fI\-\-wipe\-storage\fP specifies that the storage volumes should be wiped before removal. .sp \fI\-\-tpm\fP and \fI\-\-keep\-tpm\fP specify accordingly to delete or keep a TPM\(aqs persistent state directory structure and files. If the flags are omitted then the persistent_state attribute in the TPM emulator definition in the domain XML determines whether the TPM state is kept. .sp NOTE: For an inactive domain, the domain name or UUID must be used as the \fIdomain\fP\&. .SS vcpucount .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vcpucount domain [{\-\-maximum | \-\-active} {\-\-config | \-\-live | \-\-current}] [\-\-guest] .EE .UNINDENT .UNINDENT .sp Print information about the virtual cpu counts of the given \fIdomain\fP\&. 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 \(dqcurrent\(dq on the rows that can be queried in isolation via the \fI\-\-active\fP flag, rather than relating to the \fI\-\-current\fP flag. .sp \fI\-\-maximum\fP requests information on the maximum cap of vcpus that a domain can add via \fBsetvcpus\fP, while \fI\-\-active\fP shows the current usage; these two flags cannot both be specified. \fI\-\-config\fP requires a persistent guest and requests information regarding the next time the domain will be booted, \fI\-\-live\fP requires a running domain and lists current values, and \fI\-\-current\fP queries according to the current state of the domain (corresponding to \fI\-\-live\fP if running, or \fI\-\-config\fP if inactive); these three flags are mutually exclusive. .sp If \fI\-\-guest\fP 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. .SS vcpuinfo .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vcpuinfo domain [\-\-pretty] .EE .UNINDENT .UNINDENT .sp 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\fP, cpu affinities are shown as ranges. .sp \fBExample:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX $ 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 .EE .UNINDENT .UNINDENT .sp \fBSTATES\fP .sp The State field displays the current operating state of a virtual CPU .INDENT 0.0 .IP \(bu 2 \fBoffline\fP .sp The virtual CPU is offline and not usable by the domain. This state is not supported by all hypervisors. .IP \(bu 2 \fBrunning\fP .sp The virtual CPU is available to the domain and is operating. .IP \(bu 2 \fBblocked\fP .sp The virtual CPU is available to the domain but is waiting for a resource. This state is not supported by all hypervisors, in which case \fIrunning\fP may be reported instead. .IP \(bu 2 \fBno state\fP .sp The virtual CPU state could not be determined. This could happen if the hypervisor is newer than virsh. .IP \(bu 2 \fBN/A\fP .sp There\(aqs no information about the virtual CPU state available. This can be the case if the domain is not running or the hypervisor does not report the virtual CPU state. .UNINDENT .SS vcpupin .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vcpupin domain [vcpu] [cpulist] [[\-\-live] [\-\-config] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Query or change the pinning of domain VCPUs to host physical CPUs. To pin a single \fIvcpu\fP, specify \fIcpulist\fP; otherwise, you can query one \fIvcpu\fP or omit \fIvcpu\fP to list all at once. .sp \fIcpulist\fP is a list of physical CPU numbers. Its syntax is a comma separated list and a special markup using \(aq\-\(aq and \(aq^\(aq (ex. \(aq0\-4\(aq, \(aq0\-3,^2\(aq) can also be allowed. The \(aq\-\(aq denotes the range and the \(aq^\(aq denotes exclusive. For pinning the \fIvcpu\fP to all physical cpus specify \(aqr\(aq as a \fIcpulist\fP\&. If \fI\-\-live\fP is specified, affect a running guest. If \fI\-\-config\fP is specified, affect the next start of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given if \fIcpulist\fP is present, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .sp \fBNote\fP: The expression is sequentially evaluated, so \(dq0\-15,^8\(dq is identical to \(dq9\-14,0\-7,15\(dq but not identical to \(dq^8,0\-15\(dq. .SS vncdisplay .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vncdisplay domain .EE .UNINDENT .UNINDENT .sp Output the IP address and port number for the VNC display. If the information is not available the processes will provide an exit code of 1. .SH DEVICE COMMANDS .sp The following commands manipulate devices associated to domains. The \fIdomain\fP can be specified as a short integer, a name or a full UUID. 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. .SS attach\-device .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX attach\-device domain FILE [[[\-\-live] [\-\-config] | [\-\-current]] | [\-\-persistent]] .EE .UNINDENT .UNINDENT .sp Attach a device to the domain, using a device definition in an XML file using a device definition element such as or as the top\-level element. See the documentation at https://libvirt.org/formatdomain.html#elementsDevices to learn about libvirt XML format for a device. If \fI\-\-config\fP is specified the command alters the persistent guest 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\fP for this usage. For passthrough host devices, see also \fBnodedev\-detach\fP, needed if the PCI device does not use managed mode. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. When no flag is specified legacy API is used whose behavior depends on the hypervisor driver. .sp For compatibility purposes, \fI\-\-persistent\fP behaves like \fI\-\-config\fP for an offline domain, and like \fI\-\-live\fP \fI\-\-config\fP for a running domain. .sp \fBNote\fP: using of partial device definition XML files may lead to unexpected results as some fields may be autogenerated and thus match devices other than expected. .SS attach\-disk .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX attach\-disk domain source target [[[\-\-live] [\-\-config] | [\-\-current]] | [\-\-persistent]] [\-\-targetbus bus] [\-\-driver driver] [\-\-subdriver subdriver] [\-\-iothread iothread] [\-\-cache cache] [\-\-io io] [\-\-type type] [\-\-alias alias] [\-\-mode mode] [\-\-sourcetype sourcetype] [\-\-source\-protocol protocol] [\-\-source\-host\-name hostname:port] [\-\-source\-host\-transport transport] [\-\-source\-host\-socket socket] [\-\-serial serial] [\-\-wwn wwn] [\-\-rawio] [\-\-address address] [\-\-multifunction] [\-\-print\-xml] .EE .UNINDENT .UNINDENT .sp Attach a new disk device to the domain. \fIsource\fP is path for the files and devices unless \fI\-\-source\-protocol\fP is specified, in which case \fIsource\fP is the name of a network disk. \fItarget\fP controls the bus or device under which the disk is exposed to the guest OS. It indicates the \(dqlogical\(dq device name; the optional \fItargetbus\fP attribute specifies the type of disk device to emulate; possible values are driver specific, with typical values being \fIide\fP, \fIscsi\fP, \fIvirtio\fP, \fIxen\fP, \fIusb\fP, \fIsata\fP, or \fIsd\fP, if omitted, the bus type is inferred from the style of the device name (e.g. a device named \(aqsda\(aq will typically be exported using a SCSI bus). \fIdriver\fP can be \fIfile\fP, \fItap\fP or \fIphy\fP for the Xen hypervisor depending on the kind of access; or \fIqemu\fP for the QEMU emulator. Further details to the driver can be passed using \fIsubdriver\fP\&. For Xen \fIsubdriver\fP can be \fIaio\fP, while for QEMU subdriver should match the format of the disk source, such as \fIraw\fP or \fIqcow2\fP\&. Hypervisor default will be used if \fIsubdriver\fP is not specified. However, the default may not be correct, esp. for QEMU as for security reasons it is configured not to detect disk formats. \fItype\fP can indicate \fIlun\fP, \fIcdrom\fP or \fIfloppy\fP 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\fP for this usage instead. \fIalias\fP can set user supplied alias. \fImode\fP can specify the two specific mode \fIreadonly\fP or \fIshareable\fP\&. \fIsourcetype\fP can indicate the type of source (block|file|network) \fIcache\fP can be one of \(dqdefault\(dq, \(dqnone\(dq, \(dqwritethrough\(dq, \(dqwriteback\(dq, \(dqdirectsync\(dq or \(dqunsafe\(dq. \fIio\fP controls specific policies on I/O; QEMU guests support \(dqthreads\(dq, \(dqnative\(dq and \(dqio_uring\(dq. \fIiothread\fP is the number within the range of domain IOThreads to which this disk may be attached (QEMU only). \fIserial\fP is the serial of disk device. \fIwwn\fP is the wwn of disk device. \fIrawio\fP indicates the disk needs rawio capability. \fIaddress\fP is the address of disk device in the form of pci:domain.bus.slot.function, scsi:controller.bus.unit, ide:controller.bus.unit, usb:bus.port, sata:controller.bus.unit or ccw:cssid.ssid.devno. Virtio\-ccw devices must have their cssid set to 0xfe. \fImultifunction\fP indicates specified pci address is a multifunction pci device address. .sp There is also support for using a network disk. As specified, the user can provide a \fI\-\-source\-protocol\fP in which case the \fIsource\fP parameter will be interpreted as the source name. \fI\-\-source\-protocol\fP must be provided if the user intends to provide a network disk or host information. Host information can be provided using the tags \fI\-\-source\-host\-name\fP, \fI\-\-source\-host\-transport\fP, and \fI\-\-source\-host\-socket\fP, which respectively denote the name of the host, the host\(aqs transport method, and the socket that the host uses. \fI\-\-source\-host\-socket\fP and \fI\-\-source\-host\-name\fP cannot both be provided, and the user must provide a \fI\-\-source\-host\-transport\fP if they want to provide a \fI\-\-source\-host\-socket\fP\&. The \fI\-\-source\-host\-name\fP parameter supports host:port syntax if the user wants to provide a port as well. .sp If \fI\-\-print\-xml\fP is specified, then the XML of the disk that would be attached is printed instead. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. When no flag is specified legacy API is used whose behavior depends on the hypervisor driver. .sp For compatibility purposes, \fI\-\-persistent\fP behaves like \fI\-\-config\fP for an offline domain, and like \fI\-\-live\fP \fI\-\-config\fP for a running domain. Likewise, \fI\-\-shareable\fP is an alias for \fI\-\-mode shareable\fP\&. .SS attach\-interface .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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] [\-\-alias alias] [\-\-managed] [\-\-print\-xml] [\-\-source\-mode mode] .EE .UNINDENT .UNINDENT .sp Attach a new network interface to the domain. .sp \fBtype\fP can be one of the: .sp \fInetwork\fP to indicate connection via a libvirt virtual network, .sp \fIbridge\fP to indicate connection via a bridge device on the host, .sp \fIdirect\fP to indicate connection directly to one of the host\(aqs network interfaces or bridges, .sp \fIhostdev\fP to indicate connection using a passthrough of PCI device on the host, .sp \fIvhostuser\fP to indicate connection using a virtio transport protocol. .sp \fBsource\fP indicates the source of the connection. The source depends on the type of the interface: .sp \fInetwork\fP name of the virtual network, .sp \fIbridge\fP the name of the bridge device, .sp \fIdirect\fP the name of the host\(aqs interface or bridge, .sp \fIhostdev\fP the PCI address of the host\(aqs interface formatted as domain:bus:slot.function. .sp \fIvhostuser\fP the path to UNIX socket (control plane) .sp \fB\-\-target\fP is used to specify the tap/macvtap device to be used to connect the domain to the source. Names starting with \(aqvnet\(aq are considered as auto\-generated and are blanked out/regenerated each time the interface is attached. .sp \fB\-\-mac\fP specifies the MAC address of the network interface; if a MAC address is not given, a new address will be automatically generated (and stored in the persistent configuration if \(dq\-\-config\(dq is given on the command line). .sp \fB\-\-script\fP 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\fP type and only for Xen domains. .sp \fB\-\-model\fP specifies the network device model to be presented to the domain. .sp \fBalias\fP can set user supplied alias. .sp \fB\-\-inbound\fP and \fB\-\-outbound\fP control the bandwidth of the interface. At least one from the \fIaverage\fP, \fIfloor\fP pair must be specified. The other two \fIpeak\fP and \fIburst\fP are optional, so \(dqaverage,peak\(dq, \(dqaverage,,burst\(dq, \(dqaverage,,,floor\(dq, \(dqaverage\(dq and \(dq,,,floor\(dq are also legal. Values for \fIaverage\fP, \fIfloor\fP and \fIpeak\fP are expressed in kilobytes per second, while \fIburst\fP is expressed in kilobytes in a single burst at \fIpeak\fP speed as described in the Network XML documentation at \&. .sp \fB\-\-managed\fP is usable only for \fIhostdev\fP type and tells libvirt that the interface should be managed, which means detached and reattached from/to the host by libvirt. .sp \fB\-\-source\-mode\fP is mandatory for \fIvhostuser\fP interface and accepts values \fIserver\fP and \fIclient\fP that control whether hypervisor waits for the other process to connect, or initiates connection, respectively. .sp If \fB\-\-print\-xml\fP is specified, then the XML of the interface that would be attached is printed instead. .sp If \fB\-\-live\fP is specified, affect a running domain. If \fB\-\-config\fP is specified, affect the next startup of a persistent guest. If \fB\-\-current\fP is specified, affect the current domain state, which can either be live or offline. Both \fB\-\-live\fP and \fB\-\-config\fP flags may be given, but \fB\-\-current\fP is exclusive. When no flag is specified legacy API is used whose behavior depends on the hypervisor driver. .sp For compatibility purposes, \fB\-\-persistent\fP behaves like \fB\-\-config\fP for an offline domain, and like \fB\-\-live\fP \fB\-\-config\fP for a running domain. .sp \fBNote\fP: 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 \(dqvnetN\(dq or \(dqvifN\(dq will be created automatically. .SS detach\-device .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX detach\-device domain FILE [[[\-\-live] [\-\-config] | [\-\-current]] | [\-\-persistent]] .EE .UNINDENT .UNINDENT .sp Detach a device from the domain, takes the same kind of XML descriptions as command \fBattach\-device\fP\&. For passthrough host devices, see also \fBnodedev\-reattach\fP, needed if the device does not use managed mode. .sp \fBNote\fP: The supplied XML description of the device should be as specific as its definition in the domain XML. 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 XML, but shares some specific attributes with one that is present, may lead to unexpected results. .sp \fBQuirk\fP: Device unplug is asynchronous in most cases and requires guest cooperation. This means that it\(aqs up to the discretion of the guest to disallow or delay the unplug arbitrarily. As the libvirt API used in this command was designed as synchronous it returns success after some timeout even if the device was not unplugged yet to allow further interactions with the domain e.g. if the guest is unresponsive. Callers which need to make sure that the device was unplugged can use libvirt events (see virsh event) to be notified when the device is removed. Note that the event may arrive before the command returns. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. When no flag is specified legacy API is used whose behavior depends on the hypervisor driver. .sp For compatibility purposes, \fI\-\-persistent\fP behaves like \fI\-\-config\fP for an offline domain, and like \fI\-\-live\fP \fI\-\-config\fP for a running domain. .sp Note that older versions of virsh used \fI\-\-config\fP as an alias for \fI\-\-persistent\fP\&. .SS detach\-device\-alias .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX detach\-device\-alias domain alias [[[\-\-live] [\-\-config] | [\-\-current]]]] .EE .UNINDENT .UNINDENT .sp Detach a device with given \fIalias\fP from the \fIdomain\fP\&. This command returns successfully after the unplug request was sent to the hypervisor. The actual removal of the device is notified asynchronously via libvirt events (see virsh event). .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. .SS detach\-disk .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX detach\-disk domain target [[[\-\-live] [\-\-config] | [\-\-current]] | [\-\-persistent]] [\-\-print\-xml] .EE .UNINDENT .UNINDENT .sp Detach a disk device from a domain. The \fItarget\fP is the device as seen from the domain. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. When no flag is specified legacy API is used whose behavior depends on the hypervisor driver. .sp For compatibility purposes, \fI\-\-persistent\fP behaves like \fI\-\-config\fP for an offline domain, and like \fI\-\-live\fP \fI\-\-config\fP for a running domain. .sp Note that older versions of virsh used \fI\-\-config\fP as an alias for \fI\-\-persistent\fP\&. .sp If \fB\-\-print\-xml\fP is specified, then the XML which would be used to detach the disk is printed instead. .sp Please see documentation for \fBdetach\-device\fP for known quirks. .SS detach\-interface .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX detach\-interface domain type [\-\-mac mac] [[[\-\-live] [\-\-config] | [\-\-current]] | [\-\-persistent]] [\-\-print\-xml] .EE .UNINDENT .UNINDENT .sp Detach a network interface from a domain. \fItype\fP can be either \fInetwork\fP to indicate a physical network device or \fIbridge\fP to indicate a bridge to a device. It is recommended to use the \fImac\fP option to distinguish between the interfaces if more than one are present on the domain. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. When no flag is specified legacy API is used whose behavior depends on the hypervisor driver. .sp For compatibility purposes, \fI\-\-persistent\fP behaves like \fI\-\-config\fP for an offline domain, and like \fI\-\-live\fP \fI\-\-config\fP for a running domain. .sp Note that older versions of virsh used \fI\-\-config\fP as an alias for \fI\-\-persistent\fP\&. .sp If \fI\-\-print\-xml\fP is specified, then the XML used to detach the interface is printed instead. .sp Please see documentation for \fBdetach\-device\fP for known quirks. .SS update\-device .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX update\-device domain file [\-\-force] [[[\-\-live] [\-\-config] | [\-\-current]] | [\-\-persistent]] .EE .UNINDENT .UNINDENT .sp Update the characteristics of a device associated with \fIdomain\fP, based on the device definition in an XML \fIfile\fP\&. The \fI\-\-force\fP 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 https://libvirt.org/formatdomain.html#elementsDevices to learn about libvirt XML format for a device. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. Not specifying any flag is the same as specifying \fI\-\-current\fP\&. .sp For compatibility purposes, \fI\-\-persistent\fP behaves like \fI\-\-config\fP for an offline domain, and like \fI\-\-live\fP \fI\-\-config\fP for a running domain. .sp Note that older versions of virsh used \fI\-\-config\fP as an alias for \fI\-\-persistent\fP\&. .sp \fBNote\fP: using of partial device definition XML files may lead to unexpected results as some fields may be autogenerated and thus match devices other than expected. .SS update\-memory\-device .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX update\-memory\-device domain [\-\-print\-xml] [[\-\-alias alias] | [\-\-node node]] [[\-\-live] [\-\-config] | [\-\-current]] [\-\-requested\-size size] .EE .UNINDENT .UNINDENT .sp This command finds \fB\fP device inside given \fIdomain\fP, changes requested values and passes updated device XML to daemon. If \fI\-\-print\-xml\fP is specified then the device is not changed, but the updated device XML is printed to stdout. If there are more than one \fB\fP devices in \fIdomain\fP use \fI\-\-alias\fP or \fI\-\-node\fP to select the desired one. .sp If \fI\-\-live\fP is specified, affect a running domain. If \fI\-\-config\fP is specified, affect the next startup of a persistent guest. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. Not specifying any flag is the same as specifying \fI\-\-current\fP\&. .sp If \fI\-\-requested\-size\fP is specified then \fB\fP under memory target is changed to requested \fIsize\fP (as scaled integer, see \fBNOTES\fP above). It defaults to kibibytes if no suffix is provided. The option is valid only for \fBvirtio\-mem\fP memory device model. .SS change\-media .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX change\-media domain path [\-\-eject] [\-\-insert] [\-\-update] [source] [\-\-force] [[\-\-live] [\-\-config] | [\-\-current]] [\-\-print\-xml] [\-\-block] .EE .UNINDENT .UNINDENT .sp Change media of CDROM or floppy drive. \fIpath\fP can be the fully\-qualified path or the unique target name () of the disk device. \fIsource\fP specifies the path of the media to be inserted or updated. The \fI\-\-block\fP flag allows setting the backing type in case a block device is used as media for the CDROM or floppy drive instead of a file. .sp \fI\-\-eject\fP indicates the media will be ejected. \fI\-\-insert\fP indicates the media will be inserted. \fIsource\fP must be specified. If the device has source (e.g. ), and \fIsource\fP is not specified, \fI\-\-update\fP is equal to \fI\-\-eject\fP\&. If the device has no source, and \fIsource\fP is specified, \fI\-\-update\fP is equal to \fI\-\-insert\fP\&. If the device has source, and \fIsource\fP is specified, \fI\-\-update\fP behaves like combination of \fI\-\-eject\fP and \fI\-\-insert\fP\&. If none of \fI\-\-eject\fP, \fI\-\-insert\fP, and \fI\-\-update\fP is specified, \fI\-\-update\fP is used by default. The \fI\-\-force\fP option can be used to force media changing. If \fI\-\-live\fP is specified, alter live configuration of running guest. If \fI\-\-config\fP is specified, alter persistent configuration, effect observed on next startup of the guest. \fI\-\-current\fP can be either or both of \fIlive\fP and \fIconfig\fP, depends on the hypervisor\(aqs implementation. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. If \fI\-\-print\-xml\fP is specified, the XML that would be used to change media is printed instead of changing the media. .SS dom\-fd\-associate .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX dom\-fd\-associate domain \-\-name FDGROUPNAME \-\-pass\-fds M,N,.... [\-\-seclabel\-writable] [\-\-seclabel\-restore] .EE .UNINDENT .UNINDENT .sp Associate one or more fds described via \fI\-\-pass\-fds\fP argument to \fIdomain\fP as \fI\-\-name\fP\&. The lifetime of the passed fd group is the same as the connection, thus exiting virsh un\-registers them afterwards. .sp By default security labels are applied if needed but they are not restored after use to avoid keeping them open unnecessarily. Best\-effort security label restore may be requested by using the \fI\-\-seclabel\-restore\fP flag. .SH NODEDEV COMMANDS .sp The following commands manipulate host devices that are intended to be passed through to guest domains via elements in a domain\(aqs 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\fP 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 PCI device that controls the host\(aqs hard disk controller where the guest\(aqs disk images live could cause the host system to lock up or reboot). .sp For more information on node device definition see: \&. .sp 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 PCI device includes the attribute \fBmanaged=\(aqyes\(aq\fP, 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\fP (guest start, device hot\-plug) and \fBnodedev\-reattach\fP (guest stop, device hot\-unplug) were called at the right points. If a PCI 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. .SS nodedev\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-create FILE [\-\-validate] .EE .UNINDENT .UNINDENT .sp 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\fP contains xml for a top\-level description of a node device. .sp If \fI\-\-validate\fP is specified, validates the format of the XML document against an internal RNG schema. .SS nodedev\-update .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-update device FILE [[\-\-live] [\-\-config] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp Update a device on the host. \fIdevice\fP can be either device name or wwn pair in \(dqwwnn,wwpn\(dq format (only works for vHBA currently). \fIfile\fP contains xml for a top\-level description of the node device. \fI\-\-current\fP can be either or both of \fIlive\fP and \fIconfig\fP, depends on the hypervisor\(aqs implementation. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. If no flag is specified, behavior is different depending on hypervisor. .SS nodedev\-destroy .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-destroy device .EE .UNINDENT .UNINDENT .sp Destroy (stop) a device on the host. \fIdevice\fP can be either device name or wwn pair in \(dqwwnn,wwpn\(dq 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. .SS nodedev\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-define FILE [\-\-validate] .EE .UNINDENT .UNINDENT .sp Define an inactive persistent device or modify an existing persistent one from the XML \fIFILE\fP\&. .sp If \fI\-\-validate\fP is specified, validates the format of the XML document against an internal RNG schema. .SS nodedev\-undefine .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-undefine device .EE .UNINDENT .UNINDENT .sp Undefine the configuration for a persistent device. If the device is active, make it transient. .SS nodedev\-start .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-start device .EE .UNINDENT .UNINDENT .sp Start a (previously defined) inactive device. .SS nodedev\-detach .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-detach nodedev [\-\-driver backend_driver] .EE .UNINDENT .UNINDENT .sp Detach \fInodedev\fP from the host driver and bind it to a special driver that provides the API needed by the hypervisor for assigning the device to a virtual machine (using in the domain XML definition). This is reversed with \fBnodedev\-reattach\fP, and is done automatically by the hypervisor driver for managed devices (those devices with \(dqmanaged=\(aqyes\(aq\(dq in their XML definition). .sp Different hypervisors expect the device being assigned to be bound to different drivers. For example, QEMU\(aqs \(dqvfio\(dq backend requires the device to be bound to the driver \(dqvfio\-pci\(dq or to a \(dqVFIO variant\(dq driver (this is a driver that supports the full API provided by vfio\-pci, plus some other APIs to support things like live migration). The \fI\-\-driver\fP parameter can be used to specify a particular driver (e.g. a device\-specific VFIO variant driver) the device should be bound to. When \fI\-\-driver\fP is omitted, the default driver for the hypervisor is used (\(dqvfio\-pci\(dq for QEMU, \(dqpciback\(dq for Xen). .SS nodedev\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-dumpxml [\-\-inactive] [\-\-xpath EXPRESSION] [\-\-wrap] device .EE .UNINDENT .UNINDENT .sp Dump a XML 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\fP can be either device name or wwn pair in \(dqwwnn,wwpn\(dq format (only works for HBA). An additional option affecting the XML dump may be used. \fI\-\-inactive\fP tells virsh to dump the node device configuration that will be used on next start of the node device as opposed to the current node device configuration. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS nodedev\-info .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-info device .EE .UNINDENT .UNINDENT .sp Returns basic information about the \fIdevice\fP object. .SS nodedev\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-list [\-\-cap capability] [\-\-tree] [\-\-inactive | \-\-all] [\-\-persistent | \-\-transient] .EE .UNINDENT .UNINDENT .sp List all of the devices available on the node that are known by libvirt. \fIcap\fP 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 \(aqsystem\(aq, \(aqpci\(aq, \(aqusb_device\(aq, \(aqusb\(aq, \(aqnet\(aq, \(aqscsi_host\(aq, \(aqscsi_target\(aq, \(aqscsi\(aq, \(aqstorage\(aq, \(aqfc_host\(aq, \(aqvports\(aq, \(aqscsi_generic\(aq, \(aqdrm\(aq, \(aqmdev\(aq, \(aqmdev_types\(aq, \(aqccw\(aq, \(aqcss\(aq, \(aqap_card\(aq, \(aqap_queue\(aq, \(aqap_matrix\(aq. By default, only active devices are listed. \fI\-\-inactive\fP is used to list only inactive devices, and \fI\-\-all\fP is used to list both active and inactive devices. \fI\-\-persistent\fP is used to list only persistent devices, and \fI\-\-transient\fP is used to list only transient devices. Not providing \fI\-\-persistent\fP or \fI\-\-transient\fP will list all devices unless filtered otherwise. \fI\-\-transient\fP is mutually exclusive with \fI\-\-persistent\fP and \fI\-\-inactive\fP\&. If \fI\-\-tree\fP is used, the output is formatted in a tree representing parents of each node. \fI\-\-tree\fP is mutually exclusive with all other options but \fI\-\-all\fP\&. .SS nodedev\-reattach .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-reattach nodedev .EE .UNINDENT .UNINDENT .sp Declare that \fInodedev\fP is no longer in use by any guests, and that the host can resume normal use of the device. This is done automatically for PCI devices in managed mode and USB devices, but must be done explicitly to match any explicit \fBnodedev\-detach\fP\&. .SS nodedev\-reset .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-reset nodedev .EE .UNINDENT .UNINDENT .sp Trigger a device reset for \fInodedev\fP, 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. .SS nodedev\-event .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-event {[nodedev] event [\-\-loop] [\-\-timeout seconds] [\-\-timestamp] | \-\-list} .EE .UNINDENT .UNINDENT .sp 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\fP\&. Using \fI\-\-list\fP as the only argument will provide a list of possible \fIevent\fP 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 SIGINT (usually via \fBCtrl\-C\fP) to quit immediately. If \fI\-\-timeout\fP is specified, the command gives up waiting for events after \fIseconds\fP have elapsed. With \fI\-\-loop\fP, the command prints all events until a timeout or interrupt key. .sp When \fI\-\-timestamp\fP is used, a human\-readable timestamp will be printed before the event. .SS nodedev\-autostart .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nodedev\-autostart [\-\-disable] device .EE .UNINDENT .UNINDENT .sp Configure a device to be automatically started when the host machine boots or the parent device becomes available. With \fI\-\-disable\fP, the device will be set to manual mode and will no longer be automatically started by the host. This command is only supported for persistently\-defined mediated devices. .SH VIRTUAL NETWORK COMMANDS .sp 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 UUID. .SS net\-autostart .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-autostart network [\-\-disable] .EE .UNINDENT .UNINDENT .sp Configure a virtual network to be automatically started at boot. The \fI\-\-disable\fP option disable autostarting. .SS net\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-create file [\-\-validate] .EE .UNINDENT .UNINDENT .sp Create a transient (temporary) virtual network from an XML \fIfile\fP and instantiate (start) the network. See the documentation at to get a description of the XML network format used by libvirt. .sp Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS net\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-define file [\-\-validate] .EE .UNINDENT .UNINDENT .sp Define an inactive persistent virtual network or modify an existing persistent one from the XML \fIfile\fP\&. Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS net\-desc .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-desc network [[\-\-live] [\-\-config] | [\-\-current]] [\-\-title] [\-\-edit] [\-\-new\-desc New description or title message] .EE .UNINDENT .UNINDENT .sp Show or modify description and title of a network. These values are user fields that allow storing arbitrary textual data to allow easy identification of networks. Title should be short, although it\(aqs not enforced. (See also \fBnet\-metadata\fP that works with XML based network metadata.) .sp Flags \fI\-\-live\fP or \fI\-\-config\fP select whether this command works on live or persistent definitions of the network. If both \fI\-\-live\fP and \fI\-\-config\fP are specified, the \fI\-\-config\fP option takes precedence on getting the current description and both live configuration and config are updated while setting the description. \fI\-\-current\fP is exclusive and implied if none of these was specified. .sp Flag \fI\-\-edit\fP 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\fP selects operation on the title field instead of description. .sp If neither of \fI\-\-edit\fP and \fI\-\-new\-desc\fP are specified the note or description is displayed instead of being modified. .SS net\-destroy .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-destroy network .EE .UNINDENT .UNINDENT .sp Destroy (stop) a given transient or persistent virtual network specified by its name or UUID. This takes effect immediately. .SS net\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-dumpxml [\-\-inactive] [\-\-xpath EXPRESSION] [\-\-wrap] network .EE .UNINDENT .UNINDENT .sp Output the virtual network information as an XML dump to stdout. If \fI\-\-inactive\fP is specified, then physical functions are not expanded into their associated virtual functions. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS net\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-edit network .EE .UNINDENT .UNINDENT .sp Edit the XML configuration file for a network. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh net\-dumpxml \-\-inactive network > network.xml vi network.xml (or make changes with your other text editor) virsh net\-define network.xml .EE .UNINDENT .UNINDENT .sp except that it does some error checking. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SS net\-event .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-event {[network] event [\-\-loop] [\-\-timeout seconds] [\-\-timestamp] | \-\-list} .EE .UNINDENT .UNINDENT .sp 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\fP\&. Using \fI\-\-list\fP as the only argument will provide a list of possible \fIevent\fP 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 SIGINT (usually via \fBCtrl\-C\fP) to quit immediately. If \fI\-\-timeout\fP is specified, the command gives up waiting for events after \fIseconds\fP have elapsed. With \fI\-\-loop\fP, the command prints all events until a timeout or interrupt key. .sp When \fI\-\-timestamp\fP is used, a human\-readable timestamp will be printed before the event. .SS net\-info .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-info network .EE .UNINDENT .UNINDENT .sp Returns basic information about the \fInetwork\fP object. .SS net\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-list [\-\-inactive | \-\-all] { [\-\-table] | \-\-name | \-\-uuid } [\-\-persistent] [<\-\-transient>] [\-\-autostart] [<\-\-no\-autostart>] [\-\-title] .EE .UNINDENT .UNINDENT .sp Returns the list of active networks, if \fI\-\-all\fP is specified this will also include defined but inactive networks, if \fI\-\-inactive\fP is specified only the inactive ones will be listed. You may also want to filter the returned networks by \fI\-\-persistent\fP to list the persistent ones, \fI\-\-transient\fP to list the transient ones, \fI\-\-autostart\fP to list the ones with autostart enabled, and \fI\-\-no\-autostart\fP to list the ones with autostart disabled. .sp If \fI\-\-name\fP is specified, network names are printed instead of the table formatted one per line. If \fI\-\-uuid\fP is specified network\(aqs UUID\(aqs are printed instead of names. Flag \fI\-\-table\fP specifies that the legacy table\-formatted output should be used. This is the default. All of these are mutually exclusive. .sp If \fI\-\-title\fP is specified, then the short network description (title) is printed in an extra column. This flag is usable only with the default \fI\-\-table\fP output. .sp NOTE: When talking to older servers, this command is forced to use a series of API 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. .SS net\-metadata .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-metadata network [[\-\-live] [\-\-config] | [\-\-current]] [\-\-edit] [uri] [key] [set] [\-\-remove] .EE .UNINDENT .UNINDENT .sp Show or modify custom XML metadata of a network. The metadata is a user defined XML that allows storing arbitrary XML data in the network definition. Multiple separate custom metadata pieces can be stored in the network XML. The pieces are identified by a private XML namespace provided via the \fIuri\fP argument. (See also \fBnet\-desc\fP that works with textual metadata of a network, such as title and description.) .sp Flags \fI\-\-live\fP or \fI\-\-config\fP select whether this command works on live or persistent definitions of the network. If both \fI\-\-live\fP and \fI\-\-config\fP are specified, the \fI\-\-config\fP option takes precedence on getting the current description and both live configuration and config are updated while setting the description. \fI\-\-current\fP is exclusive and implied if none of these was specified. .sp Flag \fI\-\-remove\fP specifies that the metadata element specified by the \fIuri\fP argument should be removed rather than updated. .sp Flag \fI\-\-edit\fP specifies that an editor with the metadata identified by the \fIuri\fP argument should be opened and the contents saved back afterwards. Otherwise the new contents can be provided via the \fIset\fP argument. .sp When setting metadata via \fI\-\-edit\fP or \fIset\fP the \fIkey\fP 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\fP and \fIset\fP are specified the XML metadata corresponding to the \fIuri\fP namespace is displayed instead of being modified. .SS net\-name .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-name network\-UUID .EE .UNINDENT .UNINDENT .sp Convert a network UUID to network name. .SS net\-start .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-start network .EE .UNINDENT .UNINDENT .sp Start a (previously defined) inactive network. .SS net\-undefine .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-undefine network .EE .UNINDENT .UNINDENT .sp Undefine the configuration for a persistent network. If the network is active, make it transient. .SS net\-uuid .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-uuid network\-name .EE .UNINDENT .UNINDENT .sp Convert a network name to network UUID. .SS net\-update .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-update network command section xml [\-\-parent\-index index] [[\-\-live] [\-\-config] | [\-\-current]] .EE .UNINDENT .UNINDENT .sp 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\fP is one of \(dqadd\-first\(dq, \(dqadd\-last\(dq, \(dqadd\(dq (a synonym for add\-last), \(dqdelete\(dq, or \(dqmodify\(dq. .sp \fIsection\fP is one of \(dqbridge\(dq, \(dqdomain\(dq, \(dqip\(dq, \(dqip\-dhcp\-host\(dq, \(dqip\-dhcp\-range\(dq, \(dqforward\(dq, \(dqforward\-interface\(dq, \(dqforward\-pf\(dq, \(dqportgroup\(dq, \(dqdns\-host\(dq, \(dqdns\-txt\(dq, or \(dqdns\-srv\(dq, each section being named by a concatenation of the xml element hierarchy leading to the element being changed. For example, \(dqip\-dhcp\-host\(dq will change a element that is contained inside a element inside an element of the network. .sp \fIxml\fP is either the text of a complete xml element of the type being changed (e.g. \(dq\(dq, 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 \(dq<\(dq, it is xml text, if the first character is not \(dq<\(dq, it is the name of a file that contains the xml text to be used. .sp The \fI\-\-parent\-index\fP 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\(aqt provided, the \(dqmost appropriate\(dq element will be selected (usually the only one that already has a element), but if \fI\-\-parent\-index\fP is given, that particular instance of will get the modification. .sp If \fI\-\-live\fP is specified, affect a running network. If \fI\-\-config\fP is specified, affect the next startup of a persistent network. If \fI\-\-current\fP is specified, it is equivalent to either \fI\-\-live\fP or \fI\-\-config\fP, depending on the current state of the guest. Both \fI\-\-live\fP and \fI\-\-config\fP flags may be given, but \fI\-\-current\fP is exclusive. Not specifying any flag is the same as specifying \fI\-\-current\fP\&. .SS net\-dhcp\-leases .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-dhcp\-leases network [mac] .EE .UNINDENT .UNINDENT .sp Get a list of dhcp leases for all network interfaces connected to the given virtual \fInetwork\fP or limited output just for one interface if \fImac\fP is specified. .SH NETWORK PORT COMMANDS .sp The following commands manipulate network ports. Libvirt virtual networks have ports created when a virtual machine has a virtual network interface added. In general there should be no need to use any of the commands here, since the hypervisor drivers run these commands are the right point in a virtual machine\(aqs lifecycle. They can be useful for debugging problems and / or recovering from bugs / stale state. .SS net\-port\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-port\-list { [\-\-table] | \-\-uuid } network .EE .UNINDENT .UNINDENT .sp List all network ports recorded against the network. .sp If \fI\-\-uuid\fP is specified network ports\(aq UUID\(aqs are printed instead of a table. Flag \fI\-\-table\fP specifies that the legacy table\-formatted output should be used. This is the default. All of these are mutually exclusive. .SS net\-port\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-port\-create network file [\-\-validate] .EE .UNINDENT .UNINDENT .sp Allocate a new network port reserving resources based on the port description. Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS net\-port\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-port\-dumpxml [\-\-xpath EXPRESSION] [\-\-wrap] network port .EE .UNINDENT .UNINDENT .sp Output the network port information as an XML dump to stdout. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS net\-port\-delete .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX net\-port\-delete network port .EE .UNINDENT .UNINDENT .sp Delete record of the network port and release its resources .SH INTERFACE COMMANDS .sp 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 XML at all. .sp 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 MAC address. However, using a MAC address for an \fIiface\fP argument only works when that address is unique (if an interface and a bridge share the same MAC address, which is often the case, then using that MAC address results in an error due to ambiguity, and you must resort to a name instead). .SS iface\-bridge .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-bridge interface bridge [\-\-no\-stp] [delay] [\-\-no\-start] .EE .UNINDENT .UNINDENT .sp Create a bridge device named \fIbridge\fP, and attach the existing network device \fIinterface\fP to the new bridge. The new bridge defaults to starting immediately, with STP enabled and a delay of 0; these settings can be altered with \fI\-\-no\-stp\fP, \fI\-\-no\-start\fP, and an integer number of seconds for \fIdelay\fP\&. All IP address configuration of \fIinterface\fP will be moved to the new bridge device. .sp See also \fBiface\-unbridge\fP for undoing this operation. .SS iface\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-define file [\-\-validate] .EE .UNINDENT .UNINDENT .sp Define an inactive persistent physical host interface or modify an existing persistent one from the XML \fIfile\fP\&. Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS iface\-destroy .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-destroy interface .EE .UNINDENT .UNINDENT .sp Destroy (stop) a given host interface, such as by running \(dqif\-down\(dq to disable that interface from active use. This takes effect immediately. .SS iface\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-dumpxml [\-\-inactive] [\-\-xpath EXPRESSION] [\-\-wrap] interface .EE .UNINDENT .UNINDENT .sp Output the host interface information as an XML dump to stdout. If \fI\-\-inactive\fP is specified, then the output reflects the persistent state of the interface that will be used the next time it is started. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS iface\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-edit interface .EE .UNINDENT .UNINDENT .sp Edit the XML configuration file for a host interface. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh iface\-dumpxml iface > iface.xml vi iface.xml (or make changes with your other text editor) virsh iface\-define iface.xml .EE .UNINDENT .UNINDENT .sp except that it does some error checking. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SS iface\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-list [\-\-inactive | \-\-all] .EE .UNINDENT .UNINDENT .sp Returns the list of active host interfaces. If \fI\-\-all\fP is specified this will also include defined but inactive interfaces. If \fI\-\-inactive\fP is specified only the inactive ones will be listed. .SS iface\-name .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-name interface .EE .UNINDENT .UNINDENT .sp Convert a host interface MAC to interface name, if the MAC address is unique among the host\(aqs interfaces. .sp \fIinterface\fP specifies the interface MAC address. .SS iface\-mac .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-mac interface .EE .UNINDENT .UNINDENT .sp Convert a host interface name to MAC address. .sp \fIinterface\fP specifies the interface name. .SS iface\-start .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-start interface .EE .UNINDENT .UNINDENT .sp Start a (previously defined) host interface, such as by running \(dqif\-up\(dq. .SS iface\-unbridge .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-unbridge bridge [\-\-no\-start] .EE .UNINDENT .UNINDENT .sp Tear down a bridge device named \fIbridge\fP, releasing its underlying interface back to normal usage, and moving all IP address configuration from the bridge device to the underlying device. The underlying interface is restarted unless \fI\-\-no\-start\fP is present; this flag is present for symmetry, but generally not recommended. .sp See also \fBiface\-bridge\fP for creating a bridge. .SS iface\-undefine .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-undefine interface .EE .UNINDENT .UNINDENT .sp Undefine the configuration for an inactive host interface. .SS iface\-begin .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-begin .EE .UNINDENT .UNINDENT .sp Create a snapshot of current host interface settings, which can later be committed (\fIiface\-commit\fP) or restored (\fIiface\-rollback\fP). 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 API between the beginning of a snapshot and its eventual commit or rollback. .SS iface\-commit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-commit .EE .UNINDENT .UNINDENT .sp Declare all changes since the last \fIiface\-begin\fP as working, and delete the rollback point. If no interface snapshot has already been started, then this command will fail. .SS iface\-rollback .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX iface\-rollback .EE .UNINDENT .UNINDENT .sp Revert all host interface settings back to the state recorded in the last \fIiface\-begin\fP\&. 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 .sp 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. .SS find\-storage\-pool\-sources .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX find\-storage\-pool\-sources type [srcSpec] .EE .UNINDENT .UNINDENT .sp Returns XML describing all possible available storage pool sources that could be used to create or define a storage pool of a given \fItype\fP\&. If \fIsrcSpec\fP is provided, it is a file that contains XML 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 XML 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\fP options and the expected minimal XML elements used to perform the search. .sp For a \(dqnetfs\(dq or \(dqgluster\(dq pool, the minimal expected XML required is the element with a \(dqname\(dq attribute describing the IP address or hostname to be used to find the pool. The \(dqport\(dq attribute will be ignored as will any other provided XML elements in \fIsrcSpec\fP\&. .sp For a \(dqlogical\(dq pool, the contents of the \fIsrcSpec\fP file are ignored, although if provided the file must at least exist. .sp For an \(dqiscsi\(dq or \(dqiscsi\-direct\(dq pool, the minimal expect XML required is the element with a \(dqname\(dq attribute describing the IP address or hostname to be used to find the pool (the iSCSI server address). Optionally, the \(dqport\(dq attribute may be provided, although it will default to 3260. Optionally, an XML element with a \(dqname\(dq attribute may be provided to further restrict the iSCSI target search to a specific initiator for multi\-iqn iSCSI storage pools. .SS find\-pool\-sources\-as .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX find\-storage\-pool\-sources\-as type [host] [port] [initiator] .EE .UNINDENT .UNINDENT .sp Rather than providing \fIsrcSpec\fP XML file for \fBfind\-storage\-pool\-sources\fP use this command option in order to have virsh generate the query XML file using the optional arguments. The command will return the same output XML as \fBfind\-storage\-pool\-sources\fP\&. .sp Use \fIhost\fP to describe a specific host to use for networked storage, such as netfs, gluster, and iscsi \fItype\fP pools. .sp Use \fIport\fP to further restrict which networked port to utilize for the connection if required by the specific storage backend, such as iscsi. .sp Use \fIinitiator\fP to further restrict the iscsi \fItype\fP pool searches to specific target initiators. .SS pool\-autostart .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-autostart pool\-or\-uuid [\-\-disable] .EE .UNINDENT .UNINDENT .sp Configure whether \fIpool\fP should automatically start at boot. .SS pool\-build .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-build pool\-or\-uuid [\-\-overwrite] [\-\-no\-overwrite] .EE .UNINDENT .UNINDENT .sp Build a given pool. .sp Options \fI\-\-overwrite\fP and \fI\-\-no\-overwrite\fP can only be used for \fBpool\-build\fP a filesystem, disk, or logical pool. .sp For a file system pool if neither flag is specified, then \fBpool\-build\fP just makes the target path directory and no attempt to run mkfs on the target volume device. If \fI\-\-no\-overwrite\fP 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\fP 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\fP is specified, \fBpool\-build\fP 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\fP 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 \(dqdos\(dq if not specified. .sp For a logical pool, if neither of them is specified or \fI\-\-no\-overwrite\fP is specified, \fBpool\-build\fP 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\fP 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. .SS pool\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-create file [\-\-build] [[\-\-overwrite] | [\-\-no\-overwrite]] .EE .UNINDENT .UNINDENT .sp Create and start a pool object from the XML \fIfile\fP\&. .sp [\fI\-\-build\fP] [[\fI\-\-overwrite\fP] | [\fI\-\-no\-overwrite\fP]] perform a \fBpool\-build\fP after creation in order to remove the need for a follow\-up command to build the pool. The \fI\-\-overwrite\fP and \fI\-\-no\-overwrite\fP flags follow the same rules as \fBpool\-build\fP\&. If just \fI\-\-build\fP is provided, then \fBpool\-build\fP is called with no flags. .SS pool\-create\-as .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-create\-as name type [\-\-source\-host hostname] [\-\-source\-path path] [\-\-source\-dev path] [\-\-source\-name name] [\-\-target path] [\-\-source\-format format] [\-\-source\-initiator initiator\-iqn] [\-\-auth\-type authtype \-\-auth\-username username [\-\-secret\-usage usage | \-\-secret\-uuid uuid]] [\-\-source\-protocol\-ver ver] [[\-\-adapter\-name name] | [\-\-adapter\-wwnn wwnn \-\-adapter\-wwpn wwpn] [\-\-adapter\-parent parent | \-\-adapter\-parent\-wwnn parent_wwnn adapter\-parent\-wwpn parent_wwpn | \-\-adapter\-parent\-fabric\-wwn parent_fabric_wwn]] [\-\-build] [[\-\-overwrite] | [\-\-no\-overwrite]] [\-\-print\-xml] .EE .UNINDENT .UNINDENT .sp Create and start a pool object \fIname\fP from the raw parameters. If \fI\-\-print\-xml\fP is specified, then print the XML of the pool object without creating the pool. Otherwise, the pool has the specified \fItype\fP\&. When using \fBpool\-create\-as\fP for a pool of \fItype\fP \(dqdisk\(dq, the existing partitions found on the \fI\-\-source\-dev path\fP will be used to populate the disk pool. Therefore, it is suggested to use \fBpool\-define\-as\fP and \fBpool\-build\fP with the \fI\-\-overwrite\fP in order to properly initialize the disk pool. .sp [\fI\-\-source\-host hostname\fP] 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\fP] provides the source directory path for pools backed by directories (pool type dir). .sp [\fI\-\-source\-dev path\fP] provides the source path for pools backed by physical devices (pool types fs, logical, disk, iscsi, zfs). .sp [\fI\-\-source\-name name\fP] provides the source name for pools backed by storage from a named element (pool types logical, rbd, sheepdog, gluster). .sp [\fI\-\-target path\fP] is the path for the mapping of the storage pool into the host file system. .sp [\fI\-\-source\-format format\fP] provides information about the format of the pool (pool types fs, netfs, disk, logical). .sp [\fI\-\-source\-initiator initiator\-iqn\fP] provides the initiator iqn for iscsi connection of the pool (pool type iscsi\-direct). .sp [\fI\-\-auth\-type authtype\fP \fI\-\-auth\-username username\fP [\fI\-\-secret\-usage usage\fP | \fI\-\-secret\-uuid uuid\fP]] provides the elements required to generate authentication credentials for the storage pool. The \fIauthtype\fP is either chap for iscsi \fItype\fP pools or ceph for rbd \fItype\fP pools. Either the secret \fIusage\fP or \fIuuid\fP value may be provided, but not both. .sp [\fI\-\-source\-protocol\-ver ver\fP] provides the NFS protocol version number used to contact the server\(aqs NFS service via nfs mount option \(aqnfsvers=n\(aq. It is expect the \fIver\fP value is an unsigned integer. .sp [\fI\-\-adapter\-name name\fP] defines the scsi_hostN adapter name to be used for the scsi_host adapter type pool. .sp [\fI\-\-adapter\-wwnn wwnn\fP \fI\-\-adapter\-wwpn wwpn\fP [\fI\-\-adapter\-parent parent\fP | \fI\-\-adapter\-parent\-wwnn parent_wwnn\fP \fIadapter\-parent\-wwpn parent_wwpn\fP | \fI\-\-adapter\-parent\-fabric\-wwn parent_fabric_wwn\fP]] defines the wwnn and wwpn to be used for the fc_host adapter type pool. Optionally provide the parent scsi_hostN node device to be used for the vHBA either by parent name, parent_wwnn and parent_wwpn, or parent_fabric_wwn. The parent name could change between reboots if the hardware environment changes, so providing the parent_wwnn and parent_wwpn ensure usage of the same physical HBA even if the scsi_hostN node device changes. Usage of the parent_fabric_wwn allows a bit more flexibility to choose an HBA on the same storage fabric in order to define the pool. .sp [\fI\-\-build\fP] [[\fI\-\-overwrite\fP] | [\fI\-\-no\-overwrite\fP]] perform a \fBpool\-build\fP after creation in order to remove the need for a follow\-up command to build the pool. The \fI\-\-overwrite\fP and \fI\-\-no\-overwrite\fP flags follow the same rules as \fBpool\-build\fP\&. If just \fI\-\-build\fP is provided, then \fBpool\-build\fP is called with no flags. .sp For a \(dqlogical\(dq pool only [\fI\-\-name\fP] needs to be provided. The [\fI\-\-source\-name\fP] if provided must match the Volume Group name. If not provided, one will be generated using the [\fI\-\-name\fP]. If provided the [\fI\-\-target\fP] is ignored and a target source is generated using the [\fI\-\-source\-name\fP] (or as generated from the [\fI\-\-name\fP]). .SS pool\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-define file [\-\-validate] .EE .UNINDENT .UNINDENT .sp Define an inactive persistent storage pool or modify an existing persistent one from the XML \fIfile\fP\&. Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS pool\-define\-as .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-define\-as name type [\-\-source\-host hostname] [\-\-source\-path path] [\-\-source\-dev path] [*\-\-source\-name name*] [*\-\-target path*] [*\-\-source\-format format*] [\-\-source\-initiator initiator\-iqn] [*\-\-auth\-type authtype* *\-\-auth\-username username* [*\-\-secret\-usage usage* | *\-\-secret\-uuid uuid*]] [*\-\-source\-protocol\-ver ver*] [[*\-\-adapter\-name name*] | [*\-\-adapter\-wwnn* *\-\-adapter\-wwpn*] [*\-\-adapter\-parent parent*]] [*\-\-print\-xml*] .EE .UNINDENT .UNINDENT .sp Create, but do not start, a pool object \fIname\fP from the raw parameters. If \fI\-\-print\-xml\fP is specified, then print the XML of the pool object without defining the pool. Otherwise, the pool has the specified \fItype\fP\&. .sp Use the same arguments as \fBpool\-create\-as\fP, except for the \fI\-\-build\fP, \fI\-\-overwrite\fP, and \fI\-\-no\-overwrite\fP options. .SS pool\-destroy .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-destroy pool\-or\-uuid .EE .UNINDENT .UNINDENT .sp Destroy (stop) a given \fIpool\fP 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\fP\&. .SS pool\-delete .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-delete pool\-or\-uuid .EE .UNINDENT .UNINDENT .sp Destroy the resources used by a given \fIpool\fP object. This operation is non\-recoverable. The \fIpool\fP object will still exist after this command, ready for the creation of new storage volumes. .SS pool\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-dumpxml [\-\-inactive] [\-\-xpath EXPRESSION] [\-\-wrap] pool\-or\-uuid .EE .UNINDENT .UNINDENT .sp Returns the XML information about the \fIpool\fP object. \fI\-\-inactive\fP tells virsh to dump pool configuration that will be used on next start of the pool as opposed to the current pool configuration. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS pool\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-edit pool\-or\-uuid .EE .UNINDENT .UNINDENT .sp Edit the XML configuration file for a storage pool. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh pool\-dumpxml pool > pool.xml vi pool.xml (or make changes with your other text editor) virsh pool\-define pool.xml .EE .UNINDENT .UNINDENT .sp except that it does some error checking. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SS pool\-info .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-info [\-\-bytes] pool\-or\-uuid .EE .UNINDENT .UNINDENT .sp Returns basic information about the \fIpool\fP object. If \fI\-\-bytes\fP is specified the sizes of basic info are not converted to human friendly units. .SS pool\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-list [\-\-inactive] [\-\-all] [\-\-persistent] [\-\-transient] [\-\-autostart] [\-\-no\-autostart] [[\-\-details] [\-\-uuid] [\-\-name] [] .EE .UNINDENT .UNINDENT .sp List pool objects known to libvirt. By default, only active pools are listed; \fI\-\-inactive\fP lists just the inactive pools, and \fI\-\-all\fP lists all pools. .sp In addition, there are several sets of filtering flags. \fI\-\-persistent\fP is to list the persistent pools, \fI\-\-transient\fP is to list the transient pools. \fI\-\-autostart\fP lists the autostarting pools, \fI\-\-no\-autostart\fP lists the pools with autostarting disabled. If \fI\-\-uuid\fP is specified only pool\(aqs UUIDs are printed. If \fI\-\-name\fP is specified only pool\(aqs names are printed. If both \fI\-\-name\fP and \fI\-\-uuid\fP are specified, pool\(aqs UUID and names are printed side by side without any header. Option \fI\-\-details\fP is mutually exclusive with options \fI\-\-uuid\fP and \fI\-\-name\fP\&. .sp You may also want to list pools with specified types using \fItype\fP, the pool types must be separated by comma, e.g. \-\-type dir,disk. The valid pool types include \(aqdir\(aq, \(aqfs\(aq, \(aqnetfs\(aq, \(aqlogical\(aq, \(aqdisk\(aq, \(aqiscsi\(aq, \(aqscsi\(aq, \(aqmpath\(aq, \(aqrbd\(aq, \(aqsheepdog\(aq, \(aqgluster\(aq, \(aqzfs\(aq, \(aqvstorage\(aq and \(aqiscsi\-direct\(aq. .sp The \fI\-\-details\fP option instructs virsh to additionally display pool persistence and capacity related information where available. .sp NOTE: When talking to older servers, this command is forced to use a series of API 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. .SS pool\-name .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-name uuid .EE .UNINDENT .UNINDENT .sp Convert the \fIuuid\fP to a pool name. .SS pool\-refresh .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-refresh pool\-or\-uuid .EE .UNINDENT .UNINDENT .sp Refresh the list of volumes contained in \fIpool\fP\&. .SS pool\-start .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-start pool\-or\-uuid [\-\-build] [[\-\-overwrite] | [\-\-no\-overwrite]] .EE .UNINDENT .UNINDENT .sp Start the storage \fIpool\fP, which is previously defined but inactive. .sp [\fI\-\-build\fP] [[\fI\-\-overwrite\fP] | [\fI\-\-no\-overwrite\fP]] perform a \fBpool\-build\fP prior to \fBpool\-start\fP to ensure the pool environment is in an expected state rather than needing to run the build command prior to startup. The \fI\-\-overwrite\fP and \fI\-\-no\-overwrite\fP flags follow the same rules as \fBpool\-build\fP\&. If just \fI\-\-build\fP is provided, then \fBpool\-build\fP is called with no flags. .sp \fBNote\fP: A storage pool that relies on remote resources such as an \(dqiscsi\(dq or a (v)HBA backed \(dqscsi\(dq pool may need to be refreshed multiple times in order to have all the volumes detected (see \fBpool\-refresh\fP). This is because the corresponding volume devices may not be present in the host\(aqs 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. .SS pool\-undefine .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-undefine pool\-or\-uuid .EE .UNINDENT .UNINDENT .sp Undefine the configuration for an inactive \fIpool\fP\&. .SS pool\-uuid .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-uuid pool .EE .UNINDENT .UNINDENT .sp Returns the UUID of the named \fIpool\fP\&. .SS pool\-event .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX pool\-event {[pool] event [\-\-loop] [\-\-timeout seconds] [\-\-timestamp] | \-\-list} .EE .UNINDENT .UNINDENT .sp 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\fP\&. Using \fI\-\-list\fP as the only argument will provide a list of possible \fIevent\fP 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 SIGINT (usually via \fBCtrl\-C\fP) to quit immediately. If \fI\-\-timeout\fP is specified, the command gives up waiting for events after \fIseconds\fP have elapsed. With \fI\-\-loop\fP, the command prints all events until a timeout or interrupt key. .sp When \fI\-\-timestamp\fP is used, a human\-readable timestamp will be printed before the event. .SH VOLUME COMMANDS .SS vol\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-create pool\-or\-uuid FILE [\-\-prealloc\-metadata] [\-\-validate] .EE .UNINDENT .UNINDENT .sp Create a volume from an XML . .sp \fIpool\-or\-uuid\fP is the name or UUID of the storage pool to create the volume in. .sp \fIFILE\fP is the XML with the volume definition. An easy way to create the XML is to use the \fBvol\-dumpxml\fP command to obtain the definition of a pre\-existing volume. .sp [\fI\-\-prealloc\-metadata\fP] preallocate metadata (for qcow2 images which don\(aqt 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 If \fI\-\-validate\fP is specified, validates the format of the XML document against an internal RNG schema. .sp \fBExample:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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 .EE .UNINDENT .UNINDENT .SS vol\-create\-from .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-create\-from pool\-or\-uuid FILE vol\-name\-or\-key\-or\-path [\-\-inputpool pool\-or\-uuid] [\-\-prealloc\-metadata] [\-\-reflink] [\-\-validate] .EE .UNINDENT .UNINDENT .sp Create a volume, using another volume as input. .sp \fIpool\-or\-uuid\fP is the name or UUID of the storage pool to create the volume in. .sp \fIFILE\fP is the XML with the volume definition. .sp \fIvol\-name\-or\-key\-or\-path\fP is the name or key or path of the source volume. .sp \fI\-\-inputpool\fP \fIpool\-or\-uuid\fP is the name or uuid of the storage pool the source volume is in. .sp [\fI\-\-prealloc\-metadata\fP] preallocate metadata (for qcow2 images which don\(aqt 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 When \fI\-\-reflink\fP is specified, perform a COW lightweight copy, where the data blocks are copied only when modified. If this is not possible, the copy fails. .sp If \fI\-\-validate\fP is specified, validates the format of the XML document against an internal RNG schema. .SS vol\-create\-as .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX 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] .EE .UNINDENT .UNINDENT .sp Create a volume from a set of arguments unless \fI\-\-print\-xml\fP is specified, in which case just the XML of the volume object is printed out without any actual object creation. .sp \fIpool\-or\-uuid\fP is the name or UUID of the storage pool to create the volume in. .sp \fIname\fP is the name of the new volume. For a disk pool, this must match the partition name as determined from the pool\(aqs 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. .sp \fIcapacity\fP is the size of the volume to be created, as a scaled integer (see \fBNOTES\fP above), defaulting to bytes if there is no suffix. .sp \fI\-\-allocation\fP \fIsize\fP is the initial size to be allocated in the volume, also as a scaled integer defaulting to bytes. .sp \fI\-\-format\fP \fIstring\fP 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). .sp \fI\-\-backing\-vol\fP \fIvol\-name\-or\-key\-or\-path\fP is the source backing volume to be used if taking a snapshot of an existing volume. .sp \fI\-\-backing\-vol\-format\fP \fIstring\fP 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. .sp [\fI\-\-prealloc\-metadata\fP] preallocate metadata (for qcow2 images which don\(aqt 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. .SS vol\-clone .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-clone vol\-name\-or\-key\-or\-path name [\-\-pool pool\-or\-uuid] [\-\-prealloc\-metadata] [\-\-reflink] [\-\-print\-xml] .EE .UNINDENT .UNINDENT .sp Clone an existing volume within the parent pool. Less powerful, but easier to type, version of \fBvol\-create\-from\fP\&. .sp \fIvol\-name\-or\-key\-or\-path\fP is the name or key or path of the source volume. .sp \fIname\fP is the name of the new volume. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool that contains the source volume and will contain the new volume. If the source volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be cloned; otherwise, the first volume found by the key or path will be used. .sp [\fI\-\-prealloc\-metadata\fP] preallocate metadata (for qcow2 images which don\(aqt 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 When \fI\-\-reflink\fP is specified, perform a COW lightweight copy, where the data blocks are copied only when modified. If this is not possible, the copy fails. .sp If \fI\-\-print\-xml\fP is specified, then the XML used to clone the volume is printed instead. .SS vol\-delete .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-delete vol\-name\-or\-key\-or\-path [\-\-pool pool\-or\-uuid] [\-\-delete\-snapshots] .EE .UNINDENT .UNINDENT .sp Delete a given volume. .sp \fIvol\-name\-or\-key\-or\-path\fP is the volume name or key or path of the volume to delete. .sp [\fI\-\-pool\fP \fIpool\-or\-uuid\fP] is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be deleted; otherwise, the first volume found by the key or path will be used. .sp The \fI\-\-delete\-snapshots\fP 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. .SS vol\-upload .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-upload vol\-name\-or\-key\-or\-path local\-file [\-\-pool pool\-or\-uuid] [\-\-offset bytes] [\-\-length bytes] [\-\-sparse] .EE .UNINDENT .UNINDENT .sp Upload the contents of \fIlocal\-file\fP to a storage volume. .sp \fIvol\-name\-or\-key\-or\-path\fP is the name or key or path of the volume where the \fIlocal\-file\fP will be uploaded. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be uploaded into; otherwise, the first volume found by the key or path will be used. .sp \fI\-\-offset\fP is the position in the storage volume at which to start writing the data. The value must be 0 or larger. .sp \fI\-\-length\fP 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. .sp If \fI\-\-sparse\fP is specified, this command will preserve volume sparseness. .sp An error will occur if the \fIlocal\-file\fP is greater than the specified \fIlength\fP\&. .sp See the description for the libvirt virStorageVolUpload API for details regarding possible target volume and pool changes as a result of the pool refresh when the upload is attempted. .SS vol\-download .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-download vol\-name\-or\-key\-or\-path local\-file [\-\-pool pool\-or\-uuid] [\-\-offset bytes] [\-\-length bytes] [\-\-sparse] .EE .UNINDENT .UNINDENT .sp Download the contents of a storage volume to \fIlocal\-file\fP\&. .sp \fIvol\-name\-or\-key\-or\-path\fP is the name or key or path of the volume to download into \fIlocal\-file\fP\&. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be uploaded into; otherwise, the first volume found by the key or path will be used. .sp \fI\-\-offset\fP is the position in the storage volume at which to start reading the data. The value must be 0 or larger. .sp \fI\-\-length\fP 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. .sp If \fI\-\-sparse\fP is specified, this command will preserve volume sparseness. .SS vol\-wipe .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-wipe vol\-name\-or\-key\-or\-path [\-\-pool pool\-or\-uuid] [\-\-algorithm algorithm] .EE .UNINDENT .UNINDENT .sp Wipe a volume, ensure data previously on the volume is not accessible to future reads. .sp \fIvol\-name\-or\-key\-or\-path\fP 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. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be wiped; otherwise, the first volume found by the key or path will be used. .sp Use the \fI\-\-algorithm\fP switch choosing from the list of the following algorithms in order to define which algorithm to use for the wipe. .sp \fBSupported algorithms\fP .INDENT 0.0 .IP \(bu 2 zero \- 1\-pass all zeroes .IP \(bu 2 nnsa \- 4\-pass NNSA Policy Letter NAP\-14.1\-C (XVI\-8) for sanitizing removable and non\-removable hard disks: random x2, 0x00, verify. .IP \(bu 2 dod \- 4\-pass DoD 5220.22\-M section 8\-306 procedure for sanitizing removable and non\-removable rigid disks: random, 0x00, 0xff, verify. .IP \(bu 2 bsi \- 9\-pass method recommended by the German Center of Security in Information Technologies ( ): 0xff, 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f. .IP \(bu 2 gutmann \- The canonical 35\-pass sequence described in Gutmann\(aqs paper. .IP \(bu 2 schneier \- 7\-pass method described by Bruce Schneier in \(dqApplied Cryptography\(dq (1996): 0x00, 0xff, random x5. .IP \(bu 2 pfitzner7 \- Roy Pfitzner\(aqs 7\-random\-pass method: random x7. .IP \(bu 2 pfitzner33 \- Roy Pfitzner\(aqs 33\-random\-pass method: random x33. .IP \(bu 2 random \- 1\-pass pattern: random. .IP \(bu 2 trim \- 1\-pass trimming the volume using TRIM or DISCARD .UNINDENT .sp \fBNote\fP: The \fBscrub\fP binary will be used to handle the \(aqnnsa\(aq, \(aqdod\(aq, \(aqbsi\(aq, \(aqgutmann\(aq, \(aqschneier\(aq, \(aqpfitzner7\(aq and \(aqpfitzner33\(aq algorithms. The availability of the algorithms may be limited by the version of the \fBscrub\fP binary installed on the host. The \(aqzero\(aq 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 \(aqtrim\(aq 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 \(aqtrim\(aq. .SS vol\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-dumpxml [\-\-pool pool\-or\-uuid] [\-\-xpath EXPRESSION] [\-\-wrap] vol\-name\-or\-key\-or\-path .EE .UNINDENT .UNINDENT .sp Output the volume information as an XML dump to stdout. .sp \fIvol\-name\-or\-key\-or\-path\fP is the name or key or path of the volume to output the XML. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be uploaded into; otherwise, the first volume found by the key or path will be used. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS vol\-info .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-info vol\-name\-or\-key\-or\-path [\-\-pool pool\-or\-uuid] [\-\-bytes] [\-\-physical] .EE .UNINDENT .UNINDENT .sp Returns basic information about the given storage volume. .sp \fIvol\-name\-or\-key\-or\-path\fP is the name or key or path of the volume to return information for. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be uploaded into; otherwise, the first volume found by the key or path will be used. .sp If \fI\-\-bytes\fP is specified the sizes are not converted to human friendly units. .sp If \fI\-\-physical\fP 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. .SS vol\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-list [\-\-pool pool\-or\-uuid] [\-\-details] .EE .UNINDENT .UNINDENT .sp Return the list of volumes in the given storage pool. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool. .sp The \fI\-\-details\fP option instructs virsh to additionally display volume type and capacity related information where available. .SS vol\-pool .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-pool vol\-key\-or\-path [\-\-uuid] .EE .UNINDENT .UNINDENT .sp Return the pool name or UUID for a given volume. By default, the pool name is returned. .sp \fIvol\-key\-or\-path\fP is the key or path of the volume to return the pool information. .sp If the \fI\-\-uuid\fP option is given, the pool UUID is returned instead. .SS vol\-path .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-path vol\-name\-or\-key [\-\-pool pool\-or\-uuid] .EE .UNINDENT .UNINDENT .sp Return the path for a given volume. .sp \fIvol\-name\-or\-key\fP is the name or key of the volume to return the path. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key, then providing the pool is necessary to find the volume to be uploaded into; otherwise, the first volume found by the key will be used. .SS vol\-name .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-name vol\-key\-or\-path .EE .UNINDENT .UNINDENT .sp Return the name for a given volume. .sp \fIvol\-key\-or\-path\fP is the key or path of the volume to return the name. .SS vol\-key .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-key vol\-name\-or\-path [\-\-pool pool\-or\-uuid] .EE .UNINDENT .UNINDENT .sp Return the volume key for a given volume. .sp \fIvol\-name\-or\-path\fP is the name or path of the volume to return the volume key. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the path, then providing the pool is necessary to find the volume to be uploaded into; otherwise, the first volume found by the path will be used. .SS vol\-resize .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX vol\-resize vol\-name\-or\-path capacity [\-\-pool pool\-or\-uuid] [\-\-allocate] [\-\-delta] [\-\-shrink] .EE .UNINDENT .UNINDENT .sp Resize the capacity of the given volume, in bytes. .sp \fIvol\-name\-or\-key\-or\-path\fP is the name or key or path of the volume to resize. .sp \fIcapacity\fP is a scaled integer (see \fBNOTES\fP above) for the volume, which defaults to bytes if there is no suffix. .sp \fI\-\-pool\fP \fIpool\-or\-uuid\fP is the name or UUID of the storage pool the volume is in. If the volume name is provided instead of the key or path, then providing the pool is necessary to find the volume to be uploaded into; otherwise, the first volume found by the key or path will be used. .sp The new \fIcapacity\fP might be sparse unless \fI\-\-allocate\fP is specified. .sp Normally, \fIcapacity\fP is the new size, but if \fI\-\-delta\fP is present, then it is added to the existing size. .sp Attempts to shrink the volume will fail unless \fI\-\-shrink\fP is present. The \fIcapacity\fP cannot be negative unless \fI\-\-shrink\fP is provided, but a negative sign is not necessary. .sp This command is only safe for storage volumes not in use by an active guest; see also \fBblockresize\fP for live resizing. .SH SECRET COMMANDS .sp The following commands manipulate \(dqsecrets\(dq (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 UUID. See for documentation of the XML format used to represent properties of secrets. .SS secret\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX secret\-define file [\-\-validate] .EE .UNINDENT .UNINDENT .sp Create a secret with the properties specified in \fIfile\fP, with no associated secret value. If \fIfile\fP does not specify a UUID, choose one automatically. If \fIfile\fP specifies a UUID of an existing secret, replace its properties by properties defined in \fIfile\fP, without affecting the secret value. .sp Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS secret\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX secret\-dumpxml [\-\-xpath EXPRESSION] [\-\-wrap] secret .EE .UNINDENT .UNINDENT .sp Output properties of \fIsecret\fP (specified by its UUID) as an XML dump to stdout. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS secret\-event .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX secret\-event {[secret] event [\-\-loop] [\-\-timeout seconds] [\-\-timestamp] | \-\-list} .EE .UNINDENT .UNINDENT .sp 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\fP\&. Using \fI\-\-list\fP as the only argument will provide a list of possible \fIevent\fP 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 SIGINT (usually via \fBCtrl\-C\fP) to quit immediately. If \fI\-\-timeout\fP is specified, the command gives up waiting for events after \fIseconds\fP have elapsed. With \fI\-\-loop\fP, the command prints all events until a timeout or interrupt key. .sp When \fI\-\-timestamp\fP is used, a human\-readable timestamp will be printed before the event. .SS secret\-set\-value .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX secret\-set\-value secret (\-\-file filename [\-\-plain] | \-\-interactive | base64) .EE .UNINDENT .UNINDENT .sp Set the value associated with \fIsecret\fP (specified by its UUID) to the value Base64\-encoded value \fIbase64\fP or Base\-64\-encoded contents of file named \fIfilename\fP\&. Using the \fI\-\-plain\fP flag is together with \fI\-\-file\fP allows one to use the file contents directly as the secret value. .sp If \fI\-\-interactive\fP flag is used the secret value is read as a password from the terminal. .sp Note that \fI\-\-file\fP, \fI\-\-interactive\fP and \fIbase64\fP options are mutually exclusive. .sp Passing secrets via the \fIbase64\fP option on command line is INSECURE and deprecated. Use the \fI\-\-file\fP option instead. .SS secret\-get\-value .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX secret\-get\-value [\-\-plain] secret .EE .UNINDENT .UNINDENT .sp Output the value associated with \fIsecret\fP (specified by its UUID) to stdout, encoded using Base64. .sp If the \fI\-\-plain\fP flag is used the value is not base64 encoded, but rather printed raw. Note that unless virsh is started in quiet mode (\fIvirsh \-q\fP) it prints a newline at the end of the command. This newline is not part of the secret. .SS secret\-undefine .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX secret\-undefine secret .EE .UNINDENT .UNINDENT .sp Delete a \fIsecret\fP (specified by its UUID), including the associated value, if any. .SS secret\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX secret\-list [\-\-ephemeral] [\-\-no\-ephemeral] [\-\-private] [\-\-no\-private] .EE .UNINDENT .UNINDENT .sp Returns the list of secrets. You may also want to filter the returned secrets by \fI\-\-ephemeral\fP to list the ephemeral ones, \fI\-\-no\-ephemeral\fP to list the non\-ephemeral ones, \fI\-\-private\fP to list the private ones, and \fI\-\-no\-private\fP to list the non\-private ones. .SH SNAPSHOT COMMANDS .sp 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 \(dqclean\(dq copy of an OS image to saving a domain\(aqs state before a potentially destructive operation. Snapshots are identified with a unique name. See for documentation of the XML format used to represent properties of snapshots. .SS snapshot\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-create domain [xmlfile] {[\-\-redefine [\-\-current]] | [\-\-no\-metadata] [\-\-halt] [\-\-disk\-only] [\-\-reuse\-external] [\-\-quiesce] [\-\-atomic] [\-\-live]} [\-\-validate] .EE .UNINDENT .UNINDENT .sp Create a snapshot for domain \fIdomain\fP with the properties specified in \fIxmlfile\fP\&. Optionally, the \fI\-\-validate\fP option can be passed to validate the format of the input XML file against an internal RNG schema (identical to using the virt\-xml\-validate(1) tool). Normally, the only properties settable for a domain snapshot are the and elements, as well as if \fI\-\-disk\-only\fP is given; the rest of the fields are ignored, and automatically filled in by libvirt. If \fIxmlfile\fP is completely omitted, then libvirt will choose a value for all fields. The new snapshot will become current, as listed by \fBsnapshot\-current\fP\&. .sp If \fI\-\-halt\fP is specified, the domain will be left in an inactive state after the snapshot is created. .sp If \fI\-\-disk\-only\fP is specified, the snapshot will only include disk content rather than the usual full system snapshot with vm state. Disk snapshots are captured faster than full system snapshots, 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\fP and \fI\-\-disk\-only\fP loses any data that was not flushed to disk at the time. .sp If \fI\-\-redefine\fP is specified, then all XML elements produced by \fBsnapshot\-dumpxml\fP 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 UUID, or to make slight alterations in the snapshot metadata (such as host\-specific aspects of the domain XML embedded in the snapshot). When this flag is supplied, the \fIxmlfile\fP argument is mandatory, and the domain\(aqs current snapshot will not be altered unless the \fI\-\-current\fP flag is also given. .sp If \fI\-\-no\-metadata\fP 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\fP is later used to teach libvirt about the metadata again). .sp If \fI\-\-reuse\-external\fP is specified, and the snapshot XML 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\fP is specified, libvirt will try to use guest agent to freeze and unfreeze domain\(aqs mounted file systems. However, if domain has no guest agent, snapshot creation will fail. Currently, this requires \fI\-\-disk\-only\fP to be passed as well. .sp If \fI\-\-atomic\fP 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\fP must be used to see whether any partial changes occurred. .sp If \fI\-\-live\fP is specified, libvirt takes the snapshot 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 snapshot. This is currently supported only for full system external snapshots. .sp Existence of snapshot metadata will prevent attempts to \fBundefine\fP a persistent guest. However, for transient domains, snapshot metadata is silently lost when the domain quits running (whether by command such as \fBdestroy\fP or by internal guest action). .sp For now, it is not possible to create snapshots in a domain that has checkpoints, although this restriction will be lifted in a future release. .SS snapshot\-create\-as .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-create\-as domain {[\-\-print\-xml] [\-\-no\-metadata] [\-\-halt] [\-\-reuse\-external]} [name] [description] [\-\-disk\-only [\-\-quiesce]] [\-\-atomic] [\-\-validate] [[\-\-live] [\-\-memspec memspec]] [\-\-diskspec] diskspec]... .EE .UNINDENT .UNINDENT .sp Create a snapshot for domain \fIdomain\fP with the given and ; if either value is omitted, libvirt will choose a value. If \fI\-\-print\-xml\fP is specified, then XML appropriate for \fIsnapshot\-create\fP is output, rather than actually creating a snapshot. Otherwise, if \fI\-\-halt\fP is specified, the domain will be left in an inactive state after the snapshot is created, and if \fI\-\-disk\-only\fP is specified, the snapshot will not include vm state. .sp The \fI\-\-memspec\fP option can be used to control whether a full system snapshot is internal or external. The \fI\-\-memspec\fP flag is mandatory, followed by a \fBmemspec\fP of the form \fB[file=]name[,snapshot=type]\fP, where type can be \fBno\fP, \fBinternal\fP, or \fBexternal\fP\&. To include a literal comma in \fBfile=name\fP, escape it with a second comma. \fI\-\-memspec\fP cannot be used together with \fI\-\-disk\-only\fP\&. .sp The \fI\-\-diskspec\fP option can be used to control how \fI\-\-disk\-only\fP and external full system snapshots 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][,stype=type][,file=name]\fP\&. A \fIdiskspec\fP must be provided for disks backed by block devices as libvirt doesn\(aqt auto\-generate file names for those. The optional \fBstype\fP parameter allows one to control the type of the source file. Supported values are \(aqfile\(aq (default) and \(aqblock\(aq. To exclude a disk from an external snapshot use \fB\-\-diskspec disk,snapshot=no\fP\&. .sp To include a literal comma in \fBdisk\fP or in \fBfile=name\fP, escape it with a second comma. A literal \fI\-\-diskspec\fP must precede each \fBdiskspec\fP unless all three of \fIdomain\fP, \fIname\fP, and \fIdescription\fP are also present. For example, a diskspec of \(dqvda,snapshot=external,file=/path/to,,new\(dq results in the following XML: .INDENT 0.0 .INDENT 3.5 .sp .EX .EE .UNINDENT .UNINDENT .sp If \fI\-\-reuse\-external\fP is specified, and the domain XML or \fIdiskspec\fP 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\fP is specified, libvirt will try to use guest agent to freeze and unfreeze domain\(aqs mounted file systems. However, if domain has no guest agent, snapshot creation will fail. Currently, this requires \fI\-\-disk\-only\fP to be passed as well. .sp If \fI\-\-no\-metadata\fP 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\fP is later used to teach libvirt about the metadata again). .sp If \fI\-\-atomic\fP 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\fP must be used to see whether any partial changes occurred. .sp If \fI\-\-live\fP is specified, libvirt takes the snapshot while the guest is running. This increases the size of the memory image of the external snapshot. This is currently supported only for external full system snapshots. .sp For now, it is not possible to create snapshots in a domain that has checkpoints, although this restriction will be lifted in a future release. .sp Optionally, the \fI\-\-validate\fP option can be passed to validate XML document which is internally generated by this command against the internal RNG schema. .SS snapshot\-current .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-current domain {[\-\-name] | [\-\-security\-info] | [snapshotname]} .EE .UNINDENT .UNINDENT .sp Without \fIsnapshotname\fP, this will output the snapshot XML for the domain\(aqs current snapshot (if any). If \fI\-\-name\fP is specified, just the current snapshot name instead of the full xml. Otherwise, using \fI\-\-security\-info\fP will also include security sensitive information in the XML. .sp With \fIsnapshotname\fP, this is a request to make the existing named snapshot become the current snapshot, without reverting the domain. .SS snapshot\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-edit domain [snapshotname] [\-\-current] {[\-\-rename] | [\-\-clone]} .EE .UNINDENT .UNINDENT .sp Edit the XML configuration file for \fIsnapshotname\fP of a domain. If both \fIsnapshotname\fP and \fI\-\-current\fP are specified, also force the edited snapshot to become the current snapshot. If \fIsnapshotname\fP is omitted, then \fI\-\-current\fP must be supplied, to edit the current snapshot. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX 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] .EE .UNINDENT .UNINDENT .sp except that it does some error checking. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .sp If \fI\-\-rename\fP is specified, then the edits can change the snapshot name. If \fI\-\-clone\fP 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. .SS snapshot\-info .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-info domain {snapshot | \-\-current} .EE .UNINDENT .UNINDENT .sp Output basic information about a named , or the current snapshot with \fI\-\-current\fP\&. .SS snapshot\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-list domain [\-\-metadata] [\-\-no\-metadata] [{\-\-parent | \-\-roots | [{\-\-tree | \-\-name}]}] [\-\-topological] [{[\-\-from] snapshot | \-\-current} [\-\-descendants]] [\-\-leaves] [\-\-no\-leaves] [\-\-inactive] [\-\-active] [\-\-disk\-only] [\-\-internal] [\-\-external] .EE .UNINDENT .UNINDENT .sp List all of the available snapshots for the given domain, defaulting to show columns for the snapshot name, creation time, and domain state. .sp Normally, table form output is sorted by snapshot name; using \fI\-\-topological\fP instead sorts so that no child is listed before its ancestors (although there may be more than one possible ordering with this property). .sp If \fI\-\-parent\fP is specified, add a column to the output table giving the name of the parent of each snapshot. If \fI\-\-roots\fP is specified, the list will be filtered to just snapshots that have no parents. If \fI\-\-tree\fP is specified, the output will be in a tree format, listing just snapshot names. These three options are mutually exclusive. .sp If \fI\-\-name\fP is specified only the snapshot name is printed optionally followed by a tab\-separated name of the parent snapshot if \fI\-\-parent\fP is used as well. This option is mutually exclusive with \fI\-\-tree\fP\&. .sp If \fI\-\-from\fP is provided, filter the list to snapshots which are children of the given \fBsnapshot\fP; or if \fI\-\-current\fP is provided, start at the current snapshot. When used in isolation or with \fI\-\-parent\fP, the list is limited to direct children unless \fI\-\-descendants\fP is also present. When used with \fI\-\-tree\fP, the use of \fI\-\-descendants\fP is implied. This option is not compatible with \fI\-\-roots\fP\&. Note that the starting point of \fI\-\-from\fP or \fI\-\-current\fP is not included in the list unless the \fI\-\-tree\fP option is also present. .sp If \fI\-\-leaves\fP is specified, the list will be filtered to just snapshots that have no children. Likewise, if \fI\-\-no\-leaves\fP 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\fP\&. .sp If \fI\-\-metadata\fP is specified, the list will be filtered to just snapshots that involve libvirt metadata, and thus would prevent \fBundefine\fP of a persistent guest, or be lost on \fBdestroy\fP of a transient domain. Likewise, if \fI\-\-no\-metadata\fP is specified, the list will be filtered to just snapshots that exist without the need for libvirt metadata. .sp If \fI\-\-inactive\fP is specified, the list will be filtered to snapshots that were taken when the domain was shut off. If \fI\-\-active\fP 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\fP 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\fP is specified, the list will be filtered to snapshots that use internal storage of existing disk images. If \fI\-\-external\fP is specified, the list will be filtered to snapshots that use external files for disk images or memory state. .SS snapshot\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-dumpxml [\-\-security\-info] [\-\-xpath EXPRESSION] [\-\-wrap] domain snapshot .EE .UNINDENT .UNINDENT .sp Output the snapshot XML for the domain\(aqs snapshot named \fIsnapshot\fP\&. Using \fI\-\-security\-info\fP will also include security sensitive information. Use \fBsnapshot\-current\fP to easily access the XML of the current snapshot. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS snapshot\-parent .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-parent domain {snapshot | \-\-current} .EE .UNINDENT .UNINDENT .sp Output the name of the parent snapshot, if any, for the given \fIsnapshot\fP, or for the current snapshot with \fI\-\-current\fP\&. .SS snapshot\-revert .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-revert domain {snapshot | \-\-current} [{\-\-running | \-\-paused}] [\-\-force] [\-\-reset\-nvram] .EE .UNINDENT .UNINDENT .sp Revert the given domain to the snapshot specified by \fIsnapshot\fP, or to the current snapshot with \fI\-\-current\fP\&. 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\fP or \fI\-\-paused\fP 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 Since libvirt 7.10.0 the VM process is always restarted so the following paragraph is no longer valid. If the snapshot metadata lacks the full VM XML it\(aqs no longer possible to revert to such snapshot. .sp There are a number of cases where a snapshot revert involves extra risk, which requires the use of \fI\-\-force\fP to proceed: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 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\fP assures libvirt that the snapshot is compatible with the current configuration (and if it is not, the domain will likely fail to run). .IP \(bu 2 Another 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 VNC 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\fP or \fI\-\-pause\fP flag. .IP \(bu 2 Also, libvirt will refuse to restore snapshots of inactive QEMU domains while there is managed saved state. This is because those snapshots do not contain memory state and will therefore not replace the existing memory state. This ends up switching a disk underneath a running system and will likely cause extensive filesystem corruption or crashes due to swap content mismatches when run. .UNINDENT .UNINDENT .UNINDENT .sp If \fI\-\-reset\-nvram\fP is specified, any existing NVRAM file will be deleted and re\-initialized from its pristine template. .SS snapshot\-delete .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX snapshot\-delete domain {snapshot | \-\-current} [\-\-metadata] [{\-\-children | \-\-children\-only}] .EE .UNINDENT .UNINDENT .sp Delete the snapshot for the domain named \fIsnapshot\fP, or the current snapshot with \fI\-\-current\fP\&. If this snapshot has child snapshots, changes from this snapshot will be merged into the children. If \fI\-\-children\fP is passed, then delete this snapshot and any children of this snapshot. If \fI\-\-children\-only\fP is passed, then delete any children of this snapshot, but leave this snapshot intact. These two flags are mutually exclusive. .sp If \fI\-\-metadata\fP 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 CHECKPOINT COMMANDS .sp The following commands manipulate domain checkpoints. Checkpoints serve as a point in time to identify which portions of a guest\(aqs disks have changed after that time, making it possible to perform incremental and differential backups. Checkpoints are identified with a unique name. See for documentation of the XML format used to represent properties of checkpoints. .SS checkpoint\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-create domain [xmlfile] { \-\-redefine [\-\-redefine\-validate] | [\-\-quiesce]} .EE .UNINDENT .UNINDENT .sp Create a checkpoint for domain \fIdomain\fP with the properties specified in \fIxmlfile\fP describing a top\-level element. The format of the input XML file will be validated against an internal RNG schema (identical to using the virt\-xml\-validate(1) tool). If \fIxmlfile\fP is completely omitted, then libvirt will create a checkpoint with a name based on the current time. .sp If \fI\-\-redefine\fP is specified, then all XML elements produced by \fBcheckpoint\-dumpxml\fP are valid; this can be used to migrate checkpoint 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 UUID, or to make slight alterations in the checkpoint metadata (such as host\-specific aspects of the domain XML embedded in the checkpoint). When this flag is supplied, the \fIxmlfile\fP argument is mandatory. .sp If \fI\-\-redefine\-validate\fP is specified along with \fI\-\-redefine\fP the hypervisor performs validation of metadata associated with the checkpoint stored in places besides the checkpoint XML. Note that some hypervisors may require that the domain is running to perform validation. .sp If \fI\-\-quiesce\fP is specified, libvirt will try to use guest agent to freeze and unfreeze domain\(aqs mounted file systems. However, if domain has no guest agent, checkpoint creation will fail. .sp Existence of checkpoint metadata will prevent attempts to \fBundefine\fP a persistent guest. However, for transient domains, checkpoint metadata is silently lost when the domain quits running (whether by command such as \fBdestroy\fP or by internal guest action). .sp For now, it is not possible to create checkpoints in a domain that has snapshots, although this restriction will be lifted in a future release. .SS checkpoint\-create\-as .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-create\-as domain [\-\-print\-xml] [name] [description] [\-\-quiesce] [\-\-diskspec] diskspec]... .EE .UNINDENT .UNINDENT .sp Create a checkpoint for domain \fIdomain\fP with the given and ; if either value is omitted, libvirt will choose a value. If \fI\-\-print\-xml\fP is specified, then XML appropriate for \fIcheckpoint\-create\fP is output, rather than actually creating a checkpoint. .sp The \fI\-\-diskspec\fP option can be used to control which guest disks participate in the checkpoint. This option can occur multiple times, according to the number of elements in the domain xml. Each is in the form \fBdisk[,checkpoint=type][,bitmap=name]\fP\&. A literal \fI\-\-diskspec\fP must precede each \fBdiskspec\fP unless all three of \fIdomain\fP, \fIname\fP, and \fIdescription\fP are also present. For example, a diskspec of \(dqvda,checkpoint=bitmap,bitmap=map1\(dq results in the following XML: .INDENT 0.0 .INDENT 3.5 .sp .EX .EE .UNINDENT .UNINDENT .sp If \fI\-\-quiesce\fP is specified, libvirt will try to use guest agent to freeze and unfreeze domain\(aqs mounted file systems. However, if domain has no guest agent, checkpoint creation will fail. .sp For now, it is not possible to create checkpoints in a domain that has snapshots, although this restriction will be lifted in a future release. .SS checkpoint\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-edit domain checkpointname .EE .UNINDENT .UNINDENT .sp Edit the XML configuration file for \fIcheckpointname\fP of a domain. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh checkpoint\-dumpxml dom name > checkpoint.xml vi checkpoint.xml (or make changes with your other text editor) virsh checkpoint\-create dom checkpoint.xml \-\-redefine .EE .UNINDENT .UNINDENT .sp except that it does some error checking, including that the edits should not attempt to change the checkpoint name. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SS checkpoint\-info .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-info domain checkpoint .EE .UNINDENT .UNINDENT .sp Output basic information about a named . .SS checkpoint\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-list domain [{\-\-parent | \-\-roots | [{\-\-tree | \-\-name}]}] [\-\-topological] [[\-\-from] checkpoint | [\-\-descendants]] [\-\-leaves] [\-\-no\-leaves] .EE .UNINDENT .UNINDENT .sp List all of the available checkpoints for the given domain, defaulting to show columns for the checkpoint name and creation time. .sp Normally, table form output is sorted by checkpoint name; using \fI\-\-topological\fP instead sorts so that no child is listed before its ancestors (although there may be more than one possible ordering with this property). .sp If \fI\-\-parent\fP is specified, add a column to the output table giving the name of the parent of each checkpoint. If \fI\-\-roots\fP is specified, the list will be filtered to just checkpoints that have no parents. If \fI\-\-tree\fP is specified, the output will be in a tree format, listing just checkpoint names. These three options are mutually exclusive. .sp If \fI\-\-name\fP is specified only the checkpoint name is printed optionally followed by a tab\-separated name of the parent checkpoint if \fI\-\-parent\fP is used as well. This option is mutually exclusive with \fI\-\-tree\fP\&. .sp If \fI\-\-from\fP is provided, filter the list to checkpoints which are children of the given \fBcheckpoint\fP\&. When used in isolation or with \fI\-\-parent\fP, the list is limited to direct children unless \fI\-\-descendants\fP is also present. When used with \fI\-\-tree\fP, the use of \fI\-\-descendants\fP is implied. This option is not compatible with \fI\-\-roots\fP\&. Note that the starting point of \fI\-\-from\fP is not included in the list unless the \fI\-\-tree\fP option is also present. .sp If \fI\-\-leaves\fP is specified, the list will be filtered to just checkpoints that have no children. Likewise, if \fI\-\-no\-leaves\fP is specified, the list will be filtered to just checkpoints 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\fP\&. .SS checkpoint\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-dumpxml [\-\-security\-info] [\-\-no\-domain] [\-\-size] [\-\-xpath EXPRESSION] [\-\-wrap] domain checkpoint .EE .UNINDENT .UNINDENT .sp Output the checkpoint XML for the domain\(aqs checkpoint named \fIcheckpoint\fP\&. Using \fI\-\-security\-info\fP will also include security sensitive information. .sp Using \fI\-\-size\fP will add XML indicating the current size in bytes of guest data that has changed since the checkpoint was created (although remember that guest activity between a size check and actually creating a backup can result in the backup needing slightly more space). Note that some hypervisors may require that \fIdomain\fP is running when \fI\-\-size\fP is used. .sp Using \fI\-\-no\-domain\fP will omit the element from the output for a more compact view. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS checkpoint\-parent .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-parent domain checkpoint .EE .UNINDENT .UNINDENT .sp Output the name of the parent checkpoint, if any, for the given \fIcheckpoint\fP\&. .SS checkpoint\-delete .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX checkpoint\-delete domain checkpoint [\-\-metadata] [{\-\-children | \-\-children\-only}] .EE .UNINDENT .UNINDENT .sp Delete the checkpoint for the domain named \fIcheckpoint\fP\&. The record of which portions of the disk changed since the checkpoint are merged into the parent checkpoint (if any). If \fI\-\-children\fP is passed, then delete this checkpoint and any children of this checkpoint. If \fI\-\-children\-only\fP is passed, then delete any children of this checkpoint, but leave this checkpoint intact. These two flags are mutually exclusive. .sp If \fI\-\-metadata\fP is specified, then only delete the checkpoint metadata maintained by libvirt, while leaving the checkpoint contents intact for access by external tools; otherwise deleting a checkpoint also removes the ability to perform an incremental backup from that point in time. .SH NWFILTER COMMANDS .sp 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 XML 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\(aq interfaces. .SS nwfilter\-define .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-define xmlfile [\-\-validate] .EE .UNINDENT .UNINDENT .sp 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 XML. 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 XML will be rejected. .sp Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS nwfilter\-undefine .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-undefine nwfilter\-name .EE .UNINDENT .UNINDENT .sp Delete a network filter. The deletion will fail if any running virtual machine is currently using this network filter. .SS nwfilter\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-list .EE .UNINDENT .UNINDENT .sp List all of the available network filters. .SS nwfilter\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-dumpxml [\-\-xpath EXPRESSION] [\-\-wrap] nwfilter\-name .EE .UNINDENT .UNINDENT .sp Output the network filter XML. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SS nwfilter\-edit .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-edit nwfilter\-name .EE .UNINDENT .UNINDENT .sp Edit the XML of a network filter. .sp This is equivalent to: .INDENT 0.0 .INDENT 3.5 .sp .EX virsh nwfilter\-dumpxml myfilter > myfilter.xml vi myfilter.xml (or make changes with your other text editor) virsh nwfilter\-define myfilter.xml .EE .UNINDENT .UNINDENT .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\fP\&. .sp The editor used can be supplied by the \fB$VISUAL\fP or \fB$EDITOR\fP environment variables, and defaults to \fBvi\fP\&. .SH NWFILTER BINDING COMMANDS .sp The following commands manipulate network filter bindings. Network filter bindings track the association between a network port and a network filter. Generally the bindings are managed automatically by the hypervisor drivers when adding/removing NICs on a guest. .sp If an admin is creating/deleting TAP devices for non\-guest usage, however, the network filter binding commands provide a way to make use of the network filters directly. .SS nwfilter\-binding\-create .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-binding\-create xmlfile [\-\-validate] .EE .UNINDENT .UNINDENT .sp Associate a network port with a network filter. The network filter backend will immediately attempt to instantiate the filter rules on the port. This command may be used to associate a filter with a currently running guest that does not have a filter defined for a specific network port. Since the bindings are generally automatically managed by the hypervisor, using this command to define a filter for a network port and then starting the guest afterwards may prevent the guest from starting if it attempts to use the network port and finds a filter already defined. .sp Optionally, the format of the input XML file can be validated against an internal RNG schema with \fI\-\-validate\fP\&. .SS nwfilter\-binding\-delete .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-binding\-delete port\-name .EE .UNINDENT .UNINDENT .sp Disassociate a network port from a network filter. The network filter backend will immediately tear down the filter rules that exist on the port. This command may be used to remove the network port binding for a filter currently in use for the guest while the guest is running without needing to restart the guest. Restoring the network port binding filter for the running guest would be accomplished by using \fInwfilter\-binding\-create\fP\&. .SS nwfilter\-binding\-list .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-binding\-list .EE .UNINDENT .UNINDENT .sp List all of the network ports which have filters associated with them. .SS nwfilter\-binding\-dumpxml .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX nwfilter\-binding\-dumpxml [\-\-xpath EXPRESSION] [\-\-wrap] port\-name .EE .UNINDENT .UNINDENT .sp Output the network filter binding XML for the network device called \fBport\-name\fP\&. .sp If the \fB\-\-xpath\fP argument provides an XPath expression, it will be evaluated against the output XML and only those matching nodes will be printed. The default behaviour is to print each matching node as a standalone document, however, for ease of additional processing, the \fB\-\-wrap\fP argument will cause the matching node to be wrapped in a common root node. .SH HYPERVISOR-SPECIFIC COMMANDS .sp NOTE: Use of the following commands is \fBstrongly\fP 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. .SS qemu\-attach .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX qemu\-attach pid .EE .UNINDENT .UNINDENT .sp Attach an externally launched QEMU process to the libvirt QEMU driver. The QEMU process must have been created with a monitor connection using the UNIX driver. Ideally the process will also have had the \(aq\-name\(aq argument specified. .INDENT 0.0 .INDENT 3.5 .sp .EX $ 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 .EE .UNINDENT .UNINDENT .sp Not all functions of libvirt are expected to work reliably after attaching to an externally launched QEMU process. There may be issues with the guest ABI changing upon migration and device hotplug or hotunplug may not work. The attached environment should be considered primarily read\-only. .SS qemu\-monitor\-command .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX qemu\-monitor\-command domain { [\-\-hmp] | [\-\-pretty] [\-\-return\-value] } [\-\-pass\-fds N,M,...] command... .EE .UNINDENT .UNINDENT .sp Send an arbitrary monitor command \fIcommand\fP to domain \fIdomain\fP through the QEMU monitor. The results of the command will be printed on stdout. .sp If more than one argument is provided for \fIcommand\fP, they are concatenated with a space in between before passing the single command to the monitor. .sp Note that libvirt uses the QMP to talk to qemu so \fIcommand\fP must be valid JSON in QMP format to work properly. If \fIcommand\fP is not a JSON object libvirt tries to wrap it as a JSON object to provide convenient interface such as the groups of commands with identical handling: .INDENT 0.0 .INDENT 3.5 .sp .EX # simple command $ virsh qemu\-monitor\-command VM commandname $ virsh qemu\-monitor\-command VM \(aq{\(dqexecute\(dq:\(dqcommandname\(dq}\(aq # with arguments $ virsh qemu\-monitor\-command VM commandname \(aq\(dqarg1\(dq:123\(aq \(aq\(dqarg2\(dq:\(dqtest\(dq\(aq $ virsh qemu\-monitor\-command VM commandname \(aq{\(dqarg1\(dq:123,\(dqarg2\(dq:\(dqtest\(dq}\(aq $ virsh qemu\-monitor\-command VM \(aq{\(dqexecute\(dq:\(dqcommandname\(dq, \(dqarguments\(dq:{\(dqarg1\(dq:123,\(dqarg2\(dq:\(dqtest\(dq}}\(aq .EE .UNINDENT .UNINDENT .sp If \fI\-\-pretty\fP is given the QMP reply is pretty\-printed. .sp If \fI\-\-return\-value\fP is given the \(aqreturn\(aq key of the QMP response object is extracted rather than passing through the full reply from QEMU. .sp If \fI\-\-hmp\fP is passed, the command is considered to be a human monitor command and libvirt will automatically convert it into QMP and convert the result back. .sp If \fI\-\-pass\-fds\fP is specified, the argument is a comma separated list of open file descriptors which should be passed on to qemu along with the command. .SS qemu\-agent\-command .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX qemu\-agent\-command domain [\-\-timeout seconds | \-\-async | \-\-block] command... .EE .UNINDENT .UNINDENT .sp Send an arbitrary guest agent command \fIcommand\fP to domain \fIdomain\fP through QEMU agent. \fI\-\-timeout\fP, \fI\-\-async\fP and \fI\-\-block\fP options are exclusive. \fI\-\-timeout\fP requires timeout seconds \fIseconds\fP and it must be positive. When \fI\-\-aysnc\fP is given, the command waits for timeout whether success or failed. And when \fI\-\-block\fP is given, the command waits forever with blocking timeout. .SS qemu\-monitor\-event .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX qemu\-monitor\-event [domain] [\-\-event event\-name] [\-\-loop] [\-\-timeout seconds] [\-\-pretty] [\-\-regex] [\-\-no\-case] [\-\-timestamp] .EE .UNINDENT .UNINDENT .sp Wait for arbitrary QEMU monitor events to occur, and print out the details of events as they happen. The events can optionally be filtered by \fIdomain\fP or \fIevent\-name\fP\&. The \(aqquery\-events\(aq QMP command can be used via \fIqemu\-monitor\-command\fP to learn what events are supported. If \fI\-\-regex\fP is used, \fIevent\-name\fP is a basic regular expression instead of a literal string. If \fI\-\-no\-case\fP is used, \fIevent\-name\fP will match case\-insensitively. .sp By default, this command is one\-shot, and returns success once an event occurs; you can send SIGINT (usually via \fBCtrl\-C\fP) to quit immediately. If \fI\-\-timeout\fP is specified, the command gives up waiting for events after \fIseconds\fP have elapsed. With \fI\-\-loop\fP, the command prints all events until a timeout or interrupt key. If \fI\-\-pretty\fP is specified, any JSON event details are pretty\-printed for better legibility. .sp When \fI\-\-timestamp\fP is used, a human\-readable timestamp will be printed before the event, and the timing information provided by QEMU will be omitted. .SS lxc\-enter\-namespace .sp \fBSyntax:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX lxc\-enter\-namespace domain [\-\-noseclabel] \-\- /path/to/binary [arg1, [arg2, ...]] .EE .UNINDENT .UNINDENT .sp Enter the namespace of \fIdomain\fP and execute the command \fB/path/to/binary\fP 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 LXC hypervisor driver. This command succeeds only if \fB/path/to/binary\fP 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\fP option to instead have the process keep the same security label as \fBvirsh\fP\&. .SH ENVIRONMENT .sp The following environment variables can be set to alter the behaviour of \fBvirsh\fP .INDENT 0.0 .IP \(bu 2 VIRSH_DEBUG=<0 to 4> .sp Turn on verbose debugging of virsh commands. Valid levels are .INDENT 2.0 .IP \(bu 2 VIRSH_DEBUG=0 .sp DEBUG \- Messages at ALL levels get logged .IP \(bu 2 VIRSH_DEBUG=1 .sp INFO \- Logs messages at levels INFO, NOTICE, WARNING and ERROR .IP \(bu 2 VIRSH_DEBUG=2 .sp NOTICE \- Logs messages at levels NOTICE, WARNING and ERROR .IP \(bu 2 VIRSH_DEBUG=3 .sp WARNING \- Logs messages at levels WARNING and ERROR .IP \(bu 2 VIRSH_DEBUG=4 .sp ERROR \- Messages at only ERROR level gets logged. .UNINDENT .IP \(bu 2 VIRSH_LOG_FILE=\(ga\(gaLOGFILE\(ga\(ga .sp The file to log virsh debug messages. .IP \(bu 2 VIRSH_DEFAULT_CONNECT_URI .sp The hypervisor to connect to by default. Set this to a URI, in the same format as accepted by the \fBconnect\fP option. This environment variable is deprecated in favour of the global \fBLIBVIRT_DEFAULT_URI\fP variable which serves the same purpose. .IP \(bu 2 LIBVIRT_DEFAULT_URI .sp The hypervisor to connect to by default. Set this to a URI, in the same format as accepted by the \fBconnect\fP option. This overrides the default URI set in any client config file and prevents libvirt from probing for drivers. .IP \(bu 2 VISUAL .sp The editor to use by the \fBedit\fP and related options. .IP \(bu 2 EDITOR .sp The editor to use by the \fBedit\fP and related options, if \fBVISUAL\fP is not set. .IP \(bu 2 VIRSH_HISTSIZE .sp The number of commands to remember in the command history. The default value is 500. .IP \(bu 2 LIBVIRT_DEBUG=LEVEL .sp Turn on verbose debugging of all libvirt API calls. Valid levels are .INDENT 2.0 .IP \(bu 2 LIBVIRT_DEBUG=1 .sp Messages at level DEBUG or above .IP \(bu 2 LIBVIRT_DEBUG=2 .sp Messages at level INFO or above .IP \(bu 2 LIBVIRT_DEBUG=3 .sp Messages at level WARNING or above .IP \(bu 2 LIBVIRT_DEBUG=4 .sp Messages at level ERROR .UNINDENT .UNINDENT .sp For further information about debugging options consult .SH BUGS .sp Please report all bugs you discover. This should be done via either: .INDENT 0.0 .IP 1. 3 the mailing list .sp .IP 2. 3 the bug tracker .sp .UNINDENT .sp Alternatively, you may report bugs to your software distributor / vendor. .SH AUTHORS .sp Please refer to the AUTHORS file distributed with libvirt. .SH COPYRIGHT .sp Copyright (C) 2005, 2007\-2015 Red Hat, Inc., and the authors listed in the libvirt AUTHORS file. .SH LICENSE .sp \fBvirsh\fP is distributed under the terms of the GNU LGPL v2+. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .SH SEE ALSO .sp virt\-install(1), virt\-xml\-validate(1), virt\-top(1), virt\-df(1), .\" Generated by docutils manpage writer. .