Difference between revisions of "Prl-disk-tool for Virtuozzo 7"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(added category)
(make trd more readable)
 
Line 9: Line 9:
 
can perform the following operations:
 
can perform the following operations:
  
# ''resize --size ...'' : Resize image (in-place)
+
# <code>resize --size ...</code> : Resize image (in-place)
# ''resize --size ... --resize_partition'' : Resize image and last partition to fit (copying)
+
# <code>resize --size ... --resize_partition</code> : Resize image and last partition to fit (copying)
# ''resize --info'' : Display resize estimates (current size, minimum size, minimum size w/o resizing last partition) - '''VM only'''
+
# <code>resize --info</code> : Display resize estimates (current size, minimum size, minimum size w/o resizing last partition) - '''VM only'''
# ''compact'' : Compact image to occupy less space on host disk. (in-place)
+
# <code>compact</code> : Compact image to occupy less space on host disk. (in-place)
# ''compact --info'' : Display compact estimates (block count, allocated, used) - '''VM only'''
+
# <code>compact --info</code> : Display compact estimates (block count, allocated, used) - '''VM only'''
# ''merge'' : Merge internal snapshots of image (in-place) - '''VM only'''
+
# <code>merge</code> : Merge internal snapshots of image (in-place) - '''VM only'''
# ''merge --external'' : Merge external snapshot of image (in-place) - '''VM only'''
+
# <code>merge --external</code> : Merge external snapshot of image (in-place) - '''VM only'''
# ''convert [--plain | --expanding]'' : Convert image between plain and expanding modes (copying) - '''VM only'''
+
# <code>convert [--plain | --expanding]</code> : Convert image between plain and expanding modes (copying) - '''VM only'''
  
