qvm-create doc shows two options whose difference in behaviour is not immediately obvious. At first I thought that “move” could mean that the source file would be removed after being copied to the new lvm volume, but that seemed awkward and is not what happens. Is it just a remnant of pre-lvm era ?
--root-copy-from=FILENAME, -r FILENAME Use provided root.img instead of default/empty one (file will be copied). This option is mutually exclusive with --root-move-from. --root-move-from=FILENAME, -R FILENAME Use provided root.img instead of default/empty one (file will be moved). This option is mutually exclusive with --root-copy-from.
In fact, when given a file whose size is smaller than the VM’s rootfs size, both will yell:
app: Error importing root volume (but VM created): Data import failed: not enough data (copied 771339878 bytes, expected 10737418240 bytes)
The “copied xxx bytes” seems to imply the data was indeed copied, but in reality (and with any of those 2 options), what we get is a volume full of zeros.
I can’t find a documented way of setting the system volume size on
qvm-create command-line. It’s not unthinkable that it would be possible through
--prop, but the manpage lists only a couple of example properties and no pointer to an exhaustive list.
I can make sure the image matches the expectation with the following, and that indeed gets me a proper copy:
dd if=/dev/zero of=myrootfs.img count=0 bs=1 seek=10737418240
… and indeed now that the copy does happen, with
--root-move-from the file gets removed.
To wrap up, there several points:
- documenting current behavior (pushed MR)
- how to create system volume with specific size ?
- documentation of possible