virt-builder and SimpleStreams
Pino, do you remember what the missing data was that prevents virt-builder from working properly with SimpleStreams? IIRC it was the target (expanded) size of the image, as it means we don't know during the planning stage if we will need to resize the image. CentOS may start to publish this data, but we will need to ask Karanbir to add the extra data we need in JSON field(s). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
On Wednesday 20 April 2016 19:01:23 Richard W.M. Jones wrote:
Pino, do you remember what the missing data was that prevents virt-builder from working properly with SimpleStreams?
IIRC it was the target (expanded) size of the image, as it means we don't know during the planning stage if we will need to resize the image.
Almost: if no --size is specified for virt-builder, then the template is used as-is; when specifying --size, there is a size check to error out on shrinking, and to pass the right size to virt-resize. Currently we use the "size" (which represents the size of the image) also as size of the image: this implies that the shrinking check won't actually work properly, causing a failure. We also miss the information about the partition to expand, so virt-resize merely adds a new empty partition at the end to fill the extra space. -- Pino Toscano
On Thu, Apr 21, 2016 at 11:26:49AM +0200, Pino Toscano wrote:
On Wednesday 20 April 2016 19:01:23 Richard W.M. Jones wrote:
Pino, do you remember what the missing data was that prevents virt-builder from working properly with SimpleStreams?
IIRC it was the target (expanded) size of the image, as it means we don't know during the planning stage if we will need to resize the image.
Almost: if no --size is specified for virt-builder, then the template is used as-is; when specifying --size, there is a size check to error out on shrinking, and to pass the right size to virt-resize.
Currently we use the "size" (which represents the size of the image) also as size of the image: this implies that the shrinking check won't actually work properly, causing a failure.
We also miss the information about the partition to expand, so virt-resize merely adds a new empty partition at the end to fill the extra space.
OK so let's decide unilaterally on some fields. Currently there is a "size" field which contains the compressed size in bytes. We also require: "virtual_size": Virtual size of the image in bytes. Note this is not the same as the uncompressed size (except for "raw"). This is the size of the image as it appears inside the guest. The 'qemu-img info' program is able to show the virtual size of any disk. And: "image_format": Image format, eg. "raw", "qcow2". Ignore any compression (eg .xz) applied to the image, this is the format after it has been decompressed. "expand_filesystem": The filesystem to resize. Use a name like "/dev/sda3" to mean the third partition of the first disk. If the image is not partitioned, use "/dev/sda". "lvexpand_filesystem": The logical volume to resize. If the image uses LVM2, then this should be the LV name to expand, eg. "/dev/VG/LV", and also set "expand_filesystem" to the PV containing this LV. If the image does not use LVM2, don't use this key. "osinfo": The name of this guest from the libosinfo database. For CentOS 7 this is "centos7.X". As far as I can tell these are not used in SimpleStreams v1. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
On Thursday 21 April 2016 10:48:24 Richard W.M. Jones wrote:
On Thu, Apr 21, 2016 at 11:26:49AM +0200, Pino Toscano wrote:
On Wednesday 20 April 2016 19:01:23 Richard W.M. Jones wrote:
Pino, do you remember what the missing data was that prevents virt-builder from working properly with SimpleStreams?
IIRC it was the target (expanded) size of the image, as it means we don't know during the planning stage if we will need to resize the image.
Almost: if no --size is specified for virt-builder, then the template is used as-is; when specifying --size, there is a size check to error out on shrinking, and to pass the right size to virt-resize.
Currently we use the "size" (which represents the size of the image) also as size of the image: this implies that the shrinking check won't actually work properly, causing a failure.
We also miss the information about the partition to expand, so virt-resize merely adds a new empty partition at the end to fill the extra space.
OK so let's decide unilaterally on some fields.
I will contact Scott Moser first (the author of SimpleStreams), to know whether these can be allowed (and possibly added in other repositories). -- Pino Toscano
participants (2)
-
Pino Toscano -
Richard W.M. Jones