问题描述:
使用qemu-img create -f qcow2 -b cirros.qcow2 vmhost.img 20G
创建虚拟机磁盘出现以下报错,报错内容:qemu-img: vmhost.img: Backing file specified without backing format
Detected format of qcow2.
[root@ecs images]# qemu-img create -f qcow2 -b cirros.qcow2 vmhost.img 20G
qemu-img: vmhost.img: Backing file specified without backing format
全网找了好久都没有看到这个报错的文章,索性直接问文心一言,发现是格式错了。
正确格式:
[root@ecs images]# qemu-img create -f qcow2 -o backing_file=cirros.qcow2,backing_fmt=qcow2 vmhost.img 20G
Formatting 'vmhost.img', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=21474836480 backing_file=cirros.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
不得不说,ai真好用
以下是他的回答:
撒旦
qemu-img create -f qcow2 -o backing_file=cirros.qcow2,backing_fmt=qcow2 vmhost.img 20Gqemu-img create -f qcow2 -o backing_file=cirros.qcow2,backing_fmt=qcow2 vmhost.img 20G
qemu-img create -f qcow2 -o backing_file=cirros.qcow2,backing_fmt=qcow2 vmhost.img 20G