GPT disk and config drive creation with ipa

Bug #1705327 reported by ritesh nanda
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When trying to provision a baremetal with disk greater than 2TB and using GPT.

Ironic Python agent creates a config drive at the end sector of the disk , later when the box is coming up cloud-init growpart kicks in and tries to grow the root disk size , it fails doing so as config drive was written at the sector .

ipa uses sgdisk -n 0:-64MB:0 to create a config drive , sgdisk adjusts the disk sector by itself creating a config drive start sector , same which growpart will use as the end of root disk.

Below is the example what happens.

gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 22501195776 sectors, 10.5 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): D7F2691D-DDB7-4F22-BA98-49AC583C9844
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 22501195742
Partitions will be aligned on 8-sector boundaries
Total free space is 22165520377 sectors (10.3 TiB)

Number Start (sector) End (sector) Size Code Name
   1 2048 976895 476.0 MiB 8300 Linux filesystem
   2 976896 8790015 3.7 GiB 8200 Linux swap
   3 8790016 335544286 155.8 GiB 8300 Linux filesystem
   4 34 2047 1007.0 KiB EF02 BIOS boot partition
   5 22501064664 22501195742 64.0 MiB 8300 (Config drive is created at sector 22501064664 )

Now when trying growpart runs it fails as

growpart --dry-run /dev/sda 3
CHANGE: disk=/dev/sda partition=3: start=8790016 old: size=326754270,end=335544286 new: size=22492274648,end=22501064664

growpart /dev/sda 3
failed [sgdisk_mod:4] sgdisk --move-second-header --delete=3 --new=3:8790016:22501064664 --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 --partition-guid=3:78CD977B-AE3C-42D7-AF7E-273F8C807BC5 --change-name=3:Linux filesystem /dev/sda
Could not create partition 3 from 8790016 to 22501064664
Could not change partition 3's type code to 0FC63DAF-8483-4772-8E79-3D69D8477DE4!
Unable to set partition 3's name to 'Linux filesystem'!
Error encountered; not saving changes.
FAILED: disk=/dev/sda partition=3: failed to repartition
***** WARNING: Resize failed, attempting to revert ******
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.

Then i have to change the sector size by one less for which config drive was created.

sgdisk --move-second-header --delete=3 --new=3:8790016:22501064663 --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 --partition-guid=3:78CD977B-AE3C-42D7-AF7E-273F8C807BC5 --change-name=3:"Linux filesystem" /dev/sda
***** Appears to have gone OK ****

I don't know is it related to IPA , but this problem comes in which we create a config drive.

Help would be appreciated.

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


This seems like an issue with growpart, although possibly this may also be some sort of alignment issue. I'm going to tag ironic-lib, and hopefully we can get some more eyes on this.

In the mean time, if you could let us know what distribution and version that your using.


Changed in ironic-lib:
status: New → Incomplete
Changed in ironic-python-agent:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for ironic-lib because there has been no activity for 60 days.]

Changed in ironic-lib:
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for ironic-python-agent because there has been no activity for 60 days.]

Changed in ironic-python-agent:
status: Incomplete → Expired
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.