[Bug 2080608] Re: [SRU] storage.layout.mode="use_gap" does not honor match directive
Yao Wei
2080608 at bugs.launchpad.net
Wed Jan 8 08:50:59 UTC 2025
** Description changed:
[ Impact ]
* when using Subiquity's autoinstall feature, once can use "match"
directives at the storage->layout level to find the right drive.
However, the match directives where silently ignored when using mode:
use_gap.
* This makes it difficult for the OEM team to install to the
installation media.
[ Test Plan ]
== Target issue test plan ==
1. Prepare a VM with 2 disks with identical size, 48G for testing
purposes, (we call them disk A and B)
2. Boot into a live environment, and create 2 partitions on disk A:
- a 512M EFI System Partition
- a 12G FAT32 partition for "reset partition"
leave the remainings of disk A, and the whole disk B unallocated.
3. Copy contents in the Ubuntu installer ISO into the "reset partition"
4. Place an autoinstall.yaml file in the root of reset partition, with
the following contents:
#cloud-config
autoinstall:
version: 1
storage:
layout:
name: direct
mode: use_gap
match:
install-media: true
identity:
hostname: ubuntu
username: ubuntu
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
# (password is ubuntu, copied from Autoinstall Quickstart howto guide)
- 5. Reboot into Reset Partition and complete the installation
+ 5. Change the boot/grub/grub.cfg in the reset partition, and add
+ "nopersistent" in the kernel command line, this is to not let casper
+ expand the disk for the installer environment.
- 6. Check the system is installed in the disk A instead of disk B
+ 6. Reboot into Reset Partition and complete the installation
+
+ 7. Check the system is installed in the disk A instead of disk B
== Regression test plan ==
1. Install a Ubuntu system by any means
2. Use the subiquity under test, and install into the same disk by
shrinking the partition size of the previous installation.
3. Both OSes should be accessible through GRUB menu.
[ Where problems could occur ]
Regressions caused the normal Ubuntu installation unable to continue.
[ Other info ]
The change to merge is https://github.com/canonical/subiquity/pull/2083
[ Original description ]
We found a problem that the following autoinstall config:
storage:
layout:
name: direct
mode: use_gap
match:
install-media: true
does not actually match install-media, because use_gap does not use match directive to filter disks before finding a largest gap, according to the code in the below link:
https://github.com/canonical/subiquity/blob/6727905effc4abc2d96c96986600efe392e3b7b6/subiquity/server/controllers/filesystem.py#L1614
Internal reference: NANTOU-470
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to subiquity in Ubuntu.
https://bugs.launchpad.net/bugs/2080608
Title:
[SRU] storage.layout.mode="use_gap" does not honor match directive
Status in subiquity:
Fix Committed
Status in subiquity package in Ubuntu:
New
Status in subiquity source package in Noble:
New
Bug description:
[ Impact ]
* when using Subiquity's autoinstall feature, once can use "match"
directives at the storage->layout level to find the right drive.
However, the match directives where silently ignored when using mode:
use_gap.
* This makes it difficult for the OEM team to install to the
installation media.
[ Test Plan ]
== Target issue test plan ==
1. Prepare a VM with 2 disks with identical size, 48G for testing
purposes, (we call them disk A and B)
2. Boot into a live environment, and create 2 partitions on disk A:
- a 512M EFI System Partition
- a 12G FAT32 partition for "reset partition"
leave the remainings of disk A, and the whole disk B unallocated.
3. Copy contents in the Ubuntu installer ISO into the "reset
partition"
4. Place an autoinstall.yaml file in the root of reset partition, with
the following contents:
#cloud-config
autoinstall:
version: 1
storage:
layout:
name: direct
mode: use_gap
match:
install-media: true
identity:
hostname: ubuntu
username: ubuntu
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
# (password is ubuntu, copied from Autoinstall Quickstart howto guide)
5. Change the boot/grub/grub.cfg in the reset partition, and add
"nopersistent" in the kernel command line, this is to not let casper
expand the disk for the installer environment.
6. Reboot into Reset Partition and complete the installation
7. Check the system is installed in the disk A instead of disk B
== Regression test plan ==
1. Install a Ubuntu system by any means
2. Use the subiquity under test, and install into the same disk by
shrinking the partition size of the previous installation.
3. Both OSes should be accessible through GRUB menu.
[ Where problems could occur ]
Regressions caused the normal Ubuntu installation unable to continue.
[ Other info ]
The change to merge is
https://github.com/canonical/subiquity/pull/2083
[ Original description ]
We found a problem that the following autoinstall config:
storage:
layout:
name: direct
mode: use_gap
match:
install-media: true
does not actually match install-media, because use_gap does not use match directive to filter disks before finding a largest gap, according to the code in the below link:
https://github.com/canonical/subiquity/blob/6727905effc4abc2d96c96986600efe392e3b7b6/subiquity/server/controllers/filesystem.py#L1614
Internal reference: NANTOU-470
To manage notifications about this bug go to:
https://bugs.launchpad.net/subiquity/+bug/2080608/+subscriptions
More information about the foundations-bugs
mailing list