osuosl/ganeti-instance-image — pull request #12 by rowanthorpe (2014-12-01 16:07:46+00:00)
Title: Add pre-mount hook-handling&partition resize hook

This adds handling for a run-parts dir for pre-mount customisations, and includes a hook for resizing the root partition of an instance created from a qemu-image (other than windows images), so it uses all remaining space on the disk (for when the image size is smaller than the requested disk size). It also includes offline-resizing of the filesystem (I have added detection code and resize2fs for ext2/3/4, and it is trivial to swap in code for other FSes). This of course requires instances (other than windows) to have the same partition layout that is required from tarball and dump images. If that is too restrictive to apply to *all* qemu images, it would be straightforward to add a parameter (e.g. img_resize=true/false) to dictate whether to resize (and require a set partition layout) or not when using qemu-images (default off). Let me know if you want me to add that. Also, ideally dmsetup should be added into the autoconf machinery to handle dependency correctly rather than hard-coded in the hook (I just didn't have time today, if it is essential before merging this, I could rebase with that change when I find more time...).