Adapt "nova resize" code to support Virtuozzo ploop disks.
As far as ploop disks are in fact directories we add '-r' argument
to all utilities that deal with instance' disks such as cp, rsync and scp.
Thus we copy disks universally whether they are folders or files.
Also using "prl_disk_tool" instead of "qemu-img" is better for ploop images
because it resizes guest filesystem as well.
We can't resize disks from guest OS in containers,
because they are not allowed to write directly to block device.
ploop tool can resize partition table and internal filesystem,
but only for container's disks. Such disks must have only one partition
with ext filesystem.
prl_disk_tool can resize disks with internal filesystems
and doesn't require any special layout so it can resize disks
for virtual machines. So it's better to use this tool instead of ploop.
Also we make compute.filters more strict
We call "ploop" only with "restore-descriptor" argument
And we set disk size in megabytes for prl_disk_tool
Co-Authored-By: Dmitry Guryanov <dguryanov@parallels.com>
Depends-On: I04c4379459c2fc1fd4801ec2aad53d0f6053b6d6
Change-Id: I38dbf73beb01fe1939ddca63fbfedbec1dc3c826
Implements: blueprint virtuozzo-instance-resize-support
It is not sufficient to just pass a filename into the
libguestfs APIs. There needs to be various pieces of
metadata passed in order to support network based images.
This introduces a simple data model to describe images
when passing info from virt drivers to the VFS APIs.
These classes are only intended to contain identifying
attributes for the various storage backends used as
images. They are not intended to hold any functional
logic, as that will remain in the libvirt driver private
image backend classes. This separates generic description
of storage backends, from driver specific implementation
details.
Related-Bug: #1257674
Change-Id: I5f86d91aa2bcef2385d5d16022a9bd4ea7b0485e