virsh(1) Virtualization Support virsh(1) (NAME) virsh - (SYNOPSIS) virsh [OPTION]... [COMMAND_STRING] virsh [OPTION]... COMMAND [ARG]... (DESCRIPTION) virsh (guest domains) virsh . (pause) . . Libvirt C ( ) . GNU Lesser General Public License . . C API . Xen QEMU KVM LXC OpenVZ VirtualBox VMware ESX . virsh : virsh [OPTION]... [ARG]... command domain (domain id) UUID ARGS . xen . . : domain id . domain id . command # (comment) command . virsh COMMAND COMMAND_STRING COMMAND - - . COMMAND_STRING virsh # . virsh quit . virsh (OPTIONS) . -c, --connect URI URI connect . -d, --debug LEVEL LEVEL . LEVEL 0 4 () . LEVEL VIRSH_DEBUG . o -e, --escape string console. ^] telnet . (hat notation) : @ [ ] ^ _. o -h, --help help . o -k, --keepalive-interval INTERVAL INTERVAL ( ) keepalive . 0 keepalive . o -K, --keepalive-count COUNT keepalive . INTERVAL 0 . o -l, --log FILE FILE. o -q, --quiet . o -r, --readonly --readonly connect. o -t, --timing . o --no-pkttyagent pkttyagent polkit virsh . o -v, --version[=short] libvirt virsh . o -V, --version=long libvirt virsh ..SH " (NOTES)" virsh libvirt libvirtd . service libvirtd start . virsh hypervisor (root) . root . virsh (synchronous) shutdown setvcpus setmem. virsh (guest) . virsh (backward compatibility) . help virsh ( --tunnelled --tunneled) . virsh ( ). : 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 (GENERIC COMMANDS) (domain) . help : help [command-or-group] virsh . . . : : virsh # help host Host and Hypervisor (help keyword 'host'): 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 . : : 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 : quit exit version : version [--daemon] . --daemon libvirt . : $ 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 cd : cd [directory] directory . cd HOME (root) . pwd : pwd . connect : connect [URI] [--readonly] ( ) . URI -c . URI . URI : o xen:///system Xen o qemu:///system QEMU KVM o qemu:///session QEMU KVM o lxc:///system URI uri . URI URI . --readonly .SS uri : uri URI (canonical) (shell mode) . hostname : hostname (hostname) . sysinfo : sysinfo XML (sysinfo) . nodeinfo : nodeinfo (node) . . CPU frequency . (throttle) . nodes/sockets/cores/threads ( sockets/cores/threads NUMA ) . ( dies clusters ) NUMA . (nodes = 1, sockets = 1, cores = number of host cpus, threads = 1) . capabilities ( ) /capabilities/host/topology XPath . nodecpumap : nodecpumap [--pretty] (online) . --pretty (range) ..SS nodecpustats : nodecpustats [cpu] [--percent] (CPU) . cpu . --percent . nodememstats : nodememstats [cell] . cell . nodesevinfo : nodesevinfo AMD SEV ( ) . XML (domain capabilities) . nodesuspend : nodesuspend [target] [duration] ( ) (Real-Time-Clock) duration . target "mem" ( ) "disk" ( ) "hybrid" ( ) . duration . node-memory-tune : node-memory-tune [shm-pages-to-scan] [shm-sleep-millisecs] [shm-merge-across-nodes] . shm-pages-to-scan shm-sleep-millisecs ( ) shm-merge-across-nodes NUMA . 0 NUMA . 1 . 1 . : " " KSM (Kernel Samepage Merging) ..SS capabilities : capabilities [--xpath EXPRESSION] [--wrap] XML . CPU . : XML NUMA . --xpath XPath XML . --wrap . domcapabilities : domcapabilities [virttype] [emulatorbin] [arch] [machine] [--xpath EXPRESSION] [--wrap] [--disable-deprecated-features] [--expand-cpu-features] [--supported-cpu-features] XML (domain) virsh capabilities . (emulator) VFIO . . . virttype . 'type' XML 'type' virsh capabilities . emulatorbin . XML virsh capabilities. arch . "arch" XML "name" virsh capabilities. machine . "machine" XML virsh capabilities . QEMU virttype 'qemu' 'kvm' emulatorbin arch machine . machine . --xpath XPath XML . --wrap . --disable-deprecated-features XML CPU (host-model) CPU . "disable" . --expand-cpu-features CPU (host-model) CPU CPU . CPU . --supported-cpu-features CPU (host-model) CPU . --supported-cpu-features --expand-cpu-features ..SS pool-capabilities : pool-capabilities XML (storage pool) . . inject-nmi : inject-nmi domain NMI . list : 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] . . : : ``virsh`` list Id Name State ---------------------------------------------------- 0 Domain-0 running 2 fedora paused Name . ID . State ( ). (STATES) State . : o running (CPU) . o idle . IO ( ) . o paused (pause) virsh suspend . (hypervisor) . o in shutdown . o shut off . . o crashed (crash) . . o pmsuspended s3 . . --inactive --all . (Filtering) list . . . . :.SS (Persistence) --persistent . --transient . (Existence of managed save image) --with-managed-save . --without-managed-save . (Domain state) : --state-running --state-paused --state-shutoff --state-other . (Autostarting domains) --autostart . --no-autostart . (Snapshot existence) --with-snapshot --without-snapshot . (Checkpoint existence) --with-checkpoint --without-checkpoint . API (race condition) . . --managed-save ( shut off --inactive --all ) saved . --table . . --name . --uuid UUID . --id ID . --name --uuid --id . --table --name --id . --name --uuid --id . --name --uuid --id --all -1 . --table --uuid UUID . --title () . --table . : $ virsh list --title Id Name State Title ------------------------------------------- 0 Domain-0 running Mailserver 1 2 fedora paused freecell : freecell [{ [--cellno] cellno | --all }] NUMA . freecell . . --all . --cellno ..SS freepages : freepages [{ [--cellno] cellno [--pagesize] pagesize | --all }] NUMA . cellno NUMA . pagesize ( NOTES ). --all NUMA . allocpages : allocpages [--pagesize] pagesize [--pagecount] pagecount [[--cellno] cellno] [--add] [--all] pagesize . --add pagecount . --add pagecount ( ). cellno NUMA . --all NUMA . cpu-baseline : cpu-baseline FILE [--features] [--migratable] (baseline CPU) . ( hypervisor-cpu-baseline .) . capabilities . --features XML XML . --migratable . cpu-compare : cpu-compare FILE [--error] [--validate] XML . ( hypervisor-cpu-compare .) XML . capabilities . XML XML ( domcapabilities) . XML XML XML . : https://libvirt.org/formatdomain.html#elementsCPU . --error . --validate XML RNG ..SS cpu-models : cpu-models arch CPU libvirt . CPU XML domcapabilities . libvirt CPU CPU . CPU CPU XML . hypervisor-cpu-compare : hypervisor-cpu-compare FILE [virttype] [emulator] [arch] [machine] [--error] [--validate] CPU XML CPU . ( cpu-compare CPU CPU .) XML FILE CPU : XML CPU CPU XML ( domcapabilities). XML . CPU . CPU : https://libvirt.org/formatdomain.html#elementsCPU . XML XML CPU . FILE XML CPU . virttype ( 'type' XML ). emulator arch CPU machine . --error CPU CPU . --validate XML RNG . hypervisor-cpu-baseline : hypervisor-cpu-baseline [FILE] [virttype] [emulator] [arch] [machine] [--features] [--migratable] [--ignore-host] [model] CPU (baseline) CPU FILE XML . FILE . CPU ( CPU CPU ). --ignore-host ( ). cpu-baseline CPU . FILE XML CPU CPU model . FILE model . XML FILE CPU CPU XML ( domcapabilities ). XML . CPU . XML CPU . FILE XML CPU . FILE CPU CPU . virsh hypervisor-cpu-baseline virsh domcapabilities CPU XML XML . model ( FILE CPU ) virsh domcapabilities CPU . virttype ( 'type' XML ). emulator arch CPU machine . --features XML CPU CPU XML . --migratable CPU . --ignore-host FILE CPU . ( FILE ) ..SS hypervisor-cpu-models : hypervisor-cpu-models [--virttype virttype] [--emulator emulator] [--arch arch] [--machine machine] [--all] CPU . CPU . CPU virsh hypervisor-cpu-baseline virsh hypervisor-cpu-compare . virttype ( 'type' XML ). emulator () arch CPU machine . << >> ("usable") . --all CPU ( ). (DOMAIN COMMANDS) domain . domain UUID . autostart : autostart [--disable] [--once] domain . --once . --disable . --once . (VM) . blkdeviotune : 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] I/O domain. device () () domain ( domblklist ). I/O . : --total-bytes-sec . --read-bytes-sec . --write-bytes-sec . --total-iops-sec I/O . --read-iops-sec I/O . --write-iops-sec I/O . --total-bytes-sec-max . --read-bytes-sec-max . --write-bytes-sec-max . --total-iops-sec-max I/O . --read-iops-sec-max I/O . --write-iops-sec-max I/O . --total-bytes-sec-max-length . --read-bytes-sec-max-length . --write-bytes-sec-max-length . --total-iops-sec-max-length I/O . --read-iops-sec-max-length I/O . --write-iops-sec-max-length I/O . --size-iops-sec I/O . --group-name I/O . QEMU device . virsh (underscore) --total_bytes_sec. Bytes iops ( --read-bytes-sec) . 0 . total read write . (length) . QEMU I/O . 0 . --live . --config . --current --live --config . I/O --live --config --current . --live --config --current . ..SS domthrottlegroupset : domthrottlegroupset domain group-name [[--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] throttle group domain . group-name throttle group . : --total-bytes-sec . --read-bytes-sec . --write-bytes-sec . --total-iops-sec I/O . --read-iops-sec I/O . --write-iops-sec I/O . --total-bytes-sec-max . --read-bytes-sec-max . --write-bytes-sec-max . --total-iops-sec-max I/O . --read-iops-sec-max I/O . --write-iops-sec-max I/O . --total-bytes-sec-max-length . --read-bytes-sec-max-length . --write-bytes-sec-max-length . --total-iops-sec-max-length I/O . --read-iops-sec-max-length I/O . --write-iops-sec-max-length I/O . --size-iops-sec I/O . Bytes iops ( --read-bytes-sec) . 0 . . (length) . QEMU I/O . 0 . --live . --config . --current --live --config . io --live --config config --current . . domthrottlegroupdel : domthrottlegroupdel domain group-name [[--config] [--live] | [--current]] Throttlegroup group-name domain . Throttlegroup . group-name . --live . . --config . --current --live --config ..SS domthrottlegroupinfo : domthrottlegroupinfo domain group-name [[--config] [--live] | [--current]] Throttlegroup I/O. --live Throttlegroup . . --config Throttlegroup (persistent) . --current --live --config Throttlegroup . --live --config --config . domthrottlegrouplist : domthrottlegrouplist domain [--inactive] throttle groups domain. --inactive Throttlegroup . blkiotune : 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]] blkio. QEMU/KVM --weight . --weight [100, 1000] . 2.6.39 [10, 1000] . device-weights / /path/to/device,weight,/path/to/device,weight . [100, 1000] 2.6.39 [10, 1000] 0 . . device-read-iops-sec device/read_iops_sec /path/to/device,read_iops_sec,/path/to/device,read_iops_sec . read_iops_sec unsigned int 0 . read_iops_sec . device-write-iops-sec device/write_iops_sec /path/to/device,write_iops_sec,/path/to/device,write_iops_sec . write_iops_sec unsigned int 0 . write_iops_sec . device-read-bytes-sec device/read_bytes_sec /path/to/device,read_bytes_sec,/path/to/device,read_bytes_sec . read_bytes_sec unsigned long long 0 . read_bytes_sec . device-write-bytes-sec device/write_bytes_sec /path/to/device,write_bytes_sec,/path/to/device,write_bytes_sec . write_bytes_sec unsigned long long 0 . write_bytes_sec . --live . --config . --current --live --config . --live --config --current . ..SS blockcommit : blockcommit domain path [bandwidth] [--bytes] [base] [--shallow] [top] [--delete] [--keep-relative] [--wait [--async] [--verbose]] [--timeout seconds] [--active] [{--pivot | --keep-overlay}] (backing image chain) (commit) ( snapshot ) . (flatten) . base / top base --shallow . --delete . --keep-relative . top (active image) --active . top base (job) top base . top base blockjob --abort ( top ) --pivot ( base top) . blockjob . --wait ( --active ) timeout ( ) SIGINT ( Ctrl-C) (block) . --verbose --wait . --async . --pivot --active --wait blockjob --pivot --keep-overlay --active --wait blockjob --abort . path () () domain ( domblklist ). bandwidth MiB/s QEMU (online) . bandwidth blockjob . blockcopy : 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] [--dest-is-zero] [--print-xml] . dest --xml XML . dest format ( format libvirt --reuse-external (probe) ). --raw --format=raw . dest --blockdev . (flatten) --shallow . --reuse-external . --shallow --reuse-external . . . . (mirrored) blockjob --abort --pivot (pivot) --pivot . --wait (block) timeout SIGINT ( Ctrl-C) . --verbose --wait . --pivot ( blockjob --pivot) --finish ( blockjob --abort) --wait . --finish --async . path . bandwidth MiB/s . unsigned long long (overflow) 0 . bandwidth blockjob . granularity (dirty region) / (I/O) ( ) . buf-size (in-flight) ( ). --transient-job (VM) . (transient domains) . --synchronous-writes . blockjob . --dest-is-zero ( 0x00 ) . --print-xml XML ..SS blockjob : blockjob domain path { [--abort] [--async] [--pivot] | [--info] [--raw] [--bytes] | [bandwidth] } . : --info bandwidth --abort. --async --pivot abort --raw info --info . path () () domain ( domblklist ). --abort . --async . --pivot commit (pivot) . --info . . --raw . --bytes bytes/s MiB/s . bandwidth MiB/s . --bytes bytes/s . unsigned long . hypervisor . ( NOTES ). --bytes . --bytes MiB/s . --bytes hypervisor . blockjob pull-mode . blockpull : blockpull domain path [bandwidth] [--bytes] [base] [--wait [--verbose] [--timeout seconds] [--async]] [--keep-relative] (backing image chain) . (flatten) base (pull) . . blockjob . --wait timeout SIGINT ( Ctrl-C) . --verbose --wait . --async . --keep-relative . path () () domain ( domblklist ). bandwidth MiB/s . bandwidth blockjob ..SS blockresize : blockresize domain path ([size] | [--capacity]) [--extend] domain path () () domain ( domblklist ). --extend () . . (raw) ( ) --capacity . size ( NOTES ) KiB ( ) . "B" ( vol-resize ). console : console domain [devname] [--safe] [--force] [--resume] . devname . . --safe . . --force . --resume (resume). cpu-stats : cpu-stats domain [--total] [start] [count] (cpu) . . . --total start CPU start count count . create : create FILE [--console] [--paused] [--autodestroy] [--pass-fds N,M,...] [--validate] [--reset-nvram] XML. --validate XML RNG ( virt-xml-validate(1)). (transient) ( ) (persistent) XML ( XML ). . --paused . --console . --autodestroy virsh libvirt . --pass-fds (file descriptors) . . . --reset-nvram NVRAM/varstore . : 1. ( 3a ) # virsh dumpxml > domain.xml 2. : a. ! ( ) b. ! # $EDITOR domain.xml 3. domain.xml 2a 2b : a. (transient) b. # virsh create domain.xml : define FILE [--validate] XML. XML --validate RNG ( virt-xml-validate(1)). . . desc : desc domain [[--live] [--config] | [--current]] [--title] [--edit] [--new-desc New description or title message] . . . ( metadata XML .) --live --config . --live --config --config config . --current . --edit . --title . --edit --new-desc . destroy : destroy domain [--graceful] [--remove-logs] domain . . shutdown . . domain (snapshot) UUID snapshot-create . (checkpoint) checkpoint-create . --graceful ( SIGKILL) . --remove-logs domain . . QEMU virlogd QEMU . ..SS domblkerror : domblkerror domain . domstate I/O (pause) . domblkerror . domblkinfo : domblkinfo domain [block-device --all] [--human] . block-device () () domain ( domblklist ). --human . --all domain . --all . domblklist : domblklist domain [--inactive] [--details] domain. --inactive . --details . ( domblkinfo snapshot-create ) . domblkstat : domblkstat domain [block-device] [--human] . block-device () () domain ( domblklist ). LXC QEMU block-device . --human . . . libvirtd . ( ): o rd_req - o rd_bytes - o wr_req - o wr_bytes - o errs - o flush_operations - (flush) o rd_total_times - () o wr_total_times - () o flush_total_times - () o <-- --> : domblkthreshold domain dev threshold block-threshold. dev (backing chain) 'target[1]' . threshold . . domcontrol : domcontrol domain VMM . "ok" "error" . domdirtyrate-calc : domdirtyrate-calc [--seconds ] --mode=[page-sampling | dirty-bitmap | dirty-ring] (dirty rate) . seconds (dirty rate) 60s 1s . page-sampling, dirty-bitmap, dirty-ring page-sampling . 'domstats --dirtyrate' . domdisplay : domdisplay domain [--include-password] [[--type] type] [--all] URI VNC SPICE RDP . type ( "vnc" "spice" "rdp"). --include-password SPICE URI . --all . domdisplay-reload : domdisplay-reload [--type ] (reload) . TLS . type virDomainGraphicsReloadType . ( VNC)..SS domfsfreeze : domfsfreeze domain [[--mountpoint] mountpoint...] (freeze) . --mountpoint mountpoint . . . : snapshot-create --quiesce (thaw) . domfsfreeze libvirt . domfsinfo : domfsinfo domain . XML () . guest agent . domfsthaw : domfsthaw domain [[--mountpoint] mountpoint...] domfsfreeze (thaw). --mountpoint mountpoint . . . domfstrim : domfstrim domain [--minimum bytes] [--mountpoint mountPoint] fstrim . (discard). --minimum bytes . ( ). fstrim (fragmented) . " ". trim --mountpoint ..SS domhostname : domhostname domain [--source lease|agent] (hostname) . --source 'lease' DHCP 'agent' (agent). ( ). domid : domid domain-name-or-uuid ( UUID) (domain id). domif-getlink : domif-getlink domain interface-device [--config] (link state) . --config --persistent --config . interface-device MAC . domif-setlink : domif-setlink domain interface-device state [--config] [--print-xml] . state "up" "down". --config --persistent --config . interface-device MAC . --print-xml XML . domifaddr : domifaddr domain [interface] [--full] [--source lease|agent|arp] IP MAC interface . interface XML . QEMU (guest agent) . --full IP MAC MAC MAC MAC "-" . --source 'lease' DHCP 'agent' 'arp' IP arp . 'lease' ..SS backup-begin : backup-begin domain [backupxml] [checkpointxml] [--reuse-external] [--preserve-domain-on-shutdown] . backupxml push libvirt XML pull . backup-dumpxml libvirt . XML : --reuse-external libvirt backupxml . --preserve-domain-on-shutdown libvirt (terminate) . VIR_DOMAIN_PAUSED . (resume) . checkpointxml domaincheckpoint . checkpoint-create . push domjobinfo event ( pull export NBD ). domjobabort . backup-dumpxml : backup-dumpxml [--xpath EXPRESSION] [--wrap] domain XML . --xpath XPath XML . --wrap . domiflist : domiflist domain [--inactive] domain . --inactive . MAC ( detach-interface domif-setlink) MAC . domifstat : domifstat domain interface-device . . 'user' LAN NAT . interface-device MAC . ethernet RX/TX ..SS domiftune : domiftune domain interface-device [[--config] [--live] | [--current]] [*--inbound average,peak,burst,floor*] [*--outbound average,peak,burst*] (domain). interface-device () MAC . --inbound --outbound . . average,peak,burst,floor attach-interface . average peak floor (kiB) burst kiB (burst) peak Network XML . --inbound --outbound (average) . --live . --config . --current --live --config . --live --config --current () . . domifannounce domifannounce domain [interface-device] [parameters] ARP "gratuitous" () ( interface-device ARP ). (broadcast domain) . (migration) ( QEMU ) ( ) . : o --initial n () : 50 o --max n () : 550 o --rounds n : 5 o --step n () 50 : dominfo domain domain . domjobabort : domjobabort domain [--postcopy] (job) domain . post-copy domain . --postcopy domain ( --postcopy-resume migrate ). domjobinfo : domjobinfo domain [--completed [--keep-completed]] [--anystats] [--rawstats] domain . --completed virsh . ( --keep-completed ) libvirtd . . --anystats . --rawstats . "Job type:" API stats . ( NTP ). domlaunchsecinfo : domlaunchsecinfo domain (launch security) domain . . . domsetlaunchsecstate : domsetlaunchsecstate domain --secrethdr hdr-filename --secret secret-filename [--set-address address] (launch security secret) (guest) . launchSecurity paused . (running) . (destroy) . --secrethdr base64 . (firmware) . --secret base64 . --set-address . ..SS dommemstat : dommemstat domain [--period seconds] [[--config] [--live] | [--current]] . . . libvirtd . : o swap_in - swap ( KiB) o swap_out - swap ( KiB) o major_fault - (page faults) I/O o minor_fault - o unused - ( KiB) o available - ( KiB) o actual - balloon ( KiB) o rss - (RSS) ( KiB) o usable - balloon swap ( KiB) o last-update - ( ) o disk_caches - I/O ( KiB) o hugetlb_pgalloc - huge page o hugetlb_pgfail - huge page QEMU/KVM balloon --period ( ) balloon dommemstat . --period balloon . 1.5 QEMU/KVM . --live --config --current --period balloon . --live . --config (persistent) . --current --live --config . --live --config --current () . . domname : domname domain-id-or-uuid ( UUID) .SS dompmsuspend : dompmsuspend domain target [--duration] ( target): o mem - S3 ACPI o disk - S4 ACPI o hybrid - RAM --duration ( dompmwakeup ). 0 . ( 0 ). guest agent (guest OS) . QEMU disk libvirt . (device hotplug) --config . dompmwakeup : dompmwakeup domain pmsuspended ( dompmsuspend ). ( ) pmsuspended . . domrename : domrename domain new-name . . : . domstate : domstate domain [--reason] . --reason virsh ..SS domstats : 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 ...] . . --list-NNN . ( .) . --raw . . . : --state --cpu-total --balloon --vcpu --interface --block --perf --iothread --memory --dirtyrate --vm. - - . --state : o state.state - virDomainState o state.reason - int virDomain*Reason --cpu-total : o cpu.time - o cpu.user - o cpu.system - o cpu.haltpoll.success.time - o cpu.haltpoll.fail.time - o cpu.cache.monitor.count - o cpu.cache.monitor..name - o cpu.cache.monitor..vcpus - vcpu o cpu.cache.monitor..bank.count - o cpu.cache.monitor..bank..id - o cpu.cache.monitor..bank..bytes - --balloon : o balloon.current - KiB o balloon.maximum - KiB o balloon.swap_in - swap ( KiB) o balloon.swap_out - swap ( KiB) o balloon.major_fault - / o balloon.minor_fault - o balloon.unused - ( KiB) o balloon.available - ( KiB) o balloon.rss - Resident Set Size ( KiB) o balloon.usable - balloon swap ( KiB) o balloon.last-update - ( ) o balloon.disk_caches - / ( KiB) o balloon.hugetlb_pgalloc - virtio balloon o balloon.hugetlb_pgfail - virtio balloon --vcpu : o vcpu.current - o vcpu.maximum - o vcpu..state - virVcpuState o vcpu..time - ( ) o vcpu..wait - vCPU ( ) CONFIG_SCHED_INFO o vcpu..halted - : yes no ( ) o vcpu..delay - vCPU ( ). steal time . vCPU . : vcpu..$NAME.$TYPE $NAME $TYPE . : cur sum max unsigned long long boolean . . --vm . --interface : net.count - o net..name - o net..rx.bytes - o net..rx.pkts - o net..rx.errs - o net..rx.drop - o net..tx.bytes - o net..tx.pkts - o net..tx.errs - o net..tx.drop - --perf perf : o perf.cmt - o perf.mbmt - o perf.mbml - o perf.cpu_cycles - cpu (/) o perf.instructions - o perf.cache_references - (cache hits) o perf.cache_misses - (cache misses) o perf.branch_instructions - (branch) o perf.branch_misses - (branch misses) o perf.bus_cycles - (bus) o perf.stalled_cycles_frontend - (frontend) o perf.stalled_cycles_backend - (backend) o perf.ref_cpu_cycles - cpu o perf.cpu_clock - cpu o perf.task_clock - (task clock) o perf.page_faults - (page faults) o perf.context_switches - (context switches) o perf.cpu_migrations - cpu o perf.page_faults_min - (minor page faults) o perf.page_faults_maj - (major page faults) o perf.alignment_faults - (alignment faults) o perf.emulation_faults - (emulation faults) perf . --block . --backing (backing chain) . : o block.count - o block..name - ( --backing ) o block..backingIndex - --backing XML o block..path - o block..rd.reqs - o block..rd.bytes - o block..rd.times - () o block..wr.reqs - o block..wr.bytes - o block..wr.times - () o block..fl.reqs - (flush) o block..fl.times - () o block..errors - Xen: 'oo_req' o block..allocation - (sector) o block..capacity - o block..physical - o block..threshold - ( ) VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD. domblkthreshold . o block..limits.request_alignment - o block..limits.discard_max - (discard) o block..limits.discard_alignment - discard o block..limits.write_zeroes_max - o block..limits.write_zeroes_alignment - write_zeroes o block..limits.transfer_optimal - o block..limits.transfer_max - o block..limits.transfer_hw_max - IO o block..limits.iov_max - scatter/gather o block..limits.iov_hw_max - scatter/gather IO o block..limits.memory_alignment_minimal - (bounce buffer) o block..limits.memory_alignment_optimal - o block..timed_group.count - o block..timed_group..interval_length - . o block..timed_group..rd_latency_min - o block..timed_group..rd_latency_max - o block..timed_group..rd_latency_avg - o block..timed_group..wr_latency_min - o block..timed_group..wr_latency_max - o block..timed_group..wr_latency_avg - o block..timed_group..zone_append_latency_min - zone append o block..timed_group..zone_append_latency_max - zone append .IP o 2 block..timed_group..zone_append_latency_avg - zone append o block..timed_group..flush_latency_min - flush o block..timed_group..flush_latency_max - flush o block..timed_group..flush_latency_avg - flush o block..timed_group..rd_queue_depth_avg - o block..timed_group..wr_queue_depth_avg - o block..timed_group..zone_append_queue_depth_avg - zone append o block..latency_histogram..bin.count - (bins) . read write zone_append flush o block..latency_histogram..bin..start (bin) o block..latency_histogram..bin..value --iothread hypervisor IOThreads . "poll-max-ns" polling . polling (CPU quantum) . IOThread CPU . CPU IOThread CPU . polling . o iothread.count - IOThreads unsigned int. IOThread iothread_id . polling iothread.count . o iothread..poll-max-ns - polling IOThread . 0 () polling . o iothread..poll-grow - polling. 0 () hypervisor . o iothread..poll-shrink - polling. 0 () hypervisor . o iothread..poll-weight - polling. 0 () hypervisor . --memory : o memory.bandwidth.monitor.count - o memory.bandwidth.monitor..name - o memory.bandwidth.monitor..vcpus - vcpu o memory.bandwidth.monitor..node.count - o memory.bandwidth.monitor..node..id - o memory.bandwidth.monitor..node..bytes.local - @vcpus CPU . o memory.bandwidth.monitor..node..bytes.total - @vcpus . --dirtyrate : o dirtyrate.calc_status - virDomainDirtyRateStatus. o dirtyrate.calc_start_time - . o dirtyrate.calc_period - . o dirtyrate.megabytes_per_second - MiB/s. o dirtyrate.calc_mode - (page-sampling/dirty-bitmap/dirty-ring) o dirtyrate.vcpu..megabytes_per_second - MiB/s --vm : --vm hypervisor . hypervisor . : vm.$NAME.$TYPE $NAME hypervisor $TYPE . : cur sum () max () unsigned long long boolean . : hypervisor API libvirt . libvirt hypervisor . . . --enforce . libvirtd . . --nowait . ..SS domtime : domtime domain { [--now] [--pretty] [--sync] [--time time] } . ( domain) . --pretty . --time time . --now --time $now virsh . ( ) Epoch 1970-01-01 UTC . --sync : RTC . guest agent . domuuid : domuuid domain-name-or-id UUID . domxml-from-native : domxml-from-native format config config format XML . QEMU/KVM format qemu-argv . Xen format xen-xm xen-xl xen-sxpr . LXC format lxc-tools . VMware/ESX format vmware-vmx . Bhyve format bhyve-argv . domxml-to-native : domxml-to-native format { [--xml] xml | --domain domain-name-or-id-or-uuid } xml XML --domain format. xml --domain . format domxml-from-native . dump : dump domain corefilepath [--bypass-cache] { [--live] | [--crash] | [--reset] } [--verbose] [--memory-only] [--format string] (core dump) . --live . --crash (crashed) . --reset . . --bypass-cache . --memory-only elf cpu . . --format string 'memory-only' string : elf kdump-zlib ( kdump zlib) kdump-lzo ( kdump lzo) kdump-snappy ( kdump snappy) win-dmp ( crashdump ). virsh domjobinfo domjobabort ( virsh) . SIGINT ( Ctrl-C) virsh dump . --verbose . : corefilepath . : (Crash dump) kvmdump 6.1.0 crash . --memory-only ELF crash ..SS dumpxml : dumpxml [--inactive] [--security-info] [--update-cpu] [--migratable] [--xpath EXPRESSION] [--wrap] domain XML (stdout) create . XML . --inactive virsh . --security-info XML . --update-cpu . --migratable XML libvirt . (--update-cpu --security-info ...) . --xpath XPath XML . --wrap . edit : edit domain XML . : virsh dumpxml --inactive --security-info domain > domain.xml vi domain.xml (or make changes with your other text editor) virsh define domain.xml . $VISUAL $EDITOR vi . emulatorpin : emulatorpin domain [cpulist] [[--live] [--config] | [--current]] . cpulist vcpupin . --live . --config . --current --live --config . cpulist --live --config --current . ..SS event : event {[domain] { event | --all } [--loop] [--timeout seconds] [--timestamp] | --list} . domain . --list event . event --all . (one-shot) SIGINT ( Ctrl-C) . --timeout seconds . --loop . --timestamp . await : await --condition [--timeout seconds] --condition . . : domain-inactive guest-agent-available (guest agent) ( ) --timeout seconds . SIGINT virsh ( Ctrl-C) . (non-interactive) virsh '1' '2' . get-user-sshkeys : get-user-sshkeys domain user SSH (authorized keys) user domain . sshd(8) virsh/libvirt (opaque strings) ..SS guest-agent-timeout : guest-agent-timeout domain [--timeout value] guest agent. (block) . value ( ) : o -2 - ( --timeout ) o -1 - (timeout) ( libvirt ) o 0 - API guest-agent (timeout) guest agent VIR_ERR_AGENT_COMMAND_TIMEOUT . guestinfo : guestinfo domain [--user] [--os] [--timezone] [--hostname] [--filesystem] [--disk] [--interface] [--devices] guest agent. guest agent . guest agent . . . --user --os --timezone --hostname --filesystem --disk --interface --load --devices. guest agent 1 . guest agent . --user : o user.count - domain o user..name - o user..domain - ( ) o user..login-time - (epoch) --os : o os.id - o os.name - o os.pretty-name - o os.version - o os.version-id - o os.kernel-release - o os.kernel-version - o os.machine - o os.variant - o os.variant-id - --timezone : o timezone.name - o timezone.offset - UTC --hostname : o hostname - (hostname) --filesystem : o fs.count - domain o fs..mountpoint - (mount point) o fs..name - ( sda1) o fs..fstype - o fs..total-bytes - o fs..used-bytes - o fs..disk.count - o fs..disk..alias - ( sda) o fs..disk..serial - o fs..disk..device - (device node) --disk : o disk.count - domain o disk..name - (Linux) UNC (Windows) o disk..partition - o disk..dependency.count - o disk..dependency..name - o disk..serial - o disk..alias - ( sda) o disk..guest_alias - o disk..guest_bus - (bus) --interface : * if.count - domain * if..name - ( eth0) * if..hwaddr - * if..addr.count - IP * if..addr..type - IP addr ( ipv4) * if..addr..addr - IP addr * if..addr..prefix - IP addr --load : * load.1m - * load.5m - * load.15m - --devices : * device.count - * device..driverName - * device..driverDate - (epoch) * device..driverVersion - * device..idType - ( pci) * device..pciVendor - (vendor ID) PCI ( ) * device..pciDevice - (device ID) PCI ( ).SS guestvcpus : guestvcpus domain [[--enable] | [--disable]] [cpulist] vCPU guest agent. cpulist vCPU (offline) . cpulist --enable --disable . domain . cpulist vcpupin . iothreadadd : iothreadadd domain iothread_id [[--config] [--live] | [--current]] IOThread domain iothread_id . iothread_id . iothread_id . --live . . --config (persistent) . --current --live --config . iothreaddel : iothreaddel domain iothread_id [[--config] [--live] | [--current]] IOThread domain iothread_id . IOThread ( attach-disk) IOThread . iothread_id . --live . . --config (persistent) . --current --live --config . iothreadinfo : iothreadinfo domain [[--live] [--config] | [--current]] IOThread domain IOThread CPU Affinity IOThread. --live IOThread . . --config IOThread (persistent) . --current --live --config IOThread (live) (offline) ..SS iothreadpin : iothreadpin domain iothread cpulist [[--live] [--config] | [--current]] IOThread . IOThread iothreadinfo . iothread (cpulist) IOThread iothreadinfo . cpulist . '-' '^' ( '0-4' '0-3,^2') . '-' '^' . iothreadpin iothread 'r' cpulist . --live . . --config . --current --live --config . cpulist --live --config --current . (hypervisor) . : "0-15,^8" "9-14,0-7,15" "^8,0-15" . iothreadset : iothreadset domain iothread_id [[--poll-max-ns ns] [--poll-grow factor] [--poll-shrink divisor] [--poll-weight factor] [--thread-pool-min value] [--thread-pool-max value]] [[--config] [--live] | [--current]] iothread iothread_id . --poll-max-ns (polling) IOThread . 0 () IOThread . --poll-grow . 0 () . --poll-shrink . 0 () . --poll-weight . . [0, 63] . . . . --thread-pool-min --thread-pool-max (worker pool) iothread . -1 . (--thread-pool-max) (--thread-pool-min) . . --live . . --current --live --live . ( "current" : .).SS managedsave : managedsave domain [--bypass-cache] [{--running | --paused}] [--verbose] (stop) . start virsh . --bypass-cache () . virsh domjobinfo domjobabort ( virsh) . SIGINT ( Ctrl-C) virsh managedsave . --verbose . (managed save) (running) (paused) --running --paused start . dominfo . managedsave-define : managedsave-define domain xml [{--running | --paused}] XML domain . xml XML XML . . . --running --paused start . managedsave-dumpxml : managedsave-dumpxml [--security-info] [--xpath EXPRESSION] [--wrap] domain XML managedsave . --security-info . --xpath XPath XML . --wrap . managedsave-edit : managedsave-edit domain [{--running | --paused}] XML domain managedsave . . --running --paused restore . : 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 . $VISUAL $EDITOR vi ..SS managedsave-remove : managedsave-remove domain managedsave . . maxvcpus : maxvcpus [type] (vCPU) . type type XML . memtune : memtune domain [--hard-limit size] [--soft-limit size] [--swap-hard-limit size] [--min-guarantee size] [[--config] [--live] | [--current]] . . LXC QEMU/KVM --hard-limit --soft-limit --swap-hard-limit . --min-guarantee ESX . ( NOTES ) ( 1024 ) . (Libvirt) . KiB . vSphere/ESX (1024 ) . --live . --config (persistent) . --current --live --config . --live --config --current () . . QEMU/KVM QEMU . RAM RAM QEMU . . LXC hard_limit XML virsh setmem . o --hard-limit . o --soft-limit (contention) . o --swap-hard-limit swap . hard-limit . o --min-guarantee . -1 ..SS metadata Syntax: metadata domain [[--live] [--config] | [--current]] [--edit] [uri] [key] [set] [--remove] XML . XML XML . XML . (namespace) XML uri . ( desc .) --live --config . --live --config --config (config) . --current . --remove uri . --edit uri . set . --edit set key . --edit set XML uri . migrate Syntax: 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] [--migrate-disks-target-zero 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] [--available-switchover-bandwidth bandwidth] . --live <--p2p> --direct --tunnelled . --offline . --persistent . --persistent ( --xml ) --undefinesource (undefine) --suspend . --copy-storage-all --copy-storage-inc ( ). --copy-storage-... libvirt . . --migrate-disks disk-list . --migrate-disks-detect-zeroes . ( 'discard' 'unmap' ) CPU (sparse) . --migrate-disks-target-zero (hypervisor) . --copy-storage-synchronous-writes (burst performance) . --change-protection . --verbose . --abort-on-error / ( I/O) . --postcopy (post-copy) post-copy (pre-copy) . migrate-postcopy virsh post-copy --postcopy-after-precopy --postcopy libvirt pre-copy post-copy . post-copy --postcopy-bandwidth . pre-copy --bandwidth . post-copy migrate . migrate --postcopy-resume . --auto-converge . CPU auto-converge-initial . auto-converge-increment . --rdma-pin-all RDMA ( migrateuri rdma:// ) ( ) . QEMU/KVM hard_limit ( XML ) QEMU . ( ) . . --zerocopy (zero-copy) . QEMU/KVM QEMU . : . QEMU . libvirt . QEMU "none" . (coherent clustered filesystem) GFS2 GPFS . --unsafe . dname . --xml file XML XML . --xml --persistent XML --persistent-xml ( ) XML --file . --persistent --persistent-xml file XML . --timeout seconds virsh . --live . --timeout-suspend --timeout-\`` . *--timeout-postcopy virsh pre-copy post-copy --postcopy ..sp --compressed --comp-methods . "mt" "xbzrle" "zlib" "zstd". . QEMU --parallel "zlib" "zstd" . . QEMU --parallel "xbzrle" . --parallel QEMU --comp-method . . --comp-mt-level "mt" . . --comp-mt-threads --comp-mt-dthreads . --comp-xbzrle-cache page cache . --comp-zlib-level "zlib" . . --comp-zstd-level "zstd" . . --tls TLS ( migrate_tls_x509_cert_dir /etc/libvirt/qemu.conf ). TLS . TLS TLS . hostname hostname --tls-destination hostname . --parallel . --parallel-connections . . virsh ( Ctrl-C) domjobabort virsh . desturi migrateuri . desturi (managed) (direct) migrateuri . : desturi peer2peer : o : desturi . o peer2peer: desturi . / libvirt UNIX URI qemu : qemu+unix:///system?socket=/path/to/socket migrateuri libvirt URI . QEMU "migration_host" ( ). libvirt hostname . migrateuri : o (hostname) DNS . hostname IP libvirt URI . migrateuri IP hostname . o . . migrateuri IP . o . libvirt URI . . migrateuri . o desturi UNIX . libvirt migrateuri URI UNIX : unix:///path/to/socket URI . graphicsuri . libvirt IP . graphicsuri . URI : protocol://hostname[:port]/[?parameters] protocol "spice" "vnc" parameters '&' . "tlsPort" "tlsSubject" . spice://target.host.com:1234/?tlsPort=4567 listen-address (bind) . IPv4 IPv6 ( ) . . desturi UNIX . disks-port bind . QEMU . disks-uri ( disks-port ) bind/connect . tcp://address:port ( --migrate-uri --listen-address ) unix:///path/to/socket UNIX . ( ) . SELinux ( ) libvirtd/QEMU . Libvirt (context) context ( setsockcreatecon{,_raw}()) . --available-switchover-bandwidth ( MiB/s) (pre-copy) . (downtime) . . downtime ..SS migrate-compcache : migrate-compcache domain [--size bytes] () ( ) / . size . size hypervisor size ( hypervisor ). size (compression cache misses) domjobinfo . migrate-getmaxdowntime : migrate-getmaxdowntime domain (downtime) . . migrate-getspeed : migrate-getspeed domain [--postcopy] ( MiB/s) . --postcopy post-copy . migrate-postcopy : migrate-postcopy domain pre-copy post-copy . --postcopy . migrate-setmaxdowntime : migrate-setmaxdowntime domain downtime (downtime) . downtime ..SS migrate-setspeed : migrate-setspeed domain bandwidth [--postcopy] ( MiB/s) . bandwidth unsigned long long . . . --postcopy (post-copy) . numatune : numatune domain [--mode mode] [--nodeset nodeset] [[--config] [--live] | [--current]] numa XML . . mode `strict' `interleave' `preferred' 'restrictive' virDomainNumatuneMemMode . mode nodeset `restrictive' . nodeset numa . '-' '^' . --live . --config . --current --live --config . numa nodeset . nodeset . VFIO nodeset nodeset . perf : perf domain [--enable eventSpec] [--disable eventSpec] [[--config] [--live] | [--current]] perf / perf . Perf CPU (tracepoints) (kprobes) (uprobes - ) . Perf . context-switches minor-faults . perf . QEMU/KVM . --enable --disable eventSpec . eventSpec . : perf o cmt - PQos ( ) (cache) . o mbmt - . o mbml - ( ) . o cache_misses - (cache misses) . o cache_references - (cache hits) . o instructions - . o cpu_cycles - cpu (/) . instructions . o branch_instructions - () . o branch_misses - . o bus_cycles - (bus) . o stalled_cycles_frontend - cpu . o stalled_cycles_backend - cpu . o ref_cpu_cycles - cpu (CPU frequency scaling) . o cpu_clock - cpu . o task_clock - (task clock) . o page_faults - (page faults) . o context_switches - (context switches) . o cpu_migrations - cpu . o page_faults_min - (minor page faults) . o page_faults_maj - (major page faults) . o alignment_faults - (alignment faults) . o emulation_faults - (emulation faults) . : domstats --perf . --live . --config . --current --live --config . --live --config --current . ..SS reboot : reboot domain [--mode MODE-LIST] (reboot) . reboot . . on_reboot XML . . --mode acpi agent initctl signal paravirt . virsh . . reset : reset domain . reset (power reset) RST . : . restore : restore state-file [--bypass-cache] [--xml file] [{--running | --paused}] [--reset-nvram] [--parallel-channels] virsh save. save . --bypass-cache (cache) . . --xml file XML XML . . (running) (paused) --running --paused (override) . --reset-nvram NVRAM/varstore . --parallel-channels I/O . . : restore (storage volumes) ..SS resume : resume domain . . save : save domain state-file [--bypass-cache] [--xml file] [--image-format format] [--parallel-channels channels] [{--running | --paused}] [--verbose] ( RAM ) . . virsh restore . --bypass-cache . . virsh domjobinfo domjobabort ( virsh) . SIGINT ( Ctrl-C) virsh save . --verbose . (hibernate) . TCP . --xml file XML XML . . --running --paused restore . --image-format . qemu.conf . --parallel-channels IO . IO sparse . . . snapshot . save-image-define : save-image-define file xml [{--running | --paused}] XML file restore . xml XML XML . . . --running --paused restore ..SS save-image-dumpxml : save-image-dumpxml [--security-info] [--xpath EXPRESSION] [--wrap] file XML file save . --security-info . --xpath XPath XML . --wrap . save-image-edit : save-image-edit file [{--running | --paused}] XML file save. (running) (paused) . --running --paused restore . : 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 . $VISUAL $EDITOR vi . schedinfo : schedinfo domain [[--config] [--live] | [--current]] [[--set] parameter=value]... schedinfo [--weight number] [--cap number] domain ( ) . : LXC ( posix): cpu_shares, vcpu_period, vcpu_quota QEMU/KVM ( posix): cpu_shares, vcpu_period, vcpu_quota, emulator_period, emulator_quota, global_period, global_quota, iothread_period, iothread_quota Xen ( credit): weight, cap ESX ( allocation): reservation, limit, shares --live . --config . --current --live --config . : cpu_shares cgroups v1 2-262144 cgroups v2 1-10000 . : weight cap XEN_CREDIT . : vcpu_period emulator_period iothread_period 1000-1000000 0 vcpu_quota emulator_quota iothread_quota 1000-17592186044415 0 . 0 ..SS screenshot : screenshot domain [imagefilepath] [--screen screenID] . screenID . . (heads) . send-key : send-key domain [--codeset codeset] [--holdtime holdtime] keycode... keycode domain . keycode codeset . --holdtime . (codeset) linux --codeset codeset . keycode . send-key . o linux . . virkeycode-linux(7) virkeyname-linux(7) o xt XT . virkeycode-xt(7) o atset1 AT ( XT) . atset1 codeset xt . virkeycode-atset1(7) o atset2 AT . virkeycode-atset2(7) o atset3 AT ( PS/2) . virkeycode-atset3(7) o os_x macOS . macOS virkeycode-osx(7) virkeyname-osx(7) o xt_kbd KBD . codeset XT . . virkeycode-xtkbd(7) o win32 Win32 . Win32 virkeycode-win32(7) virkeyname-win32(7) o usb USB HID . virkeycode-usb(7) o qnum QNUM . codeset XT . . virkeycode-qnum(7) : # 'k' 'e' 'y' codeset xt. # # virsh send-key dom --codeset xt 37 18 21 # 'right-ctrl+C' virsh send-key dom KEY_RIGHTCTRL KEY_C # tab virsh send-key --holdtime 1000 0xf : send-process-signal domain-id pid signame signame pid domain-id . pid (namespace) . signame : "nop", "hup", "int", "quit", "ill", "trap", "abrt", "bus", "fpe", "kill", "usr1", "segv", "usr2", "pipe", "alrm", "term", "stkflt", "chld", "cont", "stop", "tstp", "ttin", "ttou", "urg", "xcpu", "xfsz", "vtalrm", "prof", "winch", "poll", "pwr", "sys", "rt0", "rt1", "rt2", "rt3", "rt4", "rt5", "rt6", "rt7", "rt8", "rt9", "rt10", "rt11", "rt12", "rt13", "rt14", "rt15", "rt16", "rt17", "rt18", "rt19", "rt20", "rt21", "rt22", "rt23", "rt24", "rt25", "rt26", "rt27", "rt28", "rt29", "rt30", "rt31", "rt32" sig sig_ . : 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 set-lifecycle-action : set-lifecycle-action domain type action [[--config] [--live] | [--current]] (action) (type) . "poweroff" "reboot" "crash" action "destroy" "restart" "rename-restart" "preserve" . type "crash" "coredump-destroy" "coredump-restart" . set-user-password : set-user-password domain user password [--encrypted] user . --encrypted . QEMU/KVM (guest agent) ..SS set-user-sshkeys : set-user-sshkeys domain user [--file FILE] [{--reset | --remove}] FILE SSH user (domain) . FILE sshd(8) . --reset . --reset FILE . --remove FILE . . setmaxmem : setmaxmem domain size [[--config] [--live] | [--current]] . --live . --config . --current --live --config . --live --config --current . . QEMU/KVM ( ) . / ( NUMA QEMU). edit . size ( NOTES ) ( ) ( --kilobytes ). Libvirt . (granularity) KiB . vSphere/ESX ( ) . setmem : setmem domain size [[--config] [--live] | [--current]] . --live (memory ballooning) . --config . --current --live --config . --live --config --current . . size ( NOTES ) ( ) ( --kilobytes ). Libvirt . KiB . vSphere/ESX ( ) . Xen (paravirtualized) PV . LXC cgroups limit_in_bytes ( ) . "MemTotal" /proc/meminfo . virsh memtune . virsh dominfo ..SS setvcpus : setvcpus domain count [--maximum] [[--config] [--live] | [--current]] [--guest] [--hotpluggable] [--async] (vCPU) . . --config . count . Xen (paravirtualized) . --config XML . --live . --config --live . ( ) . --current --live --config . --live . --config XML . --async vCPU . vcpu-removed device-removal-failed . --guest . --guest . (guest agent) . vCPU (hotunplug) --hotpluggable . vCPU vCPU hotpluggable . --maximum (hot-plug) . --config --live --current. vCPU . setvcpu : setvcpu domain vcpulist [--enable] | [--disable] [--async] [[--live] [--config] | [--current]] vCPU / (hot(un)plug). vcpulist vcpupin . vcpulist vCPU (hotpluggable) . vCPU ppc64 . vCPU vcpu 0 . --live . --config . --current --live --config . . --live --config --current () . --async --disable vCPU . vcpu-removed device-removal-failed ..SS shutdown : shutdown domain [--mode MODE-LIST] . . on_poweroff XML . domain (transient) UUID snapshot-create checkpoint-create . . --mode acpi agent initctl signal paravirt . virsh . . start : start domain-name-or-uuid [--console] [--paused] [--autodestroy] [--bypass-cache] [--force-boot] [--pass-fds N,M,...] [--reset-nvram] ( ) managedsave . --paused (paused) . --console . --autodestroy virsh libvirt (destroyed) . --bypass-cache managedsave (cache) . --force-boot managedsave . --pass-fds . . . --reset-nvram NVRAM/varstore . suspend : suspend domain . ..SS ttyconsole : ttyconsole domain TTY . 1 . undefine : 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] (undefine). (transient) . . --managed-save ( managedsave ) . . --snapshots-metadata ( snapshot-list ) . . . --checkpoints-metadata ( checkpoint-list ) . . . --nvram --keep-nvram NVRAM (/domain/os/nvram/) varstore (/domain/os/varstore) . NVRAM/varstore (undefine) . --storage volumes (volume target names) . . . . libvirt . (backing chain) (backing store) . ( domblklist ). : --storage vda,/path/to/storage.img --remove-all-storage --storage . --delete-storage-volume-snapshots ( --delete-snapshots) . --remove-all-storage . rbd . . --wipe-storage (wipe) . --tpm --keep-tpm (persistent state) TPM . persistent_state TPM XML TPM . : UUID domain ..SS vcpucount : vcpucount domain [{--maximum | --active} {--config | --live | --current}] [--guest] CPU (vCPU) domain . . "current" --active --current. --maximum vCPU setvcpus --active . --config (persistent) --live --current ( --live --config ) . --guest . guest agent . vcpuinfo : vcpuinfo domain [--pretty] vCPU (affinity) . --pretty . : $ 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 State o offline . . o running . o blocked . running . o no state . virsh . o N/A . . : vcpupin domain [vcpu] [cpulist] [[--live] [--config] | [--current]] (pinning) (VCPU) CPU . vcpu cpulist vcpu vcpu . cpulist CPU . '-' '^' ( '0-4' '0-3,^2') . '-' '^' . vcpu CPU 'r' cpulist . --live . --config . --current --live --config . cpulist --live --config --current . hypervisor . : "0-15,^8" "9-14,0-7,15" "^8,0-15" . vncdisplay : vncdisplay domain IP (port) VNC . . (DEVICE COMMANDS) . domain UUID . . attach-device : attach-device domain FILE [[[--live] [--config] | [--current]] | [--persistent]] XML (top-level) . XML (libvirt) https://libvirt.org/formatdomain.html#elementsDevices . --config libvirt . cdrom floppy update-device . (passthrough host devices) nodedev-detach PCI (managed mode) . --live . --config . --current --live --config . --live --config --current . API (legacy) hypervisor . --persistent --config --live --config . : XML ..SS attach-disk : 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] [--throttle-groups groups] . source --source-protocol source . target . "" targetbus ide scsi virtio xen usb sata sd ( 'sda' SCSI ). driver Xen file tap phy QEMU qemu . subdriver . Xen subdriver aio QEMU subdriver raw qcow2 . subdriver . QEMU . type lun cdrom floppy cdrom floppy update-device . alias . mode readonly shareable . sourcetype (block|file|network). cache "default" "none" "writethrough" "writeback" "directsync" "unsafe" . io / (I/O) QEMU "threads" "native" "io_uring" . iothread IOThread ( QEMU). serial . wwn wwn . rawio rawio . address pci:domain.bus.slot.function scsi:controller.bus.unit ide:controller.bus.unit usb:bus.port sata:controller.bus.unit ccw:cssid.ssid.devno . virtio-ccw cssid 0xfe . multifunction pci pci . throttle-groups (throttle groups) . . --source-protocol source . --source-protocol . --source-host-name --source-host-transport --source-host-socket . --source-host-socket --source-host-name --source-host-socket --source-host-transport . --source-host-name host:port . --print-xml XML . --live . --config . --current --live --config . --live --config --current . API . --persistent () --config --live --config . --shareable --mode shareable ..SS attach-interface : 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] (domain) . type : network libvirt bridge (bridge) direct hostdev (passthrough) PCI vhostuser virtio. source . : network bridge direct hostdev PCI domain:bus:slot.function. vhostuser UNIX ( ) --target tap/macvtap . 'vnet' - . --mac MAC MAC ( "--config" ). --script - . bridge Xen . --model . alias . --inbound --outbound . average floor . peak burst "average,peak" "average,,burst" "average,,,floor" "average" ",,,floor" . average floor peak (kiB) burst kiB peak Network XML . --managed hostdev libvirt / libvirt . --source-mode vhostuser server client . --print-xml XML . --live . --config . --current ( ) . --live --config --current . API . --persistent --config --live --config . : target (back-end) . "vnetN" "vifN" ..SS detach-device : detach-device domain FILE [[[--live] [--config] | [--current]] | [--persistent]] XML attach-device . (passthrough) nodedev-reattach (managed mode) . : XML XML . . XML . : (unplug) (asynchronous) . . API libvirt (timeout) . libvirt ( virsh event ) . . --live . --config . --current --live --config . --live --config --current . API () . --persistent --config --live --config . virsh --config --persistent . detach-device-alias : detach-device-alias domain alias [[[--live] [--config] | [--current]]]] alias domain . . libvirt ( virsh event ). --live . --config . --current --live --config . --live --config --current . detach-disk : detach-disk domain target [[[--live] [--config] | [--current]] | [--persistent]] [--print-xml] . target . --live . --config . --current --live --config . --live --config --current . API () . --persistent --config --live --config . virsh --config --persistent . --print-xml XML . detach-device ..SS detach-interface : detach-interface domain [type] [--mac mac] [[[--live] [--config] | [--current]] | [--persistent]] [--print-xml] domain . type / --mac . type network bridge . --mac MAC . --live domain . --config . --current --live --config . --live --config --current . API hypervisor . --persistent domain --config domain --live --config . virsh --config --persistent . --print-xml XML . detach-device . update-device : update-device domain file [--force] [[[--live] [--config] | [--current]] | [--persistent]] domain file XML . --force CD-ROM domain (mounted) . XML libvirt https://libvirt.org/formatdomain.html#elementsDevices . --live domain . --config . --current --live --config . --live --config --current . --current . --persistent domain --config domain --live --config . virsh --config --persistent . : XML . update-memory-device : update-memory-device domain [--print-xml] [[--alias alias] | [--node node]] [[--live] [--config] | [--current]] [--requested-size size] domain XML daemon . --print-xml XML stdout . domain --alias --node . --live domain . --config . --current --live --config . --live --config --current . --current . --requested-size size ( NOTES ). kibibytes . virtio-mem ..SS change-media : change-media domain path [--eject] [--insert] [--update] [source] [--force] [[--live] [--config] | [--current]] [--print-xml] [--block] CDROM . path () . source . --block (backing type) CDROM . --eject . --insert . source . ( ) source --update --eject . source --update --insert . source --update --eject --insert . --eject --insert --update --update . --force . --live . --config . --current hypervisor live config . --live --config --current . hypervisor . --print-xml XML . dom-fd-associate : dom-fd-associate domain --name FDGROUPNAME --pass-fds M,N,.... [--seclabel-writable] [--seclabel-restore] (fd) --pass-fds --name domain . fd virsh . . --seclabel-restore (best-effort) . NODEDEV (NODEDEV COMMANDS) (passthrough ). (bus) pci_0000_00_02_1 usb_1_5_3 net_eth1_00_27_13_6a_fe_00. nodedev-list libvirt ( PCI ). : . (passthrough) . PCI managed='yes' hypervisor (managed) nodedev-detach ( hot-plug) nodedev-reattach ( hot-unplug) . PCI (detach) (reattach) . ..SS nodedev-create : nodedev-create FILE [--validate] . libvirt libvirt . file xml . --validate XML RNG . nodedev-update : nodedev-update device FILE [[--live] [--config] | [--current]] . device wwn "wwnn,wwpn" ( vHBA ). file xml . --current live config . --live --config --current . . nodedev-destroy : nodedev-destroy device ( ) . device wwn "wwnn,wwpn" ( vHBA ). libvirt (reboot) . nodedev-define : nodedev-define FILE [--validate] FILE XML. --validate XML RNG . nodedev-undefine : nodedev-undefine device . (transient) ..SS nodedev-start : nodedev-start device ( ) . nodedev-detach : nodedev-detach nodedev [--driver backend_driver] nodedev API ( XML ) . nodedev-reattach ( "managed='yes'" XML ) . . "vfio" QEMU "vfio-pci" " VFIO" ( API vfio-pci API ). --driver ( VFIO ) . --driver ("vfio-pci" QEMU "pciback" Xen). nodedev-dumpxml : nodedev-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] device XML libvirt ( ). device wwn "wwnn,wwpn" ( HBA ). XML . --inactive virsh . --xpath XPath XML . --wrap . nodedev-info : nodedev-info device device ..SS nodedev-list : nodedev-list [--cap capability] [--tree] [--inactive | --all] [--persistent | --transient] libvirt . cap --cap pci,scsi. : 'system' 'pci' 'usb_device' 'usb' 'net' 'scsi_host' 'scsi_target' 'scsi' 'storage' 'fc_host' 'vports' 'scsi_generic' 'drm' 'mdev' 'mdev_types' 'ccw' 'ccwgroup' 'ccwgroup_member' 'css' 'ap_card' 'ap_queue' 'ap_matrix'. . --inactive --all . --persistent --transient . --persistent --transient . --transient --persistent --inactive . --tree . --tree --all . nodedev-reattach : nodedev-reattach nodedev nodedev . PCI USB nodedev-detach . nodedev-reset : nodedev-reset nodedev nodedev (guest passthrough) . Libvirt . nodedev-event : nodedev-event {[nodedev] event [--loop] [--timeout seconds] [--timestamp] | --list} . nodedev . --list event . (one-shot) SIGINT ( Ctrl-C) . --timeout seconds . --loop . --timestamp ..SS nodedev-autostart : nodedev-autostart [--disable] device . --disable . (persistently-defined mediated devices) . (VIRTUAL NETWORK COMMANDS) . Libvirt (domains) . . UUID . net-autostart : net-autostart network [--disable] . --disable . net-create : net-create file [--validate] () file XML () . XML libvirt . XML --validate RNG . net-define : net-define file [--validate] file XML. XML --validate RNG . net-desc : net-desc network [[--live] [--config] | [--current]] [--title] [--edit] [--new-desc New description or title message] . . . ( net-metadata XML .) --live --config . --live --config --config . --current . --edit . --title . --edit --new-desc ..SS net-destroy : net-destroy network UUID () . . net-dumpxml : net-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] network XML stdout . --inactive . --xpath XPath XML . --wrap . net-edit : net-edit network XML . : virsh net-dumpxml --inactive network > network.xml vi network.xml (or make changes with your other text editor) virsh net-define network.xml . $VISUAL $EDITOR vi . net-event : net-event {[network] event [--loop] [--timeout seconds] [--timestamp] | --list} . network . --list event . (one-shot) SIGINT ( Ctrl-C) . --timeout seconds . --loop . --timestamp ..SS net-info : net-info network network . net-list : net-list [--inactive | --all] { [--table] | --name | --uuid } [--persistent] [<--transient>] [--autostart] [<--no-autostart>] [--title] --all --inactive . --persistent --transient --autostart --no-autostart . --name . --uuid UUID' . --table . . . --title () . --table . : API (race condition) pool . . net-metadata : net-metadata network [[--live] [--config] | [--current]] [--edit] [uri] [key] [set] [--remove] XML . XML XML . XML . (namespace) XML uri . ( net-desc .) --live --config . --live --config --config config . --current . --remove uri . --edit uri . set . --edit set key . --edit set XML uri ..SS net-name : net-name network-UUID UUID . net-start : net-start network ( ). net-undefine : net-undefine network (persistent). (transient) . net-uuid : net-uuid network-name UUID . net-update : net-update network command section xml [--parent-index index] [[--live] [--config] | [--current]] . command "add-first" "add-last" "add" ( add-last) "delete" "modify" . section "bridge" "domain" "ip" "ip-dhcp-host" "ip-dhcp-range" "forward" "forward-interface" "forward-pf" "portgroup" "dns-host" "dns-txt" "dns-srv" xml . "ip-dhcp-host" . xml xml ( " xml . - "<" xml "<" xml . --parent-index ( ). dhcp parent-index "" ( ) --parent-index . --live . --config . --current --live --config . --live --config --current () . --current ..SS net-dhcp-leases : net-dhcp-leases network [mac] dhcp network mac . (NETWORK PORT COMMANDS) . Libvirt . hypervisor . (stale) . net-port-list : net-port-list { [--table] | --uuid } network . --uuid UUID . --table . . . net-port-create : net-port-create network file [--validate] . XML --validate (schema) RNG . net-port-dumpxml : net-port-dumpxml [--xpath EXPRESSION] [--wrap] network port XML stdout. --xpath XPath XML . --wrap . net-port-delete : net-port-delete network port ..SH " (INTERFACE COMMANDS)" . ( bridge ) XML . MAC . MAC iface ( bridge MAC MAC ). iface-bridge : iface-bridge interface bridge [--no-stp] [delay] [--no-start] bridge bridge interface bridge . bridge STP 0 --no-stp --no-start delay . IP interface bridge . iface-unbridge . iface-define : iface-define file [--validate] file XML . XML --validate RNG . iface-destroy : iface-destroy interface () "if-down" . . iface-dumpxml : iface-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] interface XML stdout . --inactive . --xpath XPath XML . --wrap ..SS iface-edit : iface-edit interface XML . : virsh iface-dumpxml iface > iface.xml vi iface.xml (or make changes with your other text editor) virsh iface-define iface.xml . $VISUAL $EDITOR vi . iface-list : iface-list [--inactive | --all] . --all . --inactive . iface-name : iface-name interface MAC MAC . interface MAC . iface-mac : iface-mac interface MAC. interface . iface-start : iface-start interface ( ) "if-up"..SS iface-unbridge : iface-unbridge bridge [--no-start] (bridge) bridge IP . --no-start . iface-bridge . iface-undefine : iface-undefine interface (undefine) . iface-begin : iface-begin (snapshot) (iface-commit) (iface-rollback) . . API (libvirt) . iface-commit : iface-commit iface-begin . . iface-rollback : iface-rollback iface-begin . . ..SH " (STORAGE POOL COMMANDS)" . Libvirt (raw partitions) (storage volumes) . . . find-storage-pool-sources : find-storage-pool-sources type [srcSpec] XML type . srcSpec XML . (discovery) . XML . type XML . "netfs" "gluster" XML "name" IP (hostname) . "port" XML srcSpec . "logical" srcSpec . "iscsi" "iscsi-direct" XML "name" IP ( iSCSI) . "port" 3260 . XML "name" iSCSI initiator iSCSI (multi-iqn) . find-pool-sources-as : find-storage-pool-sources-as type [host] [port] [initiator] XML srcSpec find-storage-pool-sources virsh XML . XML find-storage-pool-sources . host type netfs gluster iscsi . port iscsi . initiator type iscsi initiator . pool-autostart : pool-autostart pool-or-uuid [--disable] pool ..SS pool-build : pool-build pool-or-uuid [--overwrite] [--no-overwrite] (pool) . --overwrite --no-overwrite pool-build filesystem disk logical . (file system) pool-build mkfs . --no-overwrite mkfs . --overwrite mkfs . (disk pool) --no-overwrite pool-build (label) . . --overwrite . "dos" . (logical pool) --no-overwrite pool-build . . --overwrite . pvcreate (volume group) . pool-create : pool-create file [--build] [[--overwrite] | [--no-overwrite]] file XML. [--build] [[--overwrite] | [--no-overwrite]] pool-build . --overwrite --no-overwrite pool-build . --build pool-build . pool-create-as : 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] name . --print-xml XML . type . pool-create-as type "disk" --source-dev path . pool-define-as pool-build --overwrite . [--source-host hostname] ( netfs iscsi rbd sheepdog gluster). [--source-path path] ( dir). [--source-dev path] ( fs logical disk iscsi zfs). [--source-name name] ( logical rbd sheepdog gluster). [--target path] . [--source-format format] ( fs netfs disk logical). [--source-initiator initiator-iqn] initiator iqn iscsi ( iscsi-direct). [--auth-type authtype --auth-username username [--secret-usage usage | --secret-uuid uuid]] . authtype chap type iscsi ceph type rbd . usage uuid (secret) . [--source-protocol-ver ver] NFS NFS nfs 'nfsvers=n' . ver . [--adapter-name name] scsi_hostN scsi_host . [--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]] wwnn wwpn fc_host . scsi_hostN vHBA (parent name) parent_wwnn parent_wwpn parent_fabric_wwn . parent_wwnn parent_wwpn scsi_hostN HBA . parent_fabric_wwn HBA (storage fabric) . [--build] [[--overwrite] | [--no-overwrite]] pool-build . --overwrite --no-overwrite pool-build . --build pool-build . "logical" [--name] . [--source-name] Volume Group . [--name] . [--target] [--source-name] ( [--name] ) ..SS pool-define : pool-define file [--validate] file XML. XML --validate RNG . pool-define-as : 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*] name . --print-xml XML . type . pool-create-as --build --overwrite --no-overwrite. pool-destroy : pool-destroy pool-or-uuid ( ) pool . Libvirt pool-create . pool-delete : pool-delete pool-or-uuid pool . . pool . pool-dumpxml : pool-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] pool-or-uuid XML pool . --inactive virsh . --xpath XPath XML . --wrap ..SS pool-edit : pool-edit pool-or-uuid XML (storage pool). : virsh pool-dumpxml pool > pool.xml vi pool.xml (or make changes with your other text editor) virsh pool-define pool.xml . $VISUAL $EDITOR vi . pool-info : pool-info [--bytes] pool-or-uuid pool . --bytes . pool-list : pool-list [--inactive] [--all] [--persistent] [--transient] [--autostart] [--no-autostart] [[--details] [--uuid] [--name] [] pool libvirt. --inactive --all . . --persistent (persistent) --transient (transient) . --autostart --no-autostart . --uuid UUID . --name . --name --uuid UUID . --details --uuid --name . type --type dir,disk. 'dir' 'fs' 'netfs' 'logical' 'disk' 'iscsi' 'scsi' 'mpath' 'rbd' 'sheepdog' 'gluster' 'zfs' 'vstorage' 'iscsi-direct' . --details virsh . : API (race condition) . ..SS pool-name : pool-name uuid uuid . pool-refresh : pool-refresh pool-or-uuid pool . pool-start : pool-start pool-or-uuid [--build] [[--overwrite] | [--no-overwrite]] pool . [--build] [[--overwrite] | [--no-overwrite]] pool-start pool-build . --overwrite --no-overwrite pool-build . --build pool-build . : "iscsi" "scsi" (v)HBA ( pool-refresh ). . . pool-undefine : pool-undefine pool-or-uuid pool . pool-uuid : pool-uuid pool UUID pool ..SS pool-event : pool-event {[pool] event [--loop] [--timeout seconds] [--timestamp] | --list} . pool . --list event . (one-shot) SIGINT ( Ctrl-C) . --timeout seconds . --loop . --timestamp . (VOLUME COMMANDS) vol-create : vol-create pool-or-uuid FILE [--prealloc-metadata] [--validate] XML . pool-or-uuid UUID . FILE XML . XML vol-dumpxml . [--prealloc-metadata] ( qcow2 ). (sparse) . --validate XML RNG . : 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 vol-create-from : vol-create-from pool-or-uuid FILE vol-name-or-key-or-path [--inputpool pool-or-uuid] [--prealloc-metadata] [--reflink] [--validate] . pool-or-uuid UUID . FILE XML . vol-name-or-key-or-path . --inputpool pool-or-uuid UUID . [--prealloc-metadata] ( qcow2 ). (sparse) . --reflink COW . . --validate XML RNG ..SS vol-create-as : 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] --print-xml XML . pool-or-uuid UUID . name . (disk pool) . /dev/sdb sdb1 sdb2 . capacity ( NOTES ) . --allocation size . --format string raw bochs qcow qcow2 vmdk qed. extended (extended) ( libvirtd ). --backing-vol vol-name-or-key-or-path . --backing-vol-format string raw bochs qcow qcow2 qed vmdk host_device. . [--prealloc-metadata] ( qcow2 ). (sparse) . vol-clone : vol-clone vol-name-or-key-or-path name [--pool pool-or-uuid] [--prealloc-metadata] [--reflink] [--print-xml] (clone) . vol-create-from . vol-name-or-key-or-path . name . --pool pool-or-uuid UUID . . [--prealloc-metadata] ( qcow2 ). (sparse) . --reflink COW . . --print-xml XML ..SS vol-delete : vol-delete vol-name-or-key-or-path [--pool pool-or-uuid] [--delete-snapshots] . vol-name-or-key-or-path . [--pool pool-or-uuid] UUID . . --delete-snapshots . rbd . vol-upload : vol-upload vol-name-or-key-or-path local-file [--pool pool-or-uuid] [--offset bytes] [--length bytes] [--sparse] local-file . vol-name-or-key-or-path local-file . --pool pool-or-uuid UUID . . --offset . . --length . unsigned long long . --sparse ( sparse) . local-file length . (refresh) API virStorageVolUpload libvirt . vol-download : vol-download vol-name-or-key-or-path local-file [--pool pool-or-uuid] [--offset bytes] [--length bytes] [--sparse] local-file . vol-name-or-key-or-path local-file . --pool pool-or-uuid UUID . . --offset . . --length . unsigned long long . --sparse ( sparse) ..SS vol-wipe : vol-wipe vol-name-or-key-or-path [--pool pool-or-uuid] [--algorithm algorithm] (volume) . vol-name-or-key-or-path . . --pool pool-or-uuid UUID (storage pool) . . --algorithm . o zero - - . o nnsa - - NNSA NAP-14.1-C (XVI-8) : random x2, 0x00, verify. o dod - - DoD 5220.22-M 8-306 : random, 0x00, 0xff, verify. o bsi - - (): 0xff, 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f. o gutmann - - Gutmann. o schneier - - Bruce Schneier "Applied Cryptography" (1996): 0x00, 0xff, random x5. o pfitzner7 - - Roy Pfitzner: random x7. o pfitzner33 - - Roy Pfitzner: random x33. o random - -: random. o trim - - (trimming) TRIM DISCARD. : scrub 'nnsa' 'dod' 'bsi' 'gutmann' 'schneier' 'pfitzner7' 'pfitzner33' . scrub . 'zero' . sparse rbd . 'trim' (discard). . 'trim' . vol-dumpxml : vol-dumpxml [--pool pool-or-uuid] [--xpath EXPRESSION] [--wrap] vol-name-or-key-or-path XML stdout. vol-name-or-key-or-path XML . --pool pool-or-uuid UUID . . --xpath XPath XML . --wrap (root node) ..SS vol-info : vol-info vol-name-or-key-or-path [--pool pool-or-uuid] [--bytes] [--physical] . vol-name-or-key-or-path . --pool pool-or-uuid UUID . . --bytes . --physical (allocation) . qcow2 () . (sparse) . vol-list : vol-list [--pool pool-or-uuid] [--details] . --pool pool-or-uuid UUID . --details virsh . vol-pool : vol-pool vol-key-or-path [--uuid] UUID . . vol-key-or-path . --uuid UUID . vol-path : vol-path vol-name-or-key [--pool pool-or-uuid] . vol-name-or-key . --pool pool-or-uuid UUID . ..SS vol-name : vol-name vol-key-or-path . vol-key-or-path . vol-key : vol-key vol-name-or-path [--pool pool-or-uuid] . vol-name-or-path . --pool pool-or-uuid UUID (storage pool) . . vol-resize : vol-resize vol-name-or-path capacity [--pool pool-or-uuid] [--allocate] [--delta] [--shrink] . vol-name-or-key-or-path . capacity ( NOTES ) . --pool pool-or-uuid UUID . . (capacity) (sparse) --allocate . capacity --delta . --shrink . capacity --shrink . blockresize . (SECRET COMMANDS) << >> ("secrets" ) . Libvirt ( ) . UUID . XML ..SS secret-define : secret-define file [--validate] file . file UUID . file UUID file . XML --validate RNG . secret-dumpxml : secret-dumpxml [--xpath EXPRESSION] [--wrap] secret secret ( UUID ) XML stdout . --xpath XPath XML . --wrap . secret-event : secret-event {[secret] event [--loop] [--timeout seconds] [--timestamp] | --list} . secret . --list event . SIGINT ( Ctrl-C) . --timeout seconds . --loop . --timestamp . secret-set-value : secret-set-value secret (--file filename [--plain] | --interactive | base64) secret ( UUID ) Base64 base64 Base64 filename . --plain --file . --interactive . --file --interactive base64 . base64 (INSECURE) . --file ..SS secret-get-value : secret-get-value [--plain] secret secret ( UUID ) Base64 (stdout) . --plain Base64 . virsh (virsh -q) . secret . secret-undefine : secret-undefine secret secret ( UUID ) . secret-list : secret-list [--ephemeral] [--no-ephemeral] [--private] [--no-private] (secrets) . --ephemeral --no-ephemeral --private --no-private . (SNAPSHOT COMMANDS) . . <<>> . . XML . snapshot-create : snapshot-create domain [xmlfile] {[--redefine [--current]] | [--no-metadata] [--halt] [--disk-only] [--reuse-external] [--quiesce] [--atomic] [--live]} [--validate] domain xmlfile . --validate XML RNG ( virt-xml-validate(1)). --disk-only libvirt . xmlfile libvirt . snapshot-current . --halt . --disk-only . fsck --halt --disk-only . --redefine XML snapshot-dumpxml UUID ( XML ) . xmlfile --current . --no-metadata ( libvirt --redefine libvirt ). --reuse-external XML . . --quiesce libvirt (guest agent) . . --disk-only . --atomic libvirt . dumpxml . --live libvirt . . . . undefine . ( destroy ) . (checkpoint) ..SS snapshot-create-as : snapshot-create-as domain {[--print-xml] [--no-metadata] [--halt] [--reuse-external]} [name] [description] [--disk-only [--quiesce]] [--atomic] [--validate] [[--live] [--memspec memspec]] [--diskspec] diskspec]... domain libvirt . --print-xml XML snapshot-create . --halt --disk-only (vm state) . --memspec . --memspec memspec [file=]name[,snapshot=type] type no internal external . file=name (escape) . --memspec --disk-only . --diskspec --disk-only . xml . disk[,snapshot=type][,driver=type][,stype=type][,file=name] . (block devices) diskspec libvirt . stype . 'file' () 'block'. --diskspec disk,snapshot=no . disk file=name . --diskspec diskspec domain name description . diskspec "vda,snapshot=external,file=/path/to,,new" XML : --reuse-external XML diskspec . . --quiesce libvirt guest agent (freeze) (unfreeze) . guest agent . --disk-only . --no-metadata ( libvirt snapshot-create libvirt ). --atomic libvirt . dumpxml . --live libvirt . . . checkpoint . --validate XML RNG ..SS snapshot-current : snapshot-current domain {[--name] | [--security-info] | [snapshotname]} snapshotname XML ( ) . --name XML . --security-info XML . snapshotname . snapshot-edit : snapshot-edit domain [snapshotname] [--current] {[--rename] | [--clone]} XML snapshotname . snapshotname --current . snapshotname --current . : 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] . $VISUAL $EDITOR vi . --rename . --clone . . qcow2 . snapshot-info : snapshot-info domain {snapshot | --current} --current. snapshot-list : snapshot-list domain [--metadata] [--no-metadata] [{--parent | --roots | [{--tree | --name}]}] [--topological] [{[--from] snapshot | --current} [--descendants]] [--leaves] [--no-leaves] [--inactive] [--active] [--disk-only] [--internal] [--external] . --topological ( ). --parent . --roots . --tree . . --name --parent tab . --tree . --from snapshot --current . --parent --descendants . --tree --descendants . --roots . --from --current --tree . --leaves . --no-leaves . ( ). --tree . --metadata libvirt undefine destroy . --no-metadata libvirt . --inactive . --active . --disk-only . --internal . --external ..SS snapshot-dumpxml : snapshot-dumpxml [--security-info] [--xpath EXPRESSION] [--wrap] domain snapshot XML snapshot . --security-info . snapshot-current XML . --xpath XPath XML . --wrap (root) . snapshot-parent : snapshot-parent domain {snapshot | --current} ( ) snapshot --current . snapshot-revert : snapshot-revert domain {snapshot | --current} [{--running | --paused}] [--force] [--reset-nvram] snapshot --current . . snapshot-revert . (vm state) (inactive) . --running --paused ( ). (transient) . 7.10.0 libvirt . XML . --force : o ( libvirt 0.9.5) libvirt --force libvirt ( ). o VNC Spice . --start --pause . o libvirt QEMU (managed saved state) . . swap . --reset-nvram NVRAM/varstore ..SS snapshot-delete : snapshot-delete domain {snapshot | --current} [--metadata] [{--children | --children-only}] snapshot --current . . --children . --children-only . . --metadata libvirt . CHECKPOINT (CHECKPOINT COMMANDS) . . . XML . checkpoint-create : checkpoint-create domain [xmlfile] { --redefine [--redefine-validate] | [--quiesce]} domain xmlfile . XML RNG ( virt-xml-validate(1)). xmlfile libvirt . --redefine XML checkpoint-dumpxml UUID ( XML ) . xmlfile . --redefine-validate --redefine (hypervisor) XML . . --quiesce libvirt guest agent . guest agent . undefine . ( destroy ) . . checkpoint-create-as : checkpoint-create-as domain [--print-xml] [name] [description] [--quiesce] [--diskspec] diskspec]... domain libvirt . --print-xml XML checkpoint-create . --diskspec . XML . disk[,checkpoint=type][,bitmap=name] . --diskspec diskspec domain name description . diskspec "vda,checkpoint=bitmap,bitmap=map1" XML : --quiesce libvirt guest agent . guest agent . ..SS checkpoint-edit : checkpoint-edit domain checkpointname XML checkpointname domain . : 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 checkpoint . $VISUAL $EDITOR vi . checkpoint-info : checkpoint-info domain checkpoint . checkpoint-list : checkpoint-list domain [{--parent | --roots | [{--tree | --name}]}] [--topological] [[--from] checkpoint | [--descendants]] [--leaves] [--no-leaves] checkpoint domain checkpoint . checkpoint --topological ( ). --parent checkpoint . --roots checkpoint . --tree checkpoint . . --name checkpoint --parent checkpoint tab . --tree . --from checkpoint checkpoint . --parent --descendants . --tree --descendants . --roots . --from --tree . --leaves checkpoint . --no-leaves checkpoint . ( ). --tree ..SS checkpoint-dumpxml : checkpoint-dumpxml [--security-info] [--no-domain] [--size] [--xpath EXPRESSION] [--wrap] domain checkpoint XML checkpoint. --security-info . --size XML ( ). --size domain . --no-domain . --xpath XPath XML . --wrap . checkpoint-parent : checkpoint-parent domain checkpoint ( ) checkpoint . checkpoint-delete : checkpoint-delete domain checkpoint [--metadata] [{--children | --children-only}] checkpoint. ( ) . --children . --children-only . . --metadata libvirt . NWFILTER (NWFILTER COMMANDS) . . XML . . ..SS nwfilter-define : nwfilter-define xmlfile [--validate] libvirt. XML . . (instantiate) XML . XML --validate RNG . nwfilter-undefine : nwfilter-undefine nwfilter-name . . nwfilter-list : nwfilter-list . nwfilter-dumpxml : nwfilter-dumpxml [--xpath EXPRESSION] [--wrap] nwfilter-name XML . --xpath XPath XML . --wrap . nwfilter-edit : nwfilter-edit nwfilter-name XML . : virsh nwfilter-dumpxml myfilter > myfilter.xml vi myfilter.xml (or make changes with your other text editor) virsh nwfilter-define myfilter.xml . nwfilter-define . $VISUAL $EDITOR vi ..SH " (NWFILTER BINDING COMMANDS)" . . (NIC) . TAP . nwfilter-binding-create : nwfilter-binding-create xmlfile [--validate] . . . . XML --validate RNG . nwfilter-binding-delete : nwfilter-binding-delete port-name . . . nwfilter-binding-create . nwfilter-binding-list : nwfilter-binding-list . nwfilter-binding-dumpxml : nwfilter-binding-dumpxml [--xpath EXPRESSION] [--wrap] port-name XML port-name. --xpath XPath XML . --wrap ..SH " (HYPERVISOR-SPECIFIC COMMANDS)" : . libvirt . libvirt . libvirt . qemu-attach : qemu-attach pid QEMU QEMU libvirt . QEMU UNIX . '-name' . $ qemu-kvm -cdrom ~/demo.iso \ -monitor unix:/tmp/demo,server,nowait \ -name foo \ -uuid cece4f9f-dff0-575d-0e8e-01fe380f12ea & $ QEMUPID=$! $ virsh qemu-attach $QEMUPID QEMU libvirt . ABI (hotplug hotunplug) . . qemu-monitor-command : qemu-monitor-command domain { [--hmp] | [--pretty] [--return-value] } [--pass-fds N,M,...] command... command QEMU domain . stdout . command . libvirt qemu QMP command JSON QMP . command JSON libvirt JSON : # simple command $ virsh qemu-monitor-command VM commandname $ virsh qemu-monitor-command VM '{"execute":"commandname"}' # with arguments $ virsh qemu-monitor-command VM commandname '"arg1":123' '"arg2":"test"' $ virsh qemu-monitor-command VM commandname '{"arg1":123,"arg2":"test"}' $ virsh qemu-monitor-command VM '{"execute":"commandname", "arguments":{"arg1":123,"arg2":"test"}}' --pretty QMP (pretty-printed). --return-value QEMU 'return' QMP . --hmp Human Monitor libvirt QMP . --pass-fds (file descriptors) qemu ..SS qemu-agent-command : qemu-agent-command domain [--timeout seconds | --async | --block] command... command domain QEMU agent. --timeout --async --block . --timeout seconds . --async . --block . qemu-monitor-event : qemu-monitor-event [domain] [--event event-name] [--loop] [--timeout seconds] [--pretty] [--regex] [--no-case] [--timestamp] QEMU . domain event-name . QMP 'query-events' qemu-monitor-command . --regex event-name . --no-case event-name . (one-shot) SIGINT ( Ctrl-C) . --timeout seconds . --loop . --pretty JSON . --timestamp QEMU . lxc-enter-namespace : lxc-enter-namespace domain [--noseclabel] -- /path/to/binary [arg1, [arg2, ...]] (namespace) domain /path/to/binary . . / virsh . sVirt cgroups . LXC . /path/to/binary 0 . . --noseclabel virsh . (ENVIRONMENT) virsh : o VIRSH_DEBUG=<0 to 4> virsh. : o VIRSH_DEBUG=0 DEBUG - o VIRSH_DEBUG=1 INFO - INFO NOTICE WARNING ERROR o VIRSH_DEBUG=2 NOTICE - NOTICE WARNING ERROR o VIRSH_DEBUG=3 WARNING - WARNING ERROR o VIRSH_DEBUG=4 ERROR - ERROR . o VIRSH_LOG_FILE=``LOGFILE`` virsh. o VIRSH_DEFAULT_CONNECT_URI . URI connect . LIBVIRT_DEFAULT_URI . o LIBVIRT_DEFAULT_URI . URI connect . URI libvirt . o VISUAL edit . o EDITOR VISUAL edit . o VIRSH_HISTSIZE . 500 . o LIBVIRT_DEBUG=LEVEL API libvirt. : o LIBVIRT_DEBUG=1 DEBUG o LIBVIRT_DEBUG=2 INFO o LIBVIRT_DEBUG=3 WARNING o LIBVIRT_DEBUG=4 ERROR : .SH " (BUGS)" . : 1. 2. . (AUTHORS) AUTHORS libvirt . (COPYRIGHT) (C) 2005, 2007-2015 Red Hat, Inc. AUTHORS libvirt . (LICENSE) virsh GNU LGPL v2+ . . . (SEE ALSO) virt-install(1), virt-xml-validate(1), virt-top(1), virt-df(1), virsh(1)