[root@localhost ~]# service libvirtd status
Redirecting to /bin/systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/local/lib/systemd/system/libvirtd.service; disabled; vendor preset: enabled)
//看到下面这行failed内心是有点崩溃的,服务没有正常启起来
Active: failed (Result: start-limit) since Sat 2019-04-20 11:31:44 CST; 3h 41min ago
Docs: man:libvirtd(8)
https://libvirt.org
Process: 19705 ExecStart=/usr/local/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=1/FAILURE)
Main PID: 19705 (code=exited, status=1/FAILURE)
Apr 20 11:31:44 localhost.VD systemd[1]: Failed to start Virtualization daemon.
Apr 20 11:31:44 localhost.VD systemd[1]: Unit libvirtd.service entered failed state.
Apr 20 11:31:44 localhost.VD systemd[1]: libvirtd.service failed.
Apr 20 11:31:44 localhost.VD systemd[1]: libvirtd.service holdoff time over, scheduling restart.
Apr 20 11:31:44 localhost.VD systemd[1]: Stopped Virtualization daemon.
Apr 20 11:31:44 localhost.VD systemd[1]: start request repeated too quickly for libvirtd.service
Apr 20 11:31:44 localhost.VD systemd[1]: Failed to start Virtualization daemon.
Apr 20 11:31:44 localhost.VD systemd[1]: Unit libvirtd.service entered failed state.
Apr 20 11:31:44 localhost.VD systemd[1]: libvirtd.service failed.
同时,重启libvirtd服务报错
[root@localhost ~]# service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service
Job for libvirtd.service failed because the control process exited with error code. See "systemctl status libvirtd.service" and "journalctl -xe" for details.
[root@localhost ~]# qemu-img --help
qemu-img version 3.1.0
Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers
usage: qemu-img [standard options] command [command options]
QEMU disk image utility
'-h', '--help' display this help and exit
'-V', '--version' output version information and exit
'-T', '--trace' [[enable=]][,events=][,file=]
specify tracing options
//......省略部分,具体看create的格式......
Command syntax:
create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]
//下为参数具体说明
Command parameters:
'filename' is a disk image filename
'objectdef' is a QEMU user creatable object definition. See the qemu(1) manual page for a description of the object properties. The most common object type is a 'secret', which is used to supply passwords and/or encryption keys. //对象定义
'fmt' is the disk image format. It is guessed automatically in most cases. //磁盘镜像格式,创建时一般都要自己定义好
'cache' is the cache mode used to write the output disk image, the valid options are: 'none', 'writeback' (default, except for convert), 'writethrough', 'directsync' and 'unsafe' (default for convert).
'src_cache' is the cache mode used to read input disk images, the valid options are the same as for the 'cache' option.
'size' is the disk image size in bytes. Optional suffixes 'k' or 'K' (kilobyte, 1024), 'M' (megabyte, 1024k), 'G' (gigabyte, 1024M), 'T' (terabyte, 1024G), 'P' (petabyte, 1024T) and 'E' (exabyte, 1024P) are supported. 'b' is ignored. //磁盘镜像文件大小,各种单位都可以设置
'output_filename' is the destination disk image filename.
'output_fmt' is the destination format.
'options' is a comma separated list of format specific options in a name=value format. Use -o ? for an overview of the options supported by the used format. //查看选项
'snapshot_param' is param used for internal snapshot, format is 'snapshot.id=[ID],snapshot.name=[NAME]', or '[ID_OR_NAME]'.
'-c' indicates that target image must be compressed (qcow format only).
'-u' allows unsafe backing chains. For rebasing, it is assumed that old and new backing file match exactly. The image doesn't need a working backing file before rebasing in this case (useful for renaming the backing file). For image creation, allow creating without attempting to open the backing file. //一般不选此项
'-h' with or without a command shows this help and lists the supported formats
'-p' show progress of command (only certain commands).
'-q' use Quiet mode - do not print any output (except errors). //使用静默模式(不打印任何输出,只打印报错),一般不选择开启此项
'-S' indicates the consecutive number of bytes (defaults to 4k) that must contain only zeros for qemu-img to create a sparse image during conversion. If the number of bytes is 0, the source will not be scanned for unallocated or zero sectors, and the destination image will always be fully allocated.
'--output' takes the format in which the output must be done (human or json).
'-n' skips the target volume creation (useful if the volume is created prior to running qemu-img).