Code for config drive incorrectly counts primary partitions

Bug #1629926 reported by Yolanda Robla
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

I'm hitting an error when using full disk images, and extended partitions. My disk is having just a primary partition, but also has swap and extended partition. Output from parted is something like:

 "BYT;
1:1.00MiB:4768MiB:4767MiB:ext4::boot;
2:4768MiB:5722MiB:954MiB:xfs::;
3:5722MiB:7168MiB:1446MiB:::lba;
5:5722MiB:5865MiB:143MiB:linux-swap(v1)::;
6:5865MiB:6247MiB:381MiB:xfs::;
7:6247MiB:7168MiB:921MiB:xfs::;"

When i try to deploy, I hit the error:

Exception: Deploy failed for instance 0c786f46-6552-4309-8c6d-99c01d013696. Error: Config drive cannot be created for node da9d1550-c531-4cc8-b91f-c3d96fd52ff7. Disk uses MBR partitioning and already has 5 primary partitions.

That is because code on list_partitions() is just using a simple regex and counting all partitions without considering the type, leading to incorrect interpretation.

Please note that image partitions with ironic is a real use case. Specially in terms of security, having different partitions for /boot, /var, /home, etc... is really needed. So that use case shall be supported.

Revision history for this message
Julia Kreger (juliaashleykreger) wrote :

Confirming issue. This is indeed an issue in the code and a common practice in security hardening is to restrict settings at the filesystem level with separate partitions. As far as I can remember, We never expected an ironic user to want to deploy in this case with multiple partitions like this. :(

Changed in ironic:
status: New → Confirmed
Changed in ironic:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
importance: Undecided → Medium
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

This got merged yesterday: https://review.openstack.org/#/c/381893/

Changed in ironic:
status: Confirmed → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/ironic-lib 2.3.0

This issue was fixed in the openstack/ironic-lib 2.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/ironic-lib 2.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic-lib 2.1.2

This issue was fixed in the openstack/ironic-lib 2.1.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.