<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-forward-container">
      <div class="moz-forward-container">
        <meta http-equiv="content-type" content="text/html;
          charset=utf-8">
        <b>1. Feature<br>
          <br>
        </b><i>prl_disk_tool resize --resize_partition </i>in-place VM
        disk expand<br>
        <br>
        <b>2. Description</b><br>
        <br>
        the prl_disk_tool utility now can expand VM disks in-place.<br>
        <br>
        <i>prl_disk_tool resize </i>worked in-place even before<br>
        <i>prl_disk_tool resize --resize_partition  </i>now expands
        disk, last partition (in case of logical paritition, the
        extended container as well) and its filesystem.<br>
        <br>
        As before, you will need <br>
        <i>libguestfs-winsupport</i> for last ntfs partition<br>
        <i>libguestfs-xfs </i>for last xfs partition<br>
        <i>btrfs-progs </i>for last btrfs partition<br>
        <br>
        <br>
        The approximate algorithm is as following (for GPT):<br>
        1) part-list -&gt; (start, end); blockdev-getsize64 -&gt;
        diskEnd; store partition attrs<br>
        2) create overlay image of size newSize on top of current<br>
        3) debug sh 'sgdisk -e /dev/sdaN' (working on libguestfs API)<br>
        4) part-del /dev/sda N<br>
        5) part-add /dev/sda attrs.type start (blockdev-getsize64 -
        (diskEnd - end))<br>
        6) restore partition attrs<br>
        7) stretch filesystem (resize2fs, ntfsresize etc)<br>
        8) prl_disk_tool merge --external overlay (qemu-img commit)<br>
        <br>
        For MBR, we avoid step (3) and repeat (4)-(5) for extended
        partition before resizing logical (if needed).<br>
        <br>
        <br>
        If something goes wrong before (8), we just remove overlay and
        nothing will change to original image.<br>
        Overlay is lightweight: for 1GB full disk it used only 6.3Mb of
        space (I think it's affordable).<br>
        <br>
        <b>3. Products</b><br>
        <br>
        Virtuozzo 7<br>
        <br>
        Packages:<b><br>
        </b>
        <ul>
          <li>prl-disk-tool &gt;= 7.0.7</li>
          <li>libguestfs &gt;= 1.31.7</li>
          <li> btrfs-progs &gt;= 4.2 (optional)<br>
          </li>
          <li>libguestfs-winsupport &gt;= 7.2.1 (optional)<br>
          </li>
          <li>libguestfs-xfs (in dependencies)<br>
          </li>
          <li>qemu-img &gt;= 1.5.3-86</li>
        </ul>
        <b>4. Testing</b><br>
        <br>
        Need to test the following cases:<br>
        <ul>
          <li><i>resize --resize_partition </i>works for
            ext2/ext3/ext4/ntfs/btrfs/xfs/swap last partitions</li>
          <li>it works for GPT partitions, preserving partition
            attributes</li>
          <li>it works for MBR partitions (primary/extended/logical),
            preserving partition attributes.<br>
          </li>
        </ul>
        <p><b>5. Known issues<br>
          </b></p>
        <ul>
          <li>only listed filesystems are supported</li>
          <li>LVM is not supported (working on it)</li>
          <li>GPT disk GUID is not preserved (it may cause specific OSes
            to fail - need to check which ones)</li>
          <li>Resizing drops internal snapshots (working on it)<br>
          </li>
        </ul>
        <p><span id="OLK_SRC_BODY_SECTION"> </span></p>
        <pre class="moz-signature" cols="72">-- 
Your sincerely,
Maxim Perevedentsev</pre>
        <br>
      </div>
      <br>
      <br>
    </div>
    <br>
  </body>
</html>