** Description changed:

  [ Impact ]
  When booting an affected Ubuntu Server installer ISO on a system where a
  multipath device is used as a LVM PV, installing Ubuntu is not possible.
  
  Such a situation happens when a previous *LVM* installation of any OS (i.e., 
not
  necessarily Ubuntu) was done on a multipath disk, present on the system.
  
  The symptoms typically include:
   * a crash of the Subiquity client
   * the following error in the journal:
  ```
  ubuntu-server multipathd[941]: mpatha: addmap [0 16777216 multipath 0 0 2 1 
service-time 0 1 1 8:0 1 service-time 0 1 1 8:16 1]
  ubuntu-server multipathd[941]: libdevmapper: ioctl/libdm-iface.c(1990): 
device-mapper: reload ioctl on mpatha (252:1) failed: Device or resource busy
  ```
   * the VG device mapper node exists (e.g., ubuntu-vg) but the multipath one 
does not (e.g., mpatha)
  
  Explanation
  -----------
  
  Although LVM support is included in the initramfs of the installer ISO,
  multipath support is not. As a result, during the transition out of the
  initramfs, LVM VGs are activated using an individual underlying path device
  instead of the consolidated multipath device mapper node.
  
  Example
  -------
  Let's assume /dev/sda and /dev/sdb refer to the same disk via different
  paths. It is intended that sda and sdb are consolidated under a multipath
  device node, which in turn should be used as a PV.
  
    Excepted result in the live environment
    ---------------------------------------
  
  /dev/sda    --> consolidated under mpatha
  /dev/sdb    --> consolidated under mpatha
  
  /dev/mapper/mpatha   --> used as the PV of ubuntu-vg
  
  /dev/mapper/ubuntu-vg   --> the VG that uses mpatha as the PV
  
    Actual result on affected ISO
    -----------------------------
  
  /dev/sda   --+
  /dev/sdb   ----> one of these is used as the PV for ubuntu-vg
  
  /dev/mapper/mpatha   <-- does not exist
  
  /dev/mapper/ubuntu-vg (uses /dev/sda or /dev/sdb as the PV)
  
  [ Proposed fix ]
  
   * Since 25.10, we added support to multipath in the initramfs of the Ubuntu 
Server ISOs. I propose doing the same for 24.04.5.
   * This would correspond to:
      * a livecd-rootfs upload, ensuring multipath-tools-boot is installed when 
building the installer's initramfs.
      * a multipath-tools upload to fix:
           * a bug making the multipathd process linger when executed in 
casper's initramfs (because we use nfs-* scripts and not local-* scripts)
           * a bug making multipathd refuse to start if no bindings file is 
present (i.e., bug 2120444)
  
  [ Test Plan ]
  
   1. Get an Ubuntu Server ISO built using livecd-rootfs and 
multipath-tools-boot
   2. Ensure the ISO includes multipath support:
-    # mount -o loop,ro <ISO> /mnt/loop
+    # mount -o loop,ro <ISO> /mnt/loop
     # mkdir /tmp/test-initramfs
     # unmkinitramfs /mnt/loop/casper/initrd /tmp/test-initramfs/
     # find -name multipathd
     ./usr/sbin/multipathd
  
   3. Get a test-bed ready by installing an OS (for instance Ubuntu Server 
26.04) using multipath + LVM.
      $ kvm-test --install --iso /srv/iso/ubuntu-26.04-live-server-amd64.iso 
--disk-interface scsi-multipath --recreate-target
  
   4. Try to install on the test bed using the fixed ISO and ensure the
  installation can proceed to the end.
  
      $ kvm-test --install --iso <ISO> -- disk-interface scsi-multipath
  --reuse-target
  
  The disk should be detected as a "multipath disk", not a "local disk".
  Otherwise, multipath support won't be included in the target system.
  
  The kvm-test script can be found here at
  https://github.com/canonical/subiquity/blob/main/scripts/kvm-test.py or
  in ppa:ogayot/subiquity
  
  [ Where problems could occur? ]
  
   * Bringing multipath support in the installer's initramfs could slightly 
slow down the boot process of the ISO. Nevertheless, 25.10 and 26.04 Ubuntu 
Server ISOs have had multipath-support in the initramfs, and no measurable slow 
down has been experienced. The change is affecting ubuntu-server only.
  * The multipath-tools fixes are a bit more involved. They can in theory 
