virsh是libvirt提供的命令行工具, 了解virsh命令的功能,可以快速了解libvirt的主要功能及功能特性
这里首先介绍domain
domain 域, 可以看做是一个虚拟机实例
通过 virsh -h 可以查看所有命令, 能够看到每个命令的介绍信息(这里不做一一翻译)
# virsh -h
virsh [options]... [<command_string>]
virsh [options]... <command> [args...]
options:
-c | --connect=URI hypervisor connection URI
-d | --debug=NUM debug level [0-4]
-e | --escape <char> set escape sequence for console
-h | --help this help
-k | --keepalive-interval=NUM
keepalive interval in seconds, 0 for disable
-K | --keepalive-count=NUM
number of possible missed keepalive messages
-l | --log=FILE output logging to file
-q | --quiet quiet mode
-r | --readonly connect readonly
-t | --timing print timing information
-v short version
-V long version
--version[=TYPE] version, TYPE is short or long (default short)
commands (non interactive mode):
domain 域, 可看做一个虚拟机实例
基础命令:
Domain Management (help keyword 'domain')
attach-device attach device from an XML file
attach-disk attach disk device
attach-interface attach network interface
autostart autostart a domain
blkdeviotune Set or query a block device I/O tuning parameters.
blkiotune Get or set blkio parameters
blockcommit Start a block commit operation.
blockcopy Start a block copy operation.
blockjob Manage active block operations
blockpull Populate a disk from its backing image.
blockresize Resize block device of domain.
change-media Change media of CD or floppy drive
console connect to the guest console
cpu-stats show domain cpu statistics
create create a domain from an XML file
define define (but don't start)
libvirt virsh domain命令详解

本文介绍了libvirt的命令行工具virsh,特别是关注于domain命令,它代表虚拟机实例。文章列举了domain的基础命令,并提供了使用示例,包括查看设备参数、调整CPU权重、设置内存和CPU等操作。
最低0.47元/天 解锁文章
513

被折叠的 条评论
为什么被折叠?



