I Can reproduce everything you said above on Ubuntu 24.04 (Noble):

# Prepare images:

uvt-simplestreams-libvirt --verbose sync --source 
http://cloud-images.ubuntu.com/daily arch=amd64 label=daily release=focal
uvt-simplestreams-libvirt --verbose sync --source 
http://cloud-images.ubuntu.com/daily arch=amd64 label=daily release=jammy

uvt-kvm create --password=ubuntu f arch=amd64 label=daily release=focal
uvt-kvm create --password=ubuntu j arch=amd64 label=daily release=jammy


# Allow to enter the GRUB menu inside the images:
uvt-kvm ssh f
sudo vim /etc/default/grub.d/50-cloudimg-settings.cfg
GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=menu
sudo update-grub

uvt-kvm ssh j
sudo vim /etc/default/grub.d/50-cloudimg-settings.cfg
GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=menu
sudo update-grub


# Create a virtual machine with two disks, both using ​​virtio​​.

sudo /usr/bin/qemu-system-x86_64 \
  -machine q35,accel=kvm,usb=off,vmport=off,dump-guest-core=off \
  -cpu host \
  -m 2048 \
  -smp 1 \
  -nodefaults \
  -boot strict=on \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/f.qcow","node-name":"libvirt-1-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-1-format","driver":"qcow2","file":"libvirt-1-storage"}' \
  -device 
virtio-blk-pci,drive=libvirt-1-format,id=virtio-disk0,addr=0x2,bootindex=1 \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/j.qcow","node-name":"libvirt-2-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-2-format","driver":"qcow2","file":"libvirt-2-storage"}' \
  -device virtio-blk-pci,drive=libvirt-2-format,id=virtio-disk1,addr=0x3 \
  -boot menu=on -nographic -serial mon:stdio


# Inside the GRUB menu, hit "c":

                             GNU GRUB  version 2.04

   Minimal BASH-like line editing is supported. For the first word, TAB   
   lists possible command completions. Anywhere else TAB lists possible   
   device or file completions. ESC at any time exits.                     


grub> ls
(hd0) (hd0,gpt15) (hd0,gpt14) (hd0,gpt1)

=> We can only see hd0

# Create a virtual machine with two disks: one using ​​virtio​​ and the
other using ​​SATA​​.

sudo /usr/bin/qemu-system-x86_64 \
  -machine q35,accel=kvm,usb=off,vmport=off,dump-guest-core=off \
  -cpu host \
  -m 2048 \
  -smp 1 \
  -nodefaults \
  -boot strict=on,menu=on \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/f.qcow","node-name":"libvirt-1-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-1-format","driver":"qcow2","file":"libvirt-1-storage"}' \
  -device 
virtio-blk-pci,drive=libvirt-1-format,id=virtio-disk0,addr=0x2,bootindex=1 \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/j.qcow","node-name":"libvirt-2-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-2-format","driver":"qcow2","file":"libvirt-2-storage"}' \
  -device ich9-ahci,id=ahci0,bus=pcie.0,addr=0x3 \
  -device ide-hd,drive=libvirt-2-format,id=ide-disk1,bus=ahci0.0 \
  -nographic -serial mon:stdio

# Inside the GRUB menu, hit "c":

                             GNU GRUB  version 2.04

   Minimal BASH-like line editing is supported. For the first word, TAB   
   lists possible command completions. Anywhere else TAB lists possible   
   device or file completions. ESC at any time exits.                     


grub> ls
(hd0) (hd0,gpt15) (hd0,gpt14) (hd0,gpt1) (hd1) (hd1,gpt15) (hd1,gpt14) (hd1,gpt
1)

=> We can see hd0 and hd1!


# Original VM with 2 virtio disks. With "-boot strict=on" but without
",bootindex=1":

sudo /usr/bin/qemu-system-x86_64 \
  -machine q35,accel=kvm,usb=off,vmport=off,dump-guest-core=off \
  -cpu host \
  -m 2048 \
  -smp 1 \
  -nodefaults \
  -boot strict=on \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/f.qcow","node-name":"libvirt-1-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-1-format","driver":"qcow2","file":"libvirt-1-storage"}' \
  -device virtio-blk-pci,drive=libvirt-1-format,id=virtio-disk0,addr=0x2 \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/j.qcow","node-name":"libvirt-2-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-2-format","driver":"qcow2","file":"libvirt-2-storage"}' \
  -device virtio-blk-pci,drive=libvirt-2-format,id=virtio-disk1,addr=0x3 \
  -boot menu=on -nographic -serial mon:stdio

                             GNU GRUB  version 2.04

   Minimal BASH-like line editing is supported. For the first word, TAB   
   lists possible command completions. Anywhere else TAB lists possible   
   device or file completions. ESC at any time exits.                     


grub> ls
(hd0) (hd0,gpt15) (hd0,gpt14) (hd0,gpt1) (hd1) (hd1,gpt15) (hd1,gpt14) (hd1,gpt
1)

=> We can see both disks!


# Original VM with 2 virtio disks. Without "-boot strict=on" but with 
",bootindex=1":

sudo /usr/bin/qemu-system-x86_64 \
  -machine q35,accel=kvm,usb=off,vmport=off,dump-guest-core=off \
  -cpu host \
  -m 2048 \
  -smp 1 \
  -nodefaults \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/f.qcow","node-name":"libvirt-1-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-1-format","driver":"qcow2","file":"libvirt-1-storage"}' \
  -device 
virtio-blk-pci,drive=libvirt-1-format,id=virtio-disk0,addr=0x2,bootindex=1 \
  -blockdev 
'{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/j.qcow","node-name":"libvirt-2-storage"}'
 \
  -blockdev 
'{"node-name":"libvirt-2-format","driver":"qcow2","file":"libvirt-2-storage"}' \
  -device virtio-blk-pci,drive=libvirt-2-format,id=virtio-disk1,addr=0x3 \
  -boot menu=on -nographic -serial mon:stdio

                             GNU GRUB  version 2.04

   Minimal BASH-like line editing is supported. For the first word, TAB   
   lists possible command completions. Anywhere else TAB lists possible   
   device or file completions. ESC at any time exits.                     


grub> ls
(hd0) (hd0,gpt15) (hd0,gpt14) (hd0,gpt1) (hd1) (hd1,gpt15) (hd1,gpt14) (hd1,gpt
1)

=> We can see both disks.


When swapping the f.qcow and j.qcow images to have the primary image be
Jammy, using GRUB 2.06 I can confirm the very same behavior, so I think
this is unrelated to GRUB.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2125827

Title:
  Jammy grub2 failed to detect 2nd virtio disk

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/2125827/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to