Comment 2 for bug 1991554

Revision history for this message
James Falcon (falcojr) wrote (last edit ):

I'll raise an issue over on the cloud-utils issues page[1] to add some kind of alignment flag to growpart and then if that merges, we can add a growpart config option in cloud-init to use it. However, growpart will grow the underlying partition, but in order to take advantage of the increased size, the filesystem itself also needs to be resized. That can only happen once the encrypted partition has been unlocked. Cloud-init can only do that if it has access to a key to unlock the partition during early boot, which would have to be baked into the image being launched[2].

Unless you plan on modifying an image in this manner, I think your best bet is to simply disable growpart via userdata[3]:

#cloud-config
growpart:
  mode: off

[1]: https://github.com/canonical/cloud-utils/issues
[2]: https://github.com/canonical/cloud-init/blob/main/cloudinit/config/cc_growpart.py#L383
[3]: https://cloudinit.readthedocs.io/en/latest/topics/modules.html#growpart