[Openstack] How to create a Image which can extend the partition automatically.

Scott Moser smoser at ubuntu.com
Tue Mar 5 14:04:39 UTC 2013


On Tue, 5 Mar 2013, Sylvain Bauza wrote:

> If you look at
> http://www.pixelbeat.org/docs/openstack_libvirt_images/#1361764412, you'll see
> that resize2fs is performed. But there is a caveat with RHEL6 which is Linux
> 2.6 (contrary to Ubuntu 12.04 which is Linux 3.0).
> If you look at "man resize2fs" :

Please don't do this, or rely on this.  Having the hypervisor do this for
your guest is simply wrong.  Hypervisors should know little to nothing
about the internals of the instances they're launching.

Please see this thread:
http://www.gossamer-threads.com/lists/openstack/dev/23572?do=post_view_threaded#23572

That describes how to do this the right way, and wont have the host OS
accidentally break your filesystem or lose your data because it didn't
realize you were running some filesystem it didn't have perfect support
for.

Other points:
 * I've just added the ability for growpart to run outside the
   initramfs and still function.  This same functionality is available in
   patched versions of parted also (resizepart), but not yet in upstream.
   https://code.launchpad.net/~psusi/ubuntu/raring/parted/resize/+merge/151401
 * Juerg added support for cloud-initramfs-utils to run in fedora/rhel and
   drakut
 * I'm adding support for cloud-init to do this rather than have it from
   cloud-initramfs-utils.  I suspect that in some point in the future, the
   requirements for "just works" will be:
    * cloud-init 0.7.2
    * (cloud-utils 0.27 | parted 3.2): after Philip Susi's work for
      'resizepart' lands.
    * kernel > 3.8
 * for what currently works:
    * cloud-initramfs-utils (0.20 or from trunk)
    * cloud-init > 0.7 (cloud-init invokes resize2fs)

   You'll need cloud-utils 0.27 and sgdisk to get GPT resizing support.
   Dos partition format requires sfdisk (from util-linux).




More information about the Openstack mailing list