affect all systems using multipath, not just installer ISOs. That said, the 
number of setups that use both multipath and nfs-* scripts should be very low. 
Most setups use local-* scripts instead - with the exception of casper's 
initramfs that we have in installer ISOs.
  
  [ Other Info ]
  
   * For existing affected ISOs, there is a workaround but not a user-friendly 
one:
     1. open a shell in the installer environment (one can hit F2 in the
        Subiquity TUI)
     2. Delete the relevant VG using `dmsetup remove`:
        $ sudo dmremove /dev/mapper/<vg>
     3. Restart multipathd using:
        $ sudo systemctl restart multipathd
     4. Finally, restart Subiquity:
        $ sudo snap restart subiquity
   * Alternatively, users can wipe the affected disk and then restart he 
installer (but this involves manually erasing data from the disk).
  
  [ Original description ]
  
  == Comment: - Anushree Mathur ==
  OS: 24.04 LTS (Noble Numbat)
  I started the Ubuntu installation for 24.04 LTS (Noble Numbat) on L1(HOST) 
having SAN disk, it failed with the following error just after I chose the disk.
  
  Ubuntu 24.04 LTS ubuntu-server hvc0
  
  connecting...
  waiting for cloud-init...
  generating crash report
  report saved to /var/crash/1724388235.797082424.ui.crash
  Traceback (most recent call last):
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/client/controllers/filesystem.py",
 line 273, in _guided_choice
      self.ui.set_body(FilesystemView(self.model, self))
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/filesystem.py",
 line 485, in __init__
      self.refresh_model_inputs()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/filesystem.py",
 line 540, in refresh_model_inputs
      self.avail_list.refresh_model_inputs()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/filesystem.py",
 line 417, in refresh_model_inputs
      for obj, cells in summarize_device(device, filter):
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/helpers.py",
 line 32, in summarize_device
      anns = labels.annotations(device) + labels.usage_labels(device)
    File "/snap/subiquity/5745/usr/lib/python3.10/functools.py", line 889, in 
wrapper
      return dispatch(args[0].__class__)(*args, **kw)
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/common/filesystem/labels.py",
 line 100, in _annotations_vg
      member = next(iter(vg.devices))
  StopIteration
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "/snap/subiquity/5745/usr/bin/subiquity", line 8, in <module>
      sys.exit(main())
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/cmd/tui.py", line 
158, in main
      asyncio.run(run_with_loop())
    File "/snap/subiquity/5745/usr/lib/python3.10/asyncio/runners.py", line 44, 
in run
      return loop.run_until_complete(main)
    File "/snap/subiquity/5745/usr/lib/python3.10/asyncio/base_events.py", line 
649, in run_until_complete
      return future.result()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/cmd/tui.py", line 
156, in run_with_loop
      await subiquity_interface.run()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/client/client.py", 
line 403, in run
      await super().run()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquitycore/tui.py", line 
351, in run
      await super().run()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquitycore/core.py", line 
134, in run
      raise exc
  RuntimeError: coroutine raised StopIteration
  
  Ubuntu 24.04 LTS ubuntu-server hvc0
  
  connecting...
  ProblemType: Bug
  Architecture: ppc64el
  CrashDB: {'impl': 'launchpad', 'project': 'subiquity'}
  
  I tried following 2 installation methods, it is failing in both the ways:
  1) kexec method
  2) attaching vdvd and starting installer
  
  NOTE: It is happening only when the system has SAN disks otherwise this 
installation worked fine.
  I will be attaching the crash report for this!
  
  == Comment:- Hariharan T S ==
  Verified the following cases.
  Installation on Disk from VIOS  - PASSED
  Installatoin on Disk from VIOS and system had Disks from SAN - FAILED
  Installation on Disk from SAN and system ahd Disk from VIOS - FAILED
  
  == Comment:- Vaibhav Jain ==
  Problem seems to happening when Subuquity enters the disk partition view. The 
system has a SAN disk and an existing Mullti Path DM volume on it.
  
  Mirroring to distro

