[Libguestfs] virt-builder and SimpleStreams

Richard W.M. Jones rjones at redhat.com
Thu Apr 21 09:48:24 UTC 2016


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/




More information about the Libguestfs mailing list