cloud-init fails to extend the disk size when launched as an openstack-instance
I've created a RHEL 7.1 cloud-image for use with openstack. The image however does not use the entire disk allocated to it when launched with different disk sizes. I can see that the cloud.cfg file does include the growpart and resizefs modules. But it doesn't seem to actually grow the disk size. Does anyone know how to fix it?
Responses
With RHEL 6 you had to update your initramfs include the pre-mount script that includes the the growroot modules.
I haven't had time to see if the 3.x kernel used by RHEL 7 includes the dynamic-resize hooks or not. If it doesn't, then you might want to see if your RHEL 7 image includes the requisite initramfs modules.
While I made my solution for AWS, similar should work for OpenStack-based installations (I've tested the method in VMware and VirtualBox) the process in my AMI-generation via this script embedded in my workflow. Note that, in order for that script to produce proper functionality, you'll also need to hack the module that gets installed. I've coded that modification up in this script.
Since you're using RHEL 7, its kernel should support more-dynamic disk-growth without the above kludgery. If you've installed the cloud-utils-growpart as part of your template's RPM manifest, the requisite modules should already be in your kernel. The only remaining bit of fiddling would be if you're using LVM under your OpenStack EL7 template. At launch-time, that's overcome by adding:
runcmd:
- pvresize /dev/<LVMed_Partition>
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