** Description changed:

  [ Impact ]
  When booting an affected Ubuntu Server installer ISO on a system where a
  multipath device is used as a LVM PV, installing Ubuntu is not possible.
  
  Such a situation happens when a previous *LVM* installation of any OS (i.e., 
not
  necessarily Ubuntu) was done on a multipath disk, present on the system.
  
  The symptoms typically include:
   * a crash of the Subiquity client
   * the following error in the journal:
  ```
  ubuntu-server multipathd[941]: mpatha: addmap [0 16777216 multipath 0 0 2 1 
service-time 0 1 1 8:0 1 service-time 0 1 1 8:16 1]
  ubuntu-server multipathd[941]: libdevmapper: ioctl/libdm-iface.c(1990): 
device-mapper: reload ioctl on mpatha (252:1) failed: Device or resource busy
  ```
   * the VG device mapper node exists (e.g., ubuntu-vg) but the multipath one 
does not (e.g., mpatha)
  
  Explanation
  -----------
  
  Although LVM support is included in the initramfs of the installer ISO,
  multipath support is not. As a result, during the transition out of the
  initramfs, LVM VGs are activated using an individual underlying path device
  instead of the consolidated multipath device mapper node.
  
  Example
  -------
  Let's assume /dev/sda and /dev/sdb refer to the same disk via different
  paths. It is intended that sda and sdb are consolidated under a multipath
  device node, which in turn should be used as a PV.
  
    Excepted result in the live environment
    ---------------------------------------
  
  /dev/sda    --> consolidated under mpatha
  /dev/sdb    --> consolidated under mpatha
  
  /dev/mapper/mpatha   --> used as the PV of ubuntu-vg
  
  /dev/mapper/ubuntu-vg   --> the VG that uses mpatha as the PV
  
    Actual result on affected ISO
    -----------------------------
  
  /dev/sda   --+
  /dev/sdb   ----> one of these is used as the PV for ubuntu-vg
  
  /dev/mapper/mpatha   <-- does not exist
  
  /dev/mapper/ubuntu-vg (uses /dev/sda or /dev/sdb as the PV)
  
  [ Proposed fix ]
  
   * Since 25.10, we added support to multipath in the initramfs of the Ubuntu 
Server ISOs. I propose doing the same for 24.04.5.
   * This would correspond to:
      * a livecd-rootfs upload, ensuring multipath-tools-boot is installed when 
building the installer's initramfs.
      * a multipath-tools upload to fix:
           * a bug making the multipathd process linger when executed in 
casper's initramfs (because we use nfs-* scripts and not local-* scripts)
           * a bug making multipathd refuse to start if no bindings file is 
present (i.e., bug 2120444)
+ 
+ The SRU verification can only be done after the different uploads land.
  
  [ Test Plan ]
  
   1. Get an Ubuntu Server ISO built using livecd-rootfs and 
multipath-tools-boot
   2. Ensure the ISO includes multipath support:
     # mount -o loop,ro <ISO> /mnt/loop
     # mkdir /tmp/test-initramfs
     # unmkinitramfs /mnt/loop/casper/initrd /tmp/test-initramfs/
     # find -name multipathd
     ./usr/sbin/multipathd
  
   3. Get a test-bed ready by installing an OS (for instance Ubuntu Server 
26.04) using multipath + LVM.
      $ kvm-test --install --iso /srv/iso/ubuntu-26.04-live-server-amd64.iso 
--disk-interface scsi-multipath --recreate-target
  
   4. Try to install on the test bed using the fixed ISO and ensure the
  installation can proceed to the end.
  
      $ kvm-test --install --iso <ISO> -- disk-interface scsi-multipath
  --reuse-target
  
  The disk should be detected as a "multipath disk", not a "local disk".
  Otherwise, multipath support won't be included in the target system.
  
  The kvm-test script can be found here at
  https://github.com/canonical/subiquity/blob/main/scripts/kvm-test.py or
  in ppa:ogayot/subiquity
  
  [ Where problems could occur? ]
  
   * Bringing multipath support in the installer's initramfs could slightly 
slow down the boot process of the ISO. Nevertheless, 25.10 and 26.04 Ubuntu 
Server ISOs have had multipath-support in the initramfs, and no measurable slow 
down has been experienced. The change is affecting ubuntu-server only.
  * The multipath-tools fixes are a bit more involved. They can in theory 
