On Tue, Jun 20, 2017 at 05:04:53PM +0300, Pavel Butsykin
wrote:> I noticed that raw is intentionally used as image format for appliance
> image. So I would like to ask, is there any reason to use raw as image
> format for appliance?
The simple answer is because we create the appliance image (it's an
ext2/3/4 filesystem) using e2fsprogs, and that library wouldn't know
how to create anything else since it always assumes it's writing
directly to a device.
https://github.com/libguestfs/supermin/blob/master/src/format_ext2.mli#L22-L29
HTH,
Rich.
> I would suggest that choice is related with the performance, so I did
> several test runs (./run utils/boot-benchmark/boot-benchmark)
>
> /appliance/root.raw:
> Result: 1342.9ms ±2.9ms
> Result: 1370.1ms ±17.3ms
> Result: 1365.1ms ±11.0ms
>
> appliance/root.qcow2:
> Result: 1353.1ms ±2.4ms
> Result: 1350.2ms ±5.3ms
> Result: 1374.7ms ±5.4ms
>
> But even theoretically there should not be much difference, because
> qcow2 uses a cache to internal tables. Also -drive configured to use the
> host cache:
> if (has_appliance_drive) {
> ADD_CMDLINE ("-drive");
> ADD_CMDLINE_PRINTF ("file=%s,snapshot=on,id=appliance,"
> "cache=unsafe,if=none,format=raw",
>
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top