<div dir="ltr">Hey!<div><br></div><div>I documented it here: <a href="http://openstack.redhat.com/Creating_CentOS_and_Fedora_images_ready_for_Openstack">http://openstack.redhat.com/Creating_CentOS_and_Fedora_images_ready_for_Openstack</a></div>

<div><br></div><div>Odd thing though, when I was doing the previews all looked ok, upon saving the margins where off :-/ in any case, the doc is there, feel free to add anything I could've missed ;)</div><div><br></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 13, 2014 at 8:47 AM, St. George, Allan L. <span dir="ltr"><<a href="mailto:ALLAN.L.ST.GEORGE@leidos.com" target="_blank">ALLAN.L.ST.GEORGE@leidos.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Great, I’m glad it helped.  I wanted my spawn to automatically join/report to foreman, which is why I included it on my image.<u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m not familiar with RDO docs, but I wouldn’t have any problem with the document being posted.<u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">V/R,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Allan</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Elías David [mailto:<a href="mailto:elias.moreno.tec@gmail.com" target="_blank">elias.moreno.tec@gmail.com</a>]
<br>
<b>Sent:</b> Saturday, May 10, 2014 12:59 PM</span></p><div class=""><br>
<b>To:</b> St. George, Allan L.<br>
</div><b>Cc:</b> Kashyap Chamarthy; <a href="mailto:rdo-list@redhat.com" target="_blank">rdo-list@redhat.com</a><div><div class="h5"><br>
<b>Subject:</b> Re: [Rdo-list] Automatic resizing of root partitions in RDO Icehouse<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hey, thanks! this method indeed worked nicely with CentOS 6.5 image in RDO Icehouse! :D<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I didn't do the puppet part since I've no puppet server to test but it wasn't needed, also I used virt-sparcify instead of step 13 qemu-image convert<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I also tried the oz-install method but it failed everytime with the following exception:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">"raise oz.OzException.OzException("No disk activity in %d seconds, failing.  %s" % (inactivity_timeout, screenshot_text))"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">No matter the install type (url or iso) and didn't matter creating this in different machines with different specs (more ram, cpu, fast disks...) <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Anyhow, thank you all for the help and tips! very appreciated ;)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Any chance to include this method in RDO docs?<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, May 9, 2014 at 8:34 AM, St. George, Allan L. <<a href="mailto:ALLAN.L.ST.GEORGE@leidos.com" target="_blank">ALLAN.L.ST.GEORGE@leidos.com</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">I'm sure someone could make this better, but this is what I've been using and it works well:<br>
<br>
V/R,<br>
<br>
Allan<br>
<br>
1. Create disk image with QCOW2 format<br>
<br>
qemu-img create -f qcow2 /tmp/centos-6.5-working.qcow2 10G<br>
<br>
2. Install CentOS; Install onto a single ext4 partition mounted to “/” (no /boot, /swap, etc.)<br>
<br>
virt-install --virt-type {kvm or qemu} --name centos-6.5 --ram 1024 \<br>
--cdrom=/tmp/CentOS-6.5-x86_64-minimal.iso \<br>
--disk /tmp/centos-6.5-working.qcow2,format=qcow2 \<br>
--network network=default \<br>
--graphics vnc,listen=0.0.0.0 --noautoconsole \<br>
--os-type=linux --os-variant=rhel6<br>
<br>
3. Eject the disk and reboot the virtual machine<br>
<br>
virsh attach-disk --type cdrom --mode readonly centos-6.5 "" hdc<br>
virsh destroy centos-6.5<br>
virsh start centos-6.5<br>
<br>
4. After reboot, login into your new image and modify '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this<br>
<br>
DEVICE="eth0"<br>
BOOTPROTO="dhcp"<br>
NM_CONTROLLED="no"<br>
ONBOOT="yes"<br>
TYPE="Ethernet"<br>
<br>
5. Add EPEL repository and update OS<br>
<br>
rpm -ivh <a href="http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm" target="_blank">
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm</a><br>
rpm -ivh <a href="https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm" target="_blank">
https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm</a><br>
<br>
6. Update yum and install cloud-init<br>
<br>
yum -y update<br>
yum install cloud-utils cloud-init parted git<br>
cd /tmp<br>
git clone <a href="https://github.com/flegmatik/linux-rootfs-resize.git" target="_blank">
https://github.com/flegmatik/linux-rootfs-resize.git</a> (installed in place of cloud-initramfs-tools)<br>
cd linux-rootfs-resize<br>
./install<br>
<br>
Edit /etc/cloud/cloud.cfg<br>
<br>
Add the line:<br>
<br>
user: ec2-user<br>
        Under “cloud_init_modules”, add:<br>
                - resolv-conf<br>
