<br><br><div class="gmail_quote">On Tue, Aug 21, 2012 at 9:04 AM, 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 style="word-wrap:break-word"><br><div><div class="im"><div>On Aug 20, 2012, at 12:47 PM, Samuel Winchenbach <<a href="mailto:swinchen@gmail.com" target="_blank">swinchen@gmail.com</a>> wrote:</div><br><blockquote type="cite">
Hi all,<br><br>I launched a large (100 GB) VM and made the changes I wanted<br>(installed software, created users, etc...)  and made a snapshot.<br>Now I would like to launch VMs from that snapshot with a smaller disk<br>
size, but no mater what flavor I select it always creates a 100GB<br>image.<br><br>Is there a way to reduce the ext4 partition size inside the qcow2 disk<br>image?   It might involve creating a new image file and cloning over<br>
the original image?  If so what tools do you use for the cloning?<br><br></blockquote></div><div>Sam:</div><div><br></div><div>You can mount the qcow2 image in your file system using qemu-nbd (see <a href="http://en.wikibooks.org/wiki/QEMU/Images#Mounting_an_image_on_the_host" target="_blank">http://en.wikibooks.org/wiki/QEMU/Images#Mounting_an_image_on_the_host</a>) and then resize the partition using the e2fsprogs tools (e.g., see <a href="http://en.positon.org/post/Resize-an-ext3-ext4-partition" target="_blank">http://en.positon.org/post/Resize-an-ext3-ext4-partition</a>).</div>
<div><br></div><div><br></div><div>I believe you can also use libguestfs <<a href="http://libguestfs.org/" target="_blank">http://libguestfs.org/</a>> as an alternative to qemu-nbd, but I've never tried it.</div>
<div><br></div><div><br></div></div></div></blockquote><div><br>whether is possible done it auto when create snapshot?<br><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div></div><div><br></div><div><div><span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word">
<div>Take care,</div><div><br></div><div>Lorin</div><div>--</div><div>Lorin Hochstein</div><div>Lead Architect - Cloud Services</div><div>Nimbis Services, Inc.</div><div><a href="https://www.nimbisservices.com/" target="_blank">www.nimbisservices.com</a></div>
<div><br></div></div></span><br></div><br><br></span></div></div></div></div><br>_______________________________________________<br>
OpenStack-operators mailing list<br>
<a href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Shake Chen<br><br><br>