Comment 21 for bug 1838525

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

17:45 <andreas> cyphermox: I tried with a serial number for vda, it failed in the same way
17:46 <cyphermox> andreas: not necessarily a serial
17:46 <andreas> isn't the serial what allows the by-id symlink to be created?
17:46 <rafaeldtinoco> andreas: that was my previous summary
17:46 <rafaeldtinoco> in the case
17:46 <rafaeldtinoco> (about the dbconfig variable)
17:46 <andreas> k
17:47 <rafaeldtinoco> SO
17:47 <rafaeldtinoco> device-map is gone in eoan =) there is a patch restoring it
17:47 <rafaeldtinoco> let me check previous versions :\
17:47 <rafaeldtinoco> https://www.irccloud.com/pastebin/h3c9ZFYP/
17:48 <andreas> these are the disk/by-id links in both cases: https://people.canonical.com/~andreas/disk-by-id.png
17:48 <andreas> cyphermox: ^
17:48 <andreas> there is no symlink to the whole vda device
17:48 <andreas> which is what you meant probably
17:49 <rafaeldtinoco> andreas: this is coming from udevadm DEVLINKS most likely
17:49 <andreas> but this is on a bionic host, where qemu/libvirt doesn't generate a serial for you automatically
17:50 <rafaeldtinoco> #ifdef __linux__
17:50 <rafaeldtinoco> {
17:50 <rafaeldtinoco> DIR *dir = opendir ("/dev/disk/by-id");
17:50 <andreas> in the straight-to-virtio case it worked flawlessly, bootdev was /dev/vda
17:51 <rafaeldtinoco> from deviceiter.c -> grub_util_iterate_devices
17:51 <andreas> and there is no symlink in /dev/disk/by-id
17:51 <rafaeldtinoco> used by grub-mkdevicemap.c
17:51 <rafaeldtinoco> which is inexistent in recent grub2 upstream
17:51 <rafaeldtinoco> we basically recreate the grub-mkdevicemap again
17:51 <rafaeldtinoco> so we can rely on it for our scripts
17:51 <rafaeldtinoco> so deviceiter.c explains the "sort" for that list
17:52 <rafaeldtinoco> /* Now add all the devices in sorted order. */
17:52 <rafaeldtinoco> for (dev = 0; dev < devs_len; ++dev)
17:52 <rafaeldtinoco> =)
17:52 <andreas> so if you look at this comparison: https://people.canonical.com/~andreas/disk-by-id.png
17:52 <andreas> that matches what that d-i prompt is asking us, and the output of grub-mkdevicemap with some removed/filtered
17:53 <rafaeldtinoco> you are getting dm-0 first
17:53 <andreas> that one is filtered
17:53 <rafaeldtinoco> instead of sda (left side)
17:53 <andreas> by "something"
17:53 <rafaeldtinoco> ah ok
17:53 <andreas> left side, sda, then sda1
17:53 <andreas> right side, I get vda1
17:53 <rafaeldtinoco> we have no vda
17:53 <rafaeldtinoco> at the right side
17:53 <andreas> yet it's in the menu: https://people.canonical.com/~andreas/which-dev-is-first.png
17:54 <andreas> but with no "(extra description)"
17:54 <rafaeldtinoco> i mean in /dev/disk/by-id
17:54 <rafaeldtinoco> where is vda only
17:54 <andreas> right, no vda there, probably because it has no serial
17:54 <andreas> I don't have screenshots for the case with a serial now
17:54 <andreas> so many combinations to try
17:54 <rafaeldtinoco> no serial because its not SCSI
17:54 <andreas> yes
17:54 <rafaeldtinoco> no VPDs
17:54 <rafaeldtinoco> now it all makes sense
17:54 <andreas> qemu on eoan assigns a serial
17:55 <rafaeldtinoco> let me copy this to the public bug =)
17:55 <andreas> 00001 or something
17:55 <andreas> so you probably have that
17:55 <andreas> since your host is eoan
17:55 — rafaeldtinoco checks
17:56 <rafaeldtinoco> https://www.irccloud.com/pastebin/BaynZGW7/
17:56 <rafaeldtinoco> andreas: ^ for scsi
17:56 <rafaeldtinoco> andreas: SO, the udev rules for scsi SERIAL are in initramfs
17:56 <rafaeldtinoco> cause the installer does not have udev rules for scsi
17:57 <andreas> rafaeldtinoco: you pasted the non-virtio case
17:57 <andreas> sda
17:57 <cyphermox> rafaeldtinoco: the devicemap program isn't at fault
17:57 <rafaeldtinoco> no, i was reading it to understand the sort
17:57 <cyphermox> I think this is udev not creating a symlink for vda for whatever reason it somehow decided not to
17:57 <rafaeldtinoco> like andreas said
17:58 <rafaeldtinoco> udev is not creating the device
17:58 <rafaeldtinoco> yep,
17:58 <cyphermox> yeah, sorry; I had a power outage so I'm scrambling to follow ;)
17:58 <rafaeldtinoco> andreas: i dont have the virtio case here
17:58 — rafaeldtinoco dumb created a single VM
17:58 <rafaeldtinoco> i could have had 2 in parallel
17:59 <rafaeldtinoco> question: has this LVM + virtio setup EVER worked ?
17:59 <rafaeldtinoco> andreas: why do you say the serial was created before ?
17:59 <rafaeldtinoco> because of your tests ?
18:00 <andreas> the first attempts I did were on a laptop with eoan, and I noticed that virt-manager there filled in the serial when selecting a virtio device
18:00 <rafaeldtinoco> yep, i noticed from the debconf menu
18:00 <rafaeldtinoco> (like u said, lacking the description)
18:00 <andreas> but I can start one here on bionic, just filling in the serial manually with a very recognizable number :)
18:00 <andreas> like 9999
18:01 <rafaeldtinoco> 60-persistent-storage.rules:# legacy virtio-pci by-path links (deprecated)
18:01 <rafaeldtinoco> andreas: ^
18:01 <andreas> rafaeldtinoco: about it ever having worked before, it must have, but I don't remember having tried this combination specifically
18:01 <cyphermox> rafaeldtinoco: yes, lvm + virtio was working; this is a common install scenario
18:02 <rafaeldtinoco> # virtio-blk
18:02 <rafaeldtinoco> KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"
18:02 <rafaeldtinoco> KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"
18:02 <rafaeldtinoco> so this is failing ^ for initramfs
18:02 <rafaeldtinoco> (this is eoans)
18:02 <rafaeldtinoco> damn i just fixed something really close to this (sg3-utils-udev)
18:02 <rafaeldtinoco> for the other case
18:03 <rafaeldtinoco> https://bugs.launchpad.net/ubuntu/+source/sg3-utils/+bug/1833618
18:03 <mup> Bug #1833618: failing to deploy Ubuntu Disco <curtin:Invalid> <sg3-utils (Ubuntu):In Progress by rafaeldtinoco> <sg3-utils (Ubuntu Bionic):In Progress by rafaeldtinoco>
18:03 <mup> <sg3-utils (Ubuntu Disco):In Progress by rafaeldtinoco> <sg3-utils (Ubuntu Eoan):In Progress by rafaeldtinoco> <https://launchpad.net/bugs/1833618>
18:03 <rafaeldtinoco> curtin was lost because of serials also
18:03 <rafaeldtinoco> but for USB devices
18:03 <rafaeldtinoco> same case
18:03 <rafaeldtinoco> a package would create another udev rules for SERIAL
18:03 <rafaeldtinoco> for usb devices
18:04 <andreas> now I have a symlink in disk/by-id
18:04 <andreas> with a manually entered 9999 serial
18:04 <rafaeldtinoco> u created a serial for the vda
18:04 <rafaeldtinoco> HA
18:04 <andreas> let's see what happens
18:04 <rafaeldtinoco> so we need a udev rule to create an ENVIRONMENT variable for udev
18:04 <rafaeldtinoco> whenever ID_SERIAL is not present in the first udev scan
18:05 <rafaeldtinoco> just like USB does with usb_id -> SERIAL