clearlinux / micro-config-drive

An alternative and small cloud-init implementation in C
Other
45 stars 17 forks source link

disk: maximize rootfs partition #35

Closed devimc closed 5 years ago

devimc commented 5 years ago

Other cloud-config implementations like cloud-init resizes automatically the rootfs to the maximum allowed, ucd should do the same.

fixes #34

cc @ahkok @mdreyesm @gorozco1

Signed-off-by: Julio Montes julio.montes@intel.com

devimc commented 5 years ago

@mdreyesm please do me a favour and test it in your baremetal machine :smile:

ahkok commented 5 years ago

Yeah, alright, I can see this is the way to go.... Now we need testing.

mdreyesm commented 5 years ago

I already tested the change deploying a Clear Linux image with the new binaries using Ironic in baremetal hosts, and it seems to work.

Thank you very much @devimc

-- Logs begin at Thu 2019-04-11 19:12:47 UTC, end at Thu 2019-04-11 19:15:10 UTC. --
Apr 11 19:12:47 clr-705d8793acc04b5e9e95117c01ba4081 systemd[1]: Starting micro-config-drive job...
Apr 11 19:12:47 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [7.602014] micro-config-drive version: 35
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.430918] openstack: Saving instance id '83679162-1378-4288-a2d4-70e13ec132aa'
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.431170] lib: First boot: True
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.431369] lib: Executing: /bin/sh -c "/usr/bin/usermod -p '!' root"
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.432272] Checking disk /dev/sda
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.527748] disk: Found rootfs in block device: /dev/sda2. Start sector: 1048576
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.527779] disk: Rootfs start sector: 1048576
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.527793] disk: Next partition end sector: 7812806655
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.541527] async_task: Executing [701]: /bin/sh -c "/usr/bin/resize2fs /dev/sda2"
Apr 11 19:12:48 clr-705d8793acc04b5e9e95117c01ba4081 ucd[479]: [8.541560] disk: Rootfs block device resized
gorozco1 commented 5 years ago

This is great news, thanks @mdreyesm @devimc

devimc commented 5 years ago

@gorozco1 @mdreyesm cool :smile:

ahkok commented 5 years ago

Thanks a lot for testing this!