<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">V/R,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></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"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></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:elias.moreno.tec@gmail.com]
<br>
<b>Sent:</b> Saturday, May 10, 2014 12:59 PM<br>
<b>To:</b> St. George, Allan L.<br>
<b>Cc:</b> Kashyap Chamarthy; rdo-list@redhat.com<br>
<b>Subject:</b> Re: [Rdo-list] Automatic resizing of root partitions in RDO Icehouse<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hey, thanks! this method indeed worked nicely with CentOS 6.5 image in RDO Icehouse! :D<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></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<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I also tried the oz-install method but it failed everytime with the following exception:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">"raise oz.OzException.OzException("No disk activity in %d seconds, failing. %s" % (inactivity_timeout, screenshot_text))"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></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...) <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Anyhow, thank you all for the help and tips! very appreciated ;)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Any chance to include this method in RDO docs?<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></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:<o:p></o:p></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<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
-----Original Message-----<br>
From: Kashyap Chamarthy [mailto:<a href="mailto:kchamart@redhat.com">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">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">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>
> <<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>
> 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">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<o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Elías David.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>