Editing Prl-disk-tool for Virtuozzo 7
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 9: | Line 9: | ||
can perform the following operations: | can perform the following operations: | ||
− | # | + | # ''resize --size ...'' : Resize image (in-place) |
− | # | + | # ''resize --size ... --resize_partition'' : 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''' |
− | # | + | # ''compact'' : Compact image to occupy less space on host disk. (in-place) |
− | # | + | # ''compact --info'' : Display compact estimates (block count, allocated, used) - '''VM only''' |
− | # | + | # ''merge'' : Merge internal snapshots of image (in-place) - '''VM only''' |
− | # | + | # ''merge --external'' : Merge external snapshot of image (in-place) - '''VM only''' |
− | # | + | # ''convert [--plain | --expanding]'' : 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. | |
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) |
− | * | + | * ''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 | prl_disk_tool locks an image passed as argument by flock(). So only multiple | ||
− | reads ( | + | reads (''{compact,resize} --info'') OR a single write (others) are allowed. |
− | FS-aware functions ( | + | 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 | + | The main purpose of prl_disk_tool is to automate some frequent operations. |
=== 3. Products === | === 3. Products === | ||
Line 48: | Line 50: | ||
* qemu-img >= 1.5.3-86 | * qemu-img >= 1.5.3-86 | ||
− | === Testing === | + | === 4. Testing === |
Need to test the following cases: | Need to test the following cases: | ||
Line 54: | Line 56: | ||
* 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 ( | + | * FS-aware functions (''resize --resize_partition|--info, compact [--info]'') work for ext2/ext3/ext4/ntfs/btrfs/xfs. |
− | === Known issues === | + | === 5. Known issues === |
− | * | + | * ''resize --resize_partition'' should be implemented in-place (due tolimitations of qcow2, only for expanding) |
− | * all modifying operations have | + | * 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 | * only listed filesystems are supported | ||
− | * virt-resize, used by | + | * 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) |
Line 69: | Line 71: | ||
* [https://lists.openvz.org/pipermail/users/2015-November/006598.html TRD in devel@ mail archive] | * [https://lists.openvz.org/pipermail/users/2015-November/006598.html TRD in devel@ mail archive] | ||
− | |||
− |