Qcow2 will not boot

I try to boot a fortigate KVM vm using the migration tool, here is the process:

danny@home:~/tools$ sudo ./bin.linux.incus-migrate.x86_64
The local Incus server is the target [default=yes]:
Would you like to create a container (1) or virtual-machine (2)?: 2
Project to create the instance in [default=default]:
Name of the new instance: fortigate-1
Please provide the path to a disk, partition, or raw image file: /home/danny/tmp/fortios.qcow2
Does the VM support UEFI booting? [default=yes]: no
                                                                                                                                                                                                                 Instance to be created:
  Name: fortigate-1
  Project: default
  Type: virtual-machine
  Source: /home/danny/tmp/fortios.qcow2
  Config:
    security.csm: "true"
    security.secureboot: "false"

Additional overrides can be applied at this stage:
1) Begin the migration with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network

Please pick one of the options above [default=1]: 1                                                                                                                                                              Instance fortigate-1 successfully created

then start and connect to the console

I found the solution here: incus-migrate should detect non-raw images.
the issue is closed by a prompt, but the docs here is still wrong: How to import physical or virtual machines to Incus instances

How should the docs be rephrased so that they are more useful in this specific case?

Current:

incus-migrate can import images in raw, qcow2 and vmdk file formats.

Suggested:

incus-migrate can import images in raw format only. If your image is in some other format, such as qcow2 or vmdk, then you must first convert it to a raw image using qemu-img convert.

(Aside: I thought I came across some case where incus was using qcow2 files internally, but I can’t remember what it was. Obviously it would be nice to avoid a qcow2->raw->qcow2 round trip)

Ah yes… it’s incus image import and incus image export. The image format is described here where it says “Virtual machines use a rootfs.img qcow2 file”

Therefore, if you were importing an image (from which instance disks are initialized), you can import a qcow2 file directly. But if you’re migrating a single instance disk using incus-migrate, then it has to be raw.

There are also incus import and incus export which work on instances. But I couldn’t find documentation as to the format of those; I think you’re supposed to treat them as opaque. There are multiple options, including the --optimized-storage which uses zfs or btrfs dumps.

incus-migrate in Incus 6.6 will support both qcow2 and vmdk.

incus-migrate can directly import raw images and images in the qcow2 and vmdk formats. If you are using a version of incus-migrate that is older than Incus 6.6 and the image is in the qcow2 or vmdk formats, then you must first convert it to a raw image using qemu-img convert.

How does this phrasing look like?

URL to submit: incus/doc/howto/import_machines_to_instances.md at main · lxc/incus · GitHub

That works. Or:

incus-migrate version 6.6 and later can directly import raw images and images in the qcow2 and vmdk formats. If you are using an older version of incus-migrate then you may need to convert to a raw image using qemu-img convert.

1 Like

Ok, I phrased it as follows (if needed, suggest change):

incus-migrate from Incus 6.0 LTS and up to Incus 6.4 can only import images in the raw file format.
If you have images in the qcow2 or vmdk file formats, you need to convert them first to the raw file format using the external tool qemu-img.
In this example the QCOW2 image is converted to the raw file format.

qemu-img convert -f vmdk -O raw image.vmdk image.img

{note}
Since Incus 6.5, the incus-migrate tool is able to directly use images in both the qcow2 and vmdk file format.