← Back to team overview

openstack team mailing list archive

Re: How to create a Image which can extend the partition automatically.

 

On 03/05/2013 02:04 PM, Scott Moser wrote:
> 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.

Just to point out the alternative for when the VM doesn't
have the smarts to resize itself, is to use something like virt-resize:
https://blueprints.launchpad.net/nova/+spec/resize-no-raw

> 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

Juerg has cloud-utils for RHEL available here:
http://kojipkgs.fedoraproject.org/packages/cloud-utils/0.27/0.2.bzr216.el6/noarch/
And cloud-initramfs-utils under dev here:
https://bugzilla.redhat.com/916087

>  * 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).

thanks for the info,
Pádraig.



Follow ups

References