<div dir="ltr">Hi<div><br></div><div>I use oz create centos image, work perfect for openstack, support resize.</div><div><br></div><div>the step is very simple</div><div><br></div><div>1: hareware machine, install centos6.5</div>
<div>disable selinux</div><div>enable epel </div><div><br></div><div>2: install OZ</div><div><br></div><div>yum -y install oz</div><div><br></div><div>modify the oz setting , let default image is qcow2 </div><div><br></div>
<div>/etc/oz/oz.cfg <br></div><div>image_type = qcow2<br></div><div><br></div><div>restart machine.</div><div><br></div><div>3: create two file centos6.ks and centos65.tdl</div><div><br></div><div>check the attachment. you only need change</div>
<div><br></div><div><a href="http://172.28.0.1/cobbler/ks_mirror/CentOS6.5-x86_64/">http://172.28.0.1/cobbler/ks_mirror/CentOS6.5-x86_64/</a> <br></div><div><br></div><div>to like below link</div><div><br></div><div><a href="http://mirrors.163.com/centos/6.5/os/x86_64/">http://mirrors.163.com/centos/6.5/os/x86_64/</a><br>
</div><div><br></div><div><br></div><div>4: run the command</div><div><br></div><div>oz-install -p -u -d3 -a centos6.ks centos65.tdl</div><div><br></div><div>the image would store <span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:22.27199935913086px">/var/lib/libvirt/images</span><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:22.27199935913086px"> </span></div>
<div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:22.27199935913086px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:22.27199935913086px">5: compress the image</span></div>
<div><div>qemu-img convert -c /var/lib/libvirt/images/centos_65_x86_64.qcow2 -O qcow2 \</div><div>/root/centos_65_x86_64.qcow2</div></div><div><br></div><div>Now the image is ok, upload to openstack</div><div><br></div><div>
the image only support key login</div><div><br></div><div>username is  cloud-user</div><div><br></div><div>you can check the centos6.ks ,the ks is change from <a href="http://repos.fedorapeople.org/repos/openstack/guest-images/">http://repos.fedorapeople.org/repos/openstack/guest-images/</a></div>
<div><br></div><div>I also upload the image, you can try it.</div><div><br></div><div><div><a href="http://yunpan.cn/QiQ6syasRAH7Q">http://yunpan.cn/QiQ6syasRAH7Q</a> </div><div><br></div><div>password: 90e3<br></div></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>
<div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 11:48 AM, Kashyap Chamarthy <span dir="ltr"><<a href="mailto:kchamart@redhat.com" target="_blank">kchamart@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Wed, May 07, 2014 at 02:31:43PM +0000, St. George, Allan L. wrote:<br>
> I haven’t had the time to work with Icehouse yet, but I have outlined<br>
> instruction that are used to create Havana CentOS images that resize<br>
> automatically upon spawning via linux-rootfs-resize.<br>
><br>
> If interested, I’ll forward it along.<br>
<br>
</div>That'd be useful. It'd be even better if you could make a quick RDO wiki<br>
page[1] that'll be indexed by the search engines.<br>
<br>
<br>
[1] <a href="http://openstack.redhat.com/" target="_blank">http://openstack.redhat.com/</a><br>
<br>
PS: If you're a Markdown user, you can convert Markdown -> WikiMedia<br>
(RDO uses WikiMedia for wiki) trivially like this:<br>
<br>
    $ pandoc -f markdown -t Mediawiki <a href="http://foo.md" target="_blank">foo.md</a> -o foo.wiki<br>