prl_disk_tool uses [http://libguestfs.org/ libguestfs], [http://wiki.qemu.org/download/qemu-doc.html#qemu_005fimg_005finvocation qemu-img] to work.
+
<code>prl_disk_tool</code> uses [http://libguestfs.org/ libguestfs], [http://wiki.qemu.org/download/qemu-doc.html#qemu_005fimg_005finvocation qemu-img] to work.
  
 
The user has to install additional packages to use part of functionality:
 
The user has to install additional packages to use part of functionality:
  
* ''prl-disk-tool resize --info'' (last partition: btrfs) → btrfs-progs >= 4.2 (already in repo)
+
* <code>prl-disk-tool resize --info</code> (last partition: btrfs) → btrfs-progs >= 4.2 (already in repo)
* ''prl-disk-tool resize {--info,--resize_partition}'' (last partition: ntfs) → libguestfs-winsupport (already in repo)
+
* <code>prl-disk-tool resize {--info,--resize_partition}</code> (last partition: ntfs) → libguestfs-winsupport (already in repo)
* ''prl-disk-tool compact {--info,}'' (exists partition with ntfs) → libguestfs-winsupport
+
* <code>prl-disk-tool compact {--info,}</code> (exists partition with ntfs) → libguestfs-winsupport
  
 
prl_disk_tool locks an image passed as argument by flock(). So only multiple
 
prl_disk_tool locks an image passed as argument by flock(). So only multiple
reads (''{compact,resize} --info'') OR a single write (others) are allowed.
+
reads (<code>{compact,resize} --info</code>) OR a single write (others) are allowed.
  
FS-aware functions (''resize {--resize_partition|--info}, compact [--info]'') work
+
FS-aware functions (<code>resize {--resize_partition|--info}, compact [--info]</code>) work for ext2/ext3/ext4/ntfs/btrfs/xfs.
for ext2/ext3/ext4/ntfs/btrfs/xfs.
 
  
prl_disk_tool uses qemu-img to perform fs-unaware operations. It is more
+
<code>prl_disk_tool</code> uses <code>qemu-img</code> to perform fs-unaware operations. It is more powerful than qemu-img due to fs-aware operations performed with libguestfs.
powerful than qemu-img due to fs-aware operations performed with libguestfs.
 
  
The main purpose of prl_disk_tool is to automate some frequent operations.
+
The main purpose of <code>prl_disk_tool</code> is to automate some frequent operations.
  
 
=== 3. Products ===
 
=== 3. Products ===
Line 50: Line 48:
 
* qemu-img >= 1.5.3-86
 
* qemu-img >= 1.5.3-86
  
=== 4. Testing ===
+
=== Testing ===
  
 
Need to test the following cases:
 
Need to test the following cases:
Line 56: Line 54:
 
* All functions work for qcow2 images.
 
* All functions work for qcow2 images.
 
* Functions not tagged as '''VM only''' work for ploop images.
 
* Functions not tagged as '''VM only''' work for ploop images.
* FS-aware functions (''resize --resize_partition|--info, compact [--info]'') work for ext2/ext3/ext4/ntfs/btrfs/xfs.
+
* FS-aware functions (<code>resize --resize_partition|--info, compact [--info]</code>) work for ext2/ext3/ext4/ntfs/btrfs/xfs.
  
=== 5. Known issues ===
+
=== Known issues ===
  
* ''resize --resize_partition'' should be implemented in-place (due tolimitations of qcow2, only for expanding)
+
* <code>resize --resize_partition</code> should be implemented in-place (due tolimitations of qcow2, only for expanding)
* all modifying operations have ''--dry-run'' option to not modify an image. The image is still opened for write, and exclusive lock is acquired.
+
* all modifying operations have <code>--dry-run</code> option to not modify an image. The image is still opened for write, and exclusive lock is acquired.
 
* only listed filesystems are supported
 
* only listed filesystems are supported
* virt-resize, used by ''resize --resize_partition'', leaves an empty block of ~3M at the end of image.
+
* virt-resize, used by <code>resize --resize_partition</code>, leaves an empty block of ~3M at the end of image.
* ''convert --plain'' fallocate()s space inaccurately (due to unawareness of qcow2 internal structures).
+
* <code>convert --plain</code> fallocate()s space inaccurately (due to unawareness of qcow2 internal structures).
* ''resize [expand]'' after ''convert --plain'' does not force allocation of new (bigger) chunk of space (we do not keep image type (plain/expanding) for now - so it is impossible to determine whether we should allocate space outside of ''convert'' operation)
+
* <code>resize [expand]</code> after <code>convert --plain</code> does not force allocation of new (bigger) chunk of space (we do not keep image type (plain/expanding) for now - so it is impossible to determine whether we should allocate space outside of <code>convert</code> operation)
  
  

Latest revision as of 13:40, 21 December 2015

1. Feature[edit]

prl_disk_tool for Virtuozzo 7

2. Description[edit]

The package prl-disk-tool (binary /usr/sbin/prl_disk_tool) is used to manage virtual machine and container disk images can perform the following operations:

  1. resize --size ... : Resize image (in-place)
  2. resize --size ... --resize_partition : Resize image and last partition to fit (copying)
  3. resize --info : Display resize estimates (current size, minimum size, minimum size w/o resizing last partition) - VM only
  4. compact : Compact image to occupy less space on host disk. (in-place)
  5. compact --info : Display compact estimates (block count, allocated, used) - VM only
  6. merge : Merge internal snapshots of image (in-place) - VM only
  7. merge --external : Merge external snapshot of image (in-place) - VM only
  8. convert [--plain | --expanding] : Convert image between plain and expanding modes (copying) - VM only

prl_disk_tool uses libguestfs, qemu-img to work.

The user has to install additional packages to use part of functionality:

  • prl-disk-tool resize --info (last partition: btrfs) → btrfs-progs >= 4.2 (already in repo)
  • prl-disk-tool resize {--info,--resize_partition} (last partition: ntfs) → libguestfs-winsupport (already in repo)
  • prl-disk-tool compact {--info,} (exists partition with ntfs) → libguestfs-winsupport

prl_disk_tool locks an image passed as argument by flock(). So only multiple reads ({compact,resize} --info) OR a single write (others) are allowed.

FS-aware functions (resize {--resize_partition|--info}, compact [--info]) work for ext2/ext3/ext4/ntfs/btrfs/xfs.

prl_disk_tool uses qemu-img to perform fs-unaware operations. It is more powerful than qemu-img due to fs-aware operations performed with libguestfs.

The main purpose of prl_disk_tool is to automate some frequent operations.

3. Products[edit]

Virtuozzo 7 beta2

Packages:

  • prl-disk-tool >= 7.0.5
  • libguestfs >= 1.28.1-1.18
  • btrfs-progs >= 4.2 (optional)
  • libguestfs-winsupport >= 7.2.1 (optional)
  • libguestfs-xfs (in dependencies)
  • qemu-img >= 1.5.3-86

Testing[edit]

Need to test the following cases:

  • All functions work for qcow2 images.
  • Functions not tagged as VM only work for ploop images.
  • FS-aware functions (resize --resize_partition|--info, compact [--info]) work for ext2/ext3/ext4/ntfs/btrfs/xfs.

Known issues[edit]

  • resize --resize_partition should be implemented in-place (due tolimitations of qcow2, only for expanding)
  • all modifying operations have --dry-run option to not modify an image. The image is still opened for write, and exclusive lock is acquired.
  • only listed filesystems are supported
  • virt-resize, used by resize --resize_partition, leaves an empty block of ~3M at the end of image.
  • convert --plain fallocate()s space inaccurately (due to unawareness of qcow2 internal structures).
  • resize [expand] after convert --plain does not force allocation of new (bigger) chunk of space (we do not keep image type (plain/expanding) for now - so it is impossible to determine whether we should allocate space outside of convert operation)


Links[edit]