affect all systems using multipath, not just installer ISOs. That said, the 
number of setups that use both multipath and nfs-* scripts should be very low. 
Most setups use local-* scripts instead - with the exception of casper's 
initramfs that we have in installer ISOs.
  
  [ Other Info ]
  
   * For existing affected ISOs, there is a workaround but not a user-friendly 
one:
     1. open a shell in the installer environment (one can hit F2 in the
        Subiquity TUI)
     2. Delete the relevant VG using `dmsetup remove`:
        $ sudo dmremove /dev/mapper/<vg>
     3. Restart multipathd using:
        $ sudo systemctl restart multipathd
     4. Finally, restart Subiquity:
        $ sudo snap restart subiquity
   * Alternatively, users can wipe the affected disk and then restart he 
installer (but this involves manually erasing data from the disk).
  
  [ Original description ]
  
  == Comment: - Anushree Mathur ==
  OS: 24.04 LTS (Noble Numbat)
  I started the Ubuntu installation for 24.04 LTS (Noble Numbat) on L1(HOST) 
having SAN disk, it failed with the following error just after I chose the disk.
  
  Ubuntu 24.04 LTS ubuntu-server hvc0
  
  connecting...
  waiting for cloud-init...
  generating crash report
  report saved to /var/crash/1724388235.797082424.ui.crash
  Traceback (most recent call last):
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/client/controllers/filesystem.py",
 line 273, in _guided_choice
      self.ui.set_body(FilesystemView(self.model, self))
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/filesystem.py",
 line 485, in __init__
      self.refresh_model_inputs()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/filesystem.py",
 line 540, in refresh_model_inputs
      self.avail_list.refresh_model_inputs()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/filesystem.py",
 line 417, in refresh_model_inputs
      for obj, cells in summarize_device(device, filter):
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/ui/views/filesystem/helpers.py",
 line 32, in summarize_device
      anns = labels.annotations(device) + labels.usage_labels(device)
    File "/snap/subiquity/5745/usr/lib/python3.10/functools.py", line 889, in 
wrapper
      return dispatch(args[0].__class__)(*args, **kw)
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/common/filesystem/labels.py",
 line 100, in _annotations_vg
      member = next(iter(vg.devices))
  StopIteration
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "/snap/subiquity/5745/usr/bin/subiquity", line 8, in <module>
      sys.exit(main())
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/cmd/tui.py", line 
158, in main
      asyncio.run(run_with_loop())
    File "/snap/subiquity/5745/usr/lib/python3.10/asyncio/runners.py", line 44, 
in run
      return loop.run_until_complete(main)
    File "/snap/subiquity/5745/usr/lib/python3.10/asyncio/base_events.py", line 
649, in run_until_complete
      return future.result()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/cmd/tui.py", line 
156, in run_with_loop
      await subiquity_interface.run()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquity/client/client.py", 
line 403, in run
      await super().run()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquitycore/tui.py", line 
351, in run
      await super().run()
    File 
"/snap/subiquity/5745/lib/python3.10/site-packages/subiquitycore/core.py", line 
134, in run
      raise exc
  RuntimeError: coroutine raised StopIteration
  
  Ubuntu 24.04 LTS ubuntu-server hvc0
  
  connecting...
  ProblemType: Bug
  Architecture: ppc64el
  CrashDB: {'impl': 'launchpad', 'project': 'subiquity'}
  
  I tried following 2 installation methods, it is failing in both the ways:
  1) kexec method
  2) attaching vdvd and starting installer
  
  NOTE: It is happening only when the system has SAN disks otherwise this 
installation worked fine.
  I will be attaching the crash report for this!
  
  == Comment:- Hariharan T S ==
  Verified the following cases.
  Installation on Disk from VIOS  - PASSED
  Installatoin on Disk from VIOS and system had Disks from SAN - FAILED
  Installation on Disk from SAN and system ahd Disk from VIOS - FAILED
  
  == Comment:- Vaibhav Jain ==
  Problem seems to happening when Subuquity enters the disk partition view. The 
system has a SAN disk and an existing Mullti Path DM volume on it.
  
  Mirroring to distro

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

Title:
  [SRU] cannot install Ubuntu Server over a multipath disk used as an
  LVM PV

To manage notifications about this bug go to:
https://bugs.launchpad.net/subiquity/+bug/2080474/+subscriptions


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

Reply via email to