Open chunfuwen opened 3 months ago
[root@hp-xx-16 bootc-image-builder]# virt-install --connect qemu:///system -n imagevm --hvm --accelerate -r 3096 --vcpus=3 --os-variant rhel9.0 --disk path=/var/lib/libvirt/images/testimgevm.qcow2,bus=virtio,format=qcow2,size=10 --network network=default,model=virtio --location /var/lib/libvirt/images/install.iso --debug --memballoon model=virtio --cpu host,disable=vmx --graphics vnc --video virtio --machine q35
[Thu, 14 Mar 2024 01:59:01 virt-install 2938534] DEBUG (cli:204) Version 4.1.0 launched with command line: /usr/bin/virt-install --connect qemu:///system -n imagevm --hvm --accelerate -r 3096 --vcpus=3 --os-variant rhel9.0 --disk path=/var/lib/libvirt/images/testimgevm.qcow2,bus=virtio,format=qcow2,size=10 --network network=default,model=virtio --location /var/lib/libvirt/images/install.iso --debug --memballoon model=virtio --cpu host,disable=vmx --graphics vnc --video virtio --machine q35
[Thu, 14 Mar 2024 01:59:01 virt-install 2938534] DEBUG (virtinstall:212) Distilled --network options: ['network=default,model=virtio']
[Thu, 14 Mar 2024 01:59:01 virt-install 2938534] DEBUG (virtinstall:142) Distilled --disk options: ['path=/var/lib/libvirt/images/testimgevm.qcow2,bus=virtio,format=qcow2,size=10']
[Thu, 14 Mar 2024 01:59:01 virt-install 2938534] DEBUG (cli:217) Requesting libvirt URI qemu:///system
[Thu, 14 Mar 2024 01:59:02 virt-install 2938534] DEBUG (connection:128) libvirt URI versions library=9.5.0 driver=9.5.0 hypervisor=8.0.0
[Thu, 14 Mar 2024 01:59:02 virt-install 2938534] DEBUG (connection:109) Fetched capabilities for qemu:///system:
[Thu, 14 Mar 2024 01:59:02 virt-install 2938534] DEBUG (cli:220) Received libvirt URI qemu:///system
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (guest:341) Setting Guest osinfo name <_OsVariant name=generic>
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (guest:341) Setting Guest osinfo name <_OsVariant name=rhel9.0>
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urlfetcher:71) Using scratchdir=/var/lib/libvirt/boot
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:285) Finding distro store for location=/var/lib/libvirt/images/install.iso
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:875) variant=rhel9.0 has distro=rhel, looking for matching distro store to prioritize
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:884) Prioritizing distro store=<class 'virtinst.install.urldetect._RHELDistro'>
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urlfetcher:34) Generating iso filelist: ['xorriso', '-indev', '/var/lib/libvirt/images/install.iso', '-print', 'VIRTINST_BEGINLIST', '-find']
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=.treeinfo: Couldn't acquire file /.treeinfo: iso doesn't have file=/.treeinfo
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=treeinfo: Couldn't acquire file /treeinfo: iso doesn't have file=/treeinfo
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=content: Couldn't acquire file /content: iso doesn't have file=/content
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=current/images/MANIFEST: Couldn't acquire file /current/images/MANIFEST: iso doesn't have file=/current/images/MANIFEST
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=current/legacy-images/MANIFEST: Couldn't acquire file /current/legacy-images/MANIFEST: iso doesn't have file=/current/legacy-images/MANIFEST
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=daily/MANIFEST: Couldn't acquire file /daily/MANIFEST: iso doesn't have file=/daily/MANIFEST
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=.disk/info: Couldn't acquire file /.disk/info: iso doesn't have file=/.disk/info
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (urldetect:45) Failed to acquire file=VERSION: Couldn't acquire file /VERSION: iso doesn't have file=/VERSION
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (cli:256) File "/usr/bin/virt-install", line 8, in
[Thu, 14 Mar 2024 01:59:04 virt-install 2938534] ERROR (cli:257) Error validating install location: Could not find an installable distribution at URL '/var/lib/libvirt/images/install.iso'
The location must be the root directory of an install tree. See virt-install man page for various distro examples. [Thu, 14 Mar 2024 01:59:04 virt-install 2938534] DEBUG (cli:259) Traceback (most recent call last): File "/usr/share/virt-manager/virtinst/virtinstall.py", line 552, in installer_detect_distro autodistro = installer.detect_distro(guest) File "/usr/share/virt-manager/virtinst/install/installer.py", line 532, in detect_distro ret = self._treemedia.detect_distro(guest) File "/usr/share/virt-manager/virtinst/install/installertreemedia.py", line 306, in detect_distro cache = self._get_cached_data(guest, fetcher) File "/usr/share/virt-manager/virtinst/install/installertreemedia.py", line 185, in _get_cached_data store = urldetect.getDistroStore(guest, fetcher, File "/usr/share/virt-manager/virtinst/install/urldetect.py", line 320, in getDistroStore raise ValueError(msg) ValueError: Could not find an installable distribution at URL '/var/lib/libvirt/images/install.iso'
The location must be the root directory of an install tree. See virt-install man page for various distro examples.
root@xx bootc-image-builder]# isoinfo -d -i /var/lib/libvirt/images/install.iso CD-ROM is in ISO 9660 format System id: LINUX Volume id: Container-Installer-x86_64 Volume set id: Publisher id: Data preparer id: XORRISO-1.5.6 2023.06.07.180001, LIBISOBURN-1.5.6, LIBISOFS-1.5.6, LIBBURN-1.5.6 Application id: Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 873976 El Torito VD version 1 found, boot catalog is in sector 57 Joliet with UCS level 3 found Rock Ridge signatures version 1 found Eltorito validation header: Hid 1 Arch 0 (x86) ID '' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 4 Bootoff 3A 58
Shouldn't --location /var/lib/libvirt/images/install.iso
be --cdrom /var/lib/libvirt/images/install.iso
?
For general iso such as RHEL ISO, it looks like support both of them : --cdrom, --location. One more information I gotten is that Device Edge Iso support location, see details: https://github.com/openshift/microshift/blob/main/docs/user/getting_started.md
[root@xx images]# virt-install --connect qemu:///system -n imageisovm --hvm --accelerate -r 3096 --vcpus=3 --os-variant rhel9.0 --disk path=/var/lib/libvirt/images/testimgevm2.qcow2,bus=virtio,format=qcow2,size=10 --network network=default,model=virtio --location /var/lib/libvirt/images/fedora.iso --debug --memballoon model=virtio --cpu host,disable=vmx --graphics vnc --video virtio --machine q35
[Fri, 15 Mar 2024 04:27:39 virt-install 1495666] DEBUG (cli:204) Version 4.1.0 launched with command line: /usr/bin/virt-install --connect qemu:///system -n imageisovm --hvm --accelerate -r 3096 --vcpus=3 --os-variant rhel9.0 --disk path=/var/lib/libvirt/images/testimgevm2.qcow2,bus=virtio,format=qcow2,size=10 --network network=default,model=virtio --location /var/lib/libvirt/images/fedora.iso --debug --memballoon model=virtio --cpu host,disable=vmx --graphics vnc --video virtio --machine q35
[Fri, 15 Mar 2024 04:27:39 virt-install 1495666] DEBUG (virtinstall:212) Distilled --network options: ['network=default,model=virtio']
[Fri, 15 Mar 2024 04:27:39 virt-install 1495666] DEBUG (virtinstall:142) Distilled --disk options: ['path=/var/lib/libvirt/images/testimgevm2.qcow2,bus=virtio,format=qcow2,size=10']
[Fri, 15 Mar 2024 04:27:39 virt-install 1495666] DEBUG (cli:217) Requesting libvirt URI qemu:///system
[Fri, 15 Mar 2024 04:27:39 virt-install 1495666] DEBUG (connection:128) libvirt URI versions library=9.5.0 driver=9.5.0 hypervisor=8.0.0
[Fri, 15 Mar 2024 04:27:39 virt-install 1495666] DEBUG (connection:109) Fetched capabilities for qemu:///system:
Did you try --cdrom
? It looks like you don't really need to use --location
in your case (it is required if you are trying to modify the kernel cmdline), IIRC virt-install has some strong opinions about storage location and what it can use for --location
. You could also try using qemu-kvm directly.
Yes ,I tried --cdrom, and it worked as expected. But I wonder whether it is a potential issue that we don't support --location option.
Hmm, so --location
is used to install from a "Distribution tree installation source. virt-install can recognize certain distribution trees and fetches a bootable kernel/initrd pair to launch the install.".
I wonder if the ISO that we produce is not recognized as a distribution tree... It's good to know that --cdrom
works, though. :) @supakeen Have you ever seen anything like this while dealing with ISOs?
As far as I'm aware you should use --cdrom
for an ISO. --location
is for other types of content (distribution trees as @ondrejbudai points out, I don't know what exactly a distribution tree is but the ISO apparently isn't one.
Should it be?
Note, when trying out the linked documentation with a Fedora Server ISO it also doesn't work, I'll try with a RHEL ISO as well.
€ sudo virt-install --name fedora-server --vcpus 2 --memory 3072 --disk path=fedora-server.qcow2,size=20 --location=./Fedora-Server-dvd-x86_64-39-1.5.iso --wait
ERROR Error validating install location: Could not find an installable distribution at URL './Fedora-Server-dvd-x86_64-39-1.5.iso'
The location must be the root directory of an install tree.
See virt-install man page for various distro examples.
So, --location
does work with the RHEL 9.3 ISO's but not with Fedora ISOs.
with --location ,I use fedora iso from :https://download.fedoraproject.org/pub/fedora/linux/releases/39/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-39-1.5.iso And virt-install can succeed afterwards installing procedure, and there is no output " Error validating install location"
Right so it might work for a subset of ISOs in the Fedora project as well (not Server, or IoT, which are the ones I had laying around).
I ever has opportunity tried device edge iso, it also support --cdrom. See https://github.com/openshift/microshift/blob/main/docs/user/getting_started.md
Distribution tree usually means something that looks like this: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/ but I think virt-install also has some code to grab that info from isos that it recognizes, but I'd have to go dig through their code to be sure. So unless you really need to append things to the kernel cmdline the right thing to use is --cdrom
or --hda
The workaround for this problem is to examine the produced ISO to determine kernel and initrd paths to be passed explicitly in virt-install command line.
--location "/path/to/my-bootc.iso,kernel=images/pxeboot/vmlinuz,initrd=images/pxeboot/initrd.img"
--osinfo detect=on
Nevertheless, this is a limitation that should be fixed, IMO.