简体   繁体   中英

virt-install is looking for iso image, when I want to use a qcow2 image

I'm absolutely new to stackoverflow, so I'm extremely sorry if my question has formatting issues.

I created a VM using virt-install:

virt-install \
--name guest \
--memory 2048 \
--vcpus 2 \ 
--disk size=8 \ 
--location /var/lib/libvirt/images/centos.iso \
--os-variant centos7.0 \
--check disk_size=off \
--graphics none \
--extra-args console=ttyS0

The above command works fine, but when I want to use a specific image which is a qcow2 image, Virt-install throws the error:

ERROR Command '['isoinfo', '-J', '-i', '/var/lib/libvirt/images/centos.qcow2', '-f']' returned non-zero exit status 1

Looks like virt-install is looking for an isofile since its running the isoinfo command to verify an iso image, eventhough I have a qcow2 image.

I might be able to pass a qcow2 using the --disk parameter instead of --location , but --extra-args only works with --location .

Kindly help me out, thank you in advance!

You seem to be mixing up two different concepts here. The --location flag is intended to provide the installation media, which will be an ISO image or a URL to a installable tree. The --disk flag would be to provide the storage to back the virtual disk of the VM being provisioned, which will typically be a qcow2 file or a raw file, or a block device.

I'm assuming the centos.iso image would be your installation media, and the centos.qcow2 image would be an empty volume for the virtual disk into which you'll install the CentOS guest.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM