<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div></div></span></div></span></div><div><div>On Aug 20, 2012, at 10:11 PM, Shake Chen <<a href="mailto:shake.chen@gmail.com">shake.chen@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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></div></div></blockquote><div><br></div><div><br></div><div>Whoops, I didn't read the original post closely enough. I'm not sure how to manipulate a qcow2 image that was created as a snapshot.</div><br><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><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/">www.nimbisservices.com</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br></span></div></div></body></html>