<div dir="ltr">Just a follow up on this thread for any future Googlers, cloud-init from EPEL does not actually perform this task for you. With Ubuntu you can use growpart from cloud-utils. However, at this time, cloud-utils is not available for CentOS.<div>

<br></div><div>The best way to accomplish this is to customize the ramdisk in the image to resize the partition and filesystem on boot. I used the following tutorials during this process:</div><div><a href="https://thunked.org/stefan/howto-shrink-remote-root-filesystem">https://thunked.org/stefan/howto-shrink-remote-root-filesystem</a><br>
</div><div><a href="http://www.landley.net/writing/rootfs-programming.html">http://www.landley.net/writing/rootfs-programming.html</a><br></div><div><br></div><div style>You will want to import the following binaries (and lib dependencies):</div>
<div style>e2fsck</div><div style>fdisk (or another partition table editor)</div><div style>resize2fs</div><div style>partprobe</div><div style><br></div><div style>Here is what my (very basic) re-sizing looks like (sysadmins, hide your eyes):</div>
<div style><div>/sbin/e2fsck -p -f /dev/vda1 1>/dev/null</div><div>echo -n "Resizing root partition...."</div><div>(echo "d 1"; echo n; echo p; echo 1; echo ; echo ; echo w) | /sbin/fdisk /dev/vda &>/dev/null</div>
<div>echo " complete."</div><div>/sbin/partprobe</div><div>/sbin/e2fsck -p -f /dev/vda1 1>/dev/null</div><div>echo -n "Resizing root filesystem...."</div><div>/sbin/resize2fs /dev/vda1 1>/dev/null</div>
<div>echo " complete."</div><div><br></div></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 7, 2013 at 7:23 PM, Jacob Godin <span dir="ltr"><<a href="mailto:jacobgodin@gmail.com" target="_blank">jacobgodin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Great, that seems to be exactly what I need! Thanks Lorin</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sat, Apr 6, 2013 at 5:18 PM, Lorin Hochstein <span dir="ltr"><<a href="mailto:lorin@nimbisservices.com" target="_blank">lorin@nimbisservices.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Jacob:<div><br></div><div>You can configure a raw or qcow2 image to resize on boot so it uses the entire primary root disk. See the "Support resizing" section of the OpenStack Compute Admin guide for more details:</div>


<div><br></div><div><a href="http://docs.openstack.org/folsom/openstack-compute/admin/content/image-customizing-what-you-need-to-know.html#support-resizing" target="_blank">http://docs.openstack.org/folsom/openstack-compute/admin/content/image-customizing-what-you-need-to-know.html#support-resizing</a></div>


<div><br></div><div>I believe that if cloud-init is installed, it will resize the root partition for you by default, although I haven't tested this myself. For CentOS images, you can install cloud-init from EPEL. </div>


<div><br></div><div>Lorin</div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Sat, Apr 6, 2013 at 3:05 PM, Jacob Godin <span dir="ltr"><<a href="mailto:jacobgodin@gmail.com" target="_blank">jacobgodin@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Lorin,<div><br></div><div>It was my understanding that this was the way to have a dynamic root disk. So I can have, say, a 5GB instance and a 100GB instance use the same image, rather than limiting the size root FS and giving the rest as ephemeral storage.</div>



<div><br></div><div>@Abel: Ubuntu images work just fine</div><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 6, 2013 at 12:58 PM, Lorin Hochstein <span dir="ltr"><<a href="mailto:lorin@nimbisservices.com" target="_blank">lorin@nimbisservices.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Out of curiosity, why did you decide to create AMI/ARI/AKI format images instead of qcow2? Curious because I thought that was a legacy thing that nobody did anymore. </p>



<div>—<br>Sent from <a href="https://bit.ly/SZvoJe" target="_blank">Mailbox</a> for iPhone</div><div><div><br><br><div class="gmail_quote"><p>On Fri, Apr 5, 2013 at 11:32 AM, Jacob Godin <span dir="ltr"><<a href="mailto:jacobgodin@gmail.com" target="_blank">jacobgodin@gmail.com</a>></span> wrote:<br>



</p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I have created a CentOS image using the AMI + AKI + ARI method (same as I used to create my Ubuntu images). I am able to successfully upload and launch the image at first. When trying to launch the third+ instances, they simply get stuck in a bootloop after the 'Booting from ROM...'.</div>




<div><br></div><div>Even if I delete the original two images, I am unable to boot. The only way to get a CentOS image to successfully boot is to re-upload the image.</div><div><br></div><div>Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS for instances.</div>




</div></blockquote></div><br></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div dir="ltr">Lorin Hochstein<br><div>Lead Architect - Cloud Services</div><div>Nimbis Services, Inc.</div>

<div><a href="http://www.nimbisservices.com" target="_blank">www.nimbisservices.com</a></div>
</div>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>