Table of Content

generate qcow2 base image

virt-builder centos-7.6 \
--format qcow2 \
--size 20G -o /var/lib/libvist/boot/centos-7.6-20G.qcow2

verified type of disk is qcow2 by
qemu-img info /var/lib/libvist/boot/centos-7.6-20G.qcow2

will use this base image as template for future vm quick launch.

clone base image disk to vm disk

cp /var/lib/libvist/boot/centos-7.6-20G.qcow2 /var/lib/libvist/images/testvm.qcow2

create vm testvm by importing existing qcow2,

virt-install --import --name testvm2 \
--ram 1024 \
--vcpu 1 \
--disk path=/var/lib/libvist/images/testvm.qcow2,device=disk,format=qcow2 \
--nographics --serial=pty --os-type=linux --os-variant rhel7 \
--noautoconsole --noreboot

cannot start up testvm due to driver type is raw, which should be qcow2,

virsh dumpxml testvm | grep driver
      <driver name='qemu' type='raw'/>

as remedy, change type from raw to qcow2, then can start testvm properly.

bug reported

https://bugzilla.redhat.com/show_bug.cgi?id=1661683