`import-from` directive ignores `format=qcow2` and creates `raw` image

May 22, 2020
17
2
23
54
I am using `import-from` when create a VM or changing the assigned disk, and the imported disk images are always `raw`, wasting lots of space for templates.

Using `qm set <vmid> --scsi0 "<storage>,import-from=<image>,format=qcow2"` creates a `raw` image, and ignores the `qcow2` format request.

Strangely, when I tried `qm disk import <vmid> <source> <storage> --format=qcow2` it also created a `raw` image, so I do not know if the issue is my storage config or the `import-from` directive.

For automation and scripting it is much easier to use the `import-from` directive as I do not need to keep track of the disk names and numbers that are dynamically generated by `qm disk import`.

Storage is on ZFS, so per docs qcow2 should be supported?

How can I get `import-from` to honor the `format` flag?

Update:
I experimented with the GUI and found that QCOW2 is only and option for directory storage, ZFS is always raw.
I then tested the `import-from` directive and the format option was also honored as long as I used directory storage, not ZFS.
Consider this resolved.
 
Last edited: