[Rdo-list] Automatic resizing of root partitions in RDO Icehouse
St. George, Allan L.
ALLAN.L.ST.GEORGE at leidos.com
Wed May 7 14:31:43 UTC 2014
I haven’t had the time to work with Icehouse yet, but I have outlined instruction that are used to create Havana CentOS images that resize automatically upon spawning via linux-rootfs-resize.
If interested, I’ll forward it along.
V/R,
Allan
From: rdo-list-bounces at redhat.com [mailto:rdo-list-bounces at redhat.com] On Behalf Of Elías David
Sent: Tuesday, May 06, 2014 12:57 PM
To: Kashyap Chamarthy
Cc: rdo-list at redhat.com
Subject: Re: [Rdo-list] Automatic resizing of root partitions in RDO Icehouse
Hi thanks for the answers!
But how is the support right now in OpenStack with centos/fedora images regarding the auto resizing during boot? does the disk size set in the flavor is respected or not, or does it work only with fedora and newer kernels than what CentOS uses...things like that is what I'm looking for
On May 6, 2014 4:09 AM, "Kashyap Chamarthy" <kchamart at redhat.com<mailto:kchamart at redhat.com>> wrote:
On Mon, May 05, 2014 at 10:22:26PM -0430, Elías David wrote:
> Hello all,
>
> I would like to know what's the current state of auto resizing the root
> partition in current RDO Icehouse, more specifically, CentOS and Fedora
> images.
>
> I've read many versions of the story so I'm not really sure what works and
> what doesn't.
>
> For instance, I've read that currently, auto resizing of a CentOS 6.5 image
> for would require the filesystem to be ext3 and I've also read that auto
> resizing currently works only with kernels >= 3.8, so what's really the
> deal with this currently?
>
> Also, it's as simple as having cloud-init, dracut-modules-growroot and
> cloud-initramfs-tools installed on the image or are there any other steps
> required for the auto resizing to work?
I personally find[1] virt-resize (which works the same way on any
images) very useful when I'd like to do resizing, as it works consistent
well.
I just tried on a Fedora 20 qcow2 cloud image with these below four commands
and their complete output.
1. Examine the root filesystem size _inside_ the cloud image:
$ virt-filesystems --long --all -h -a fedora-latest.x86_64.qcow2
Name Type VFS Label MBR Size Parent
/dev/sda1 filesystem ext4 _/ - 1.9G -
/dev/sda1 partition - - 83 1.9G /dev/sda
/dev/sda device - - - 2.0G -
2. Create a new qcow2 disk of 10G:
$ qemu-img create -f qcow2 -o preallocation=metadata \
newdisk.qcow2 10G
3. Perform the resize operation:
$ virt-resize --expand /dev/sda1 fedora-latest.x86_64.qcow2 \
newdisk.qcow2
Examining fedora-latest.x86_64.qcow2 ...
**********
Summary of changes:
/dev/sda1: This partition will be resized from 1.9G to 10.0G. The
filesystem ext4 on /dev/sda1 will be expanded using the 'resize2fs'
method.
**********
Setting up initial partition table on newdisk.qcow2 ...
Copying /dev/sda1 ...
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
Expanding /dev/sda1 using the 'resize2fs' method ...
Resize operation completed with no errors. Before deleting the old
disk, carefully check that the resized disk boots and works correctly.
4. Examine the root file system size in the new disk (should reflect
correctly):
$ virt-filesystems --long --all -h -a newdisk.qcow2
Name Type VFS Label MBR Size Parent
/dev/sda1 filesystem ext4 _/ - 10G -
/dev/sda1 partition - - 83 10G /dev/sda
/dev/sda device - - - 10G -
Hope that helps.
[1] http://kashyapc.com/2013/04/13/resize-a-fedora-19-guest-with-libguestfs-tools/
--
/kashyap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rdoproject.org/pipermail/dev/attachments/20140507/2cafd261/attachment.html>
More information about the dev
mailing list