<br>
7. Install and configure puppet<br>
<br>
yum install puppet<br>
edit /etc/hosts and add entry for foreman<br>
edit /etc/puppet/puppet.conf and add the following lines:<br>
<br>
        [main]<br>
                pluginsync = true<br>
        [agent]<br>
                runinterval=1800<br>
                server = {server.domain}<br>
                chkconfig puppet on<br>
<br>
8. Enable the instance to access the metadata service<br>
<br>
echo "NOZEROCONF=yes" >> /etc/sysconfig/network<br>
<br>
9. Configure /etc/ssh/sshd_config<br>
<br>
        Uncomment the following lines:<br>
<br>
                PermitRootLogin  yes<br>
                PasswordAuthentication  yes<br>
<br>
10. Power down your virtual Centos machine<br>
<br>
11. Clean up the virtual machine of MAC address, etc.<br>
<br>
virt-sysprep -d centos-6.5<br>
<br>
12. Undefine the libvirt domain<br>
<br>
virsh undefine centos-6.5<br>
<br>
13. Compress QCOW2 image with<br>
<br>
qemu-img convert -c /tmp/centos-6.5-working.qcow2 -O qcow2 /tmp/centos.qcow2<br>
<br>
<br>
Image /tmp/centos-6.5.qcow2 is now ready for upload to Openstack<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
-----Original Message-----<br>
From: Kashyap Chamarthy [mailto:<a href="mailto:kchamart@redhat.com" target="_blank">kchamart@redhat.com</a>]<br>
Sent: Wednesday, May 07, 2014 11:49 PM<br>
To: St. George, Allan L.<br>
Cc: <a href="mailto:rdo-list@redhat.com" target="_blank">rdo-list@redhat.com</a>; Elías David<br>
Subject: Re: [Rdo-list] Automatic resizing of root partitions in RDO Icehouse<br>
<br>
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>
That'd be useful. It'd be even better if you could make a quick RDO wiki 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 (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>
<br>
><br>
> From: <a href="mailto:rdo-list-bounces@redhat.com" target="_blank">rdo-list-bounces@redhat.com</a> [mailto:<a href="mailto:rdo-list-bounces@redhat.com" target="_blank">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" target="_blank">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>
> <<a href="mailto:kchamart@redhat.com" target="_blank">kchamart@redhat.com</a><mailto:<a href="mailto:kchamart@redhat.com" target="_blank">kchamart@redhat.com</a>>> wrote: On Mon, May<br>
> 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>
>     <span style="font-family:"Cambria Math","serif"">⟦</span>▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒<span style="font-family:"Cambria Math","serif"">⟧</span><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>
><br>
> <a href="http://kashyapc.com/2013/04/13/resize-a-fedora-19-guest-with-libguestf" target="_blank">
http://kashyapc.com/2013/04/13/resize-a-fedora-19-guest-with-libguestf</a><br>
> s-tools/<br>
><br>
><br>
><br>
> -- /kashyap<br>
<br>
> _______________________________________________<br>
> Rdo-list mailing list<br>
> <a href="mailto:Rdo-list@redhat.com" target="_blank">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<u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Elías David.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Elías David.</div>
</div>