<div class=""><br>
><br>
> From: <a href="mailto:rdo-list-bounces@redhat.com">rdo-list-bounces@redhat.com</a> [mailto:<a href="mailto:rdo-list-bounces@redhat.com">rdo-list-bounces@redhat.com</a>]<br>
> On Behalf Of Elías David Sent: Tuesday, May 06, 2014 12:57 PM To:<br>
> Kashyap Chamarthy Cc: <a href="mailto:rdo-list@redhat.com">rdo-list@redhat.com</a> Subject: Re: [Rdo-list]<br>
> Automatic resizing of root partitions in RDO Icehouse<br>
><br>
><br>
> Hi thanks for the answers!<br>
><br>
> But how is the support right now in OpenStack with centos/fedora<br>
> images regarding the auto resizing during boot? does the disk size set<br>
> in the flavor is respected or not, or does it work only with fedora<br>
> and newer kernels than what CentOS uses...things like that is what I'm<br>
> looking for On May 6, 2014 4:09 AM, "Kashyap Chamarthy"<br>
</div>> <<a href="mailto:kchamart@redhat.com">kchamart@redhat.com</a><mailto:<a href="mailto:kchamart@redhat.com">kchamart@redhat.com</a>>> wrote: On Mon, May<br>
<div class="HOEnZb"><div class="h5">> 05, 2014 at 10:22:26PM -0430, Elías David wrote:<br>
> > Hello all,<br>
> ><br>
> > I would like to know what's the current state of auto resizing the<br>
> > root partition in current RDO Icehouse, more specifically, CentOS<br>
> > and Fedora images.<br>
> ><br>
> > I've read many versions of the story so I'm not really sure what<br>
> > works and what doesn't.<br>
> ><br>
> > For instance, I've read that currently, auto resizing of a CentOS<br>
> > 6.5 image for would require the filesystem to be ext3 and I've also<br>
> > read that auto resizing currently works only with kernels >= 3.8, so<br>
> > what's really the deal with this currently?<br>
> ><br>
> > Also, it's as simple as having cloud-init, dracut-modules-growroot<br>
> > and cloud-initramfs-tools installed on the image or are there any<br>
> > other steps required for the auto resizing to work?<br>
><br>
><br>
> I personally find[1] virt-resize (which works the same way on any<br>
> images) very useful when I'd like to do resizing, as it works<br>
> consistent well.<br>
><br>
> I just tried on a Fedora 20 qcow2 cloud image with these below four<br>
> commands and their complete output.<br>
><br>
> 1. Examine the root filesystem size _inside_ the cloud image:<br>
><br>
>     $ virt-filesystems --long --all -h -a fedora-latest.x86_64.qcow2<br>
><br>
>     Name       Type        VFS   Label  MBR  Size  Parent /dev/sda1<br>
>     filesystem  ext4  _/     -    1.9G  - /dev/sda1  partition   -<br>
>     -      83   1.9G  /dev/sda /dev/sda   device      -     -      -<br>
>     2.0G  -<br>
><br>
> 2. Create a new qcow2 disk of 10G:<br>
><br>
>     $ qemu-img create -f qcow2 -o preallocation=metadata \<br>
>     newdisk.qcow2 10G<br>
><br>
> 3. Perform the resize operation:<br>
><br>
>     $ virt-resize --expand /dev/sda1 fedora-latest.x86_64.qcow2 \<br>
>     newdisk.qcow2 Examining fedora-latest.x86_64.qcow2 ...  **********<br>
><br>
>     Summary of changes:<br>
><br>
>     /dev/sda1: This partition will be resized from 1.9G to 10.0G.  The<br>
>     filesystem ext4 on /dev/sda1 will be expanded using the<br>
>     'resize2fs' method.<br>
><br>
>     ********** Setting up initial partition table on newdisk.qcow2 ...<br>
>     Copying /dev/sda1 ...  100%<br>
>     ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧<br>
>     00:00 Expanding /dev/sda1 using the 'resize2fs' method ...<br>
><br>
>     Resize operation completed with no errors.  Before deleting the<br>
>     old disk, carefully check that the resized disk boots and works<br>
>     correctly.<br>
><br>
> 4. Examine the root file system size in the new disk (should reflect<br>
> correctly):<br>
><br>
>     $ virt-filesystems --long --all -h -a newdisk.qcow2 Name<br>
>     Type        VFS   Label  MBR  Size  Parent /dev/sda1  filesystem<br>
>     ext4  _/     -    10G   - /dev/sda1  partition   -     -      83<br>
>     10G   /dev/sda /dev/sda   device      -     -      -    10G   -<br>
><br>
><br>
> Hope that helps.<br>
><br>
><br>
>   [1]<br>
>   <a href="http://kashyapc.com/2013/04/13/resize-a-fedora-19-guest-with-libguestfs-tools/" target="_blank">http://kashyapc.com/2013/04/13/resize-a-fedora-19-guest-with-libguestfs-tools/</a><br>
><br>
><br>
><br>
> -- /kashyap<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Rdo-list mailing list<br>
> <a href="mailto:Rdo-list@redhat.com">Rdo-list@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/rdo-list" target="_blank">https://www.redhat.com/mailman/listinfo/rdo-list</a><br>
<br>
<br>
--<br>
/kashyap<br>
<br>
_______________________________________________<br>
Rdo-list mailing list<br>
<a href="mailto:Rdo-list@redhat.com">Rdo-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/rdo-list" target="_blank">https://www.redhat.com/mailman/listinfo/rdo-list</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Shake Chen<br><br>
</div>