> cloud-init included growpart executable from jessie repository do not appear
> to work together. cloudinit/config/cc_growpart.py searches for "--update" in
> output of "growpart --help", but this is no longer present; I think this is
> causing virtual machines to fail to resize the root partition on first boot.

growpart is provided by the cloud-utils package. The '--update' commandline
option was added by upstream version 0.27, but jessie is on 0.26-2 so doesn't
have it.

It's probably be easiest to backport version 0.27-2 from stretch.

With 0.27-2 installed in a jessie VM, I get:

Jan 25 09:19:19 jessie [CLOUDINIT] helpers.py[DEBUG]: Running config-growpart
using lock (<cloudinit.helpers.DummyLock object at 0x7f28184f6610>)
Jan 25 09:19:19 jessie [CLOUDINIT] cc_growpart.py[DEBUG]: No 'growpart' entry in
cfg.  Using default: {'ignore_growroot_disabled': False, 'mode': 'auto',
'devices': ['/']}
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Running command ['growpart',
'--help'] with allowed return codes [0] (shell=False, capture=True)
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Reading from
/proc/344/mountinfo (quiet=False)
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Read 2304 bytes from
/proc/344/mountinfo
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Reading from
/sys/class/block/vda1/partition (quiet=False)
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Read 2 bytes from
/sys/class/block/vda1/partition
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Reading from
/sys/devices/pci0000:00/0000:00:04.0/virtio1/block/vda/dev (quiet=False)
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Read 6 bytes from
/sys/devices/pci0000:00/0000:00:04.0/virtio1/block/vda/dev
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Running command ['growpart',
'--dry-run', '/dev/vda', '1'] with allowed return codes [0] (shell=False,
capture=True)
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: Running command ['growpart',
'/dev/vda', '1'] with allowed return codes [0] (shell=False, capture=True)
Jan 25 09:19:19 jessie [CLOUDINIT] util.py[DEBUG]: resize_devices took 0.065 
seconds
Jan 25 09:19:19 jessie [CLOUDINIT] cc_growpart.py[INFO]: '/' resized: changed
(/dev/vda, 1) from 32211206144 to 37579915264

As a result the root partition is properly resized (in my test from 30GB to 
35GB).


---
Juerg Haefliger
Hewlett Packard Enterprise

Reply via email to