Migrate qemu vms to lxd virtual machine

Hi
I’m working on migrating vms from qemu to lxd.

lxc init --empty --vm myvm
rbd rm mypool/virtual-machine_myvm
rbd import --dest-pool mypool ./vm.ova virtual-machine_myvm
lxc start myvm

Error: Failed to mount "/dev/rbd4" on "/var/snap/lxd/common/lxd/storage-pools/remote/virtual-machines/myvm" using "ext4": invalid argument





I would strongly recommend against manually modifying/creating the LXD backing volumes.
There is a lot of logic and expectations around them, and as you’ve seen simply replacing one for another isn’t going to work. Especially for VMs where a single VM volume is actually represented by 2 underlying storage volumes (one small filesystem one for metadata and config and one block volume for the actual VM root disk). You’ve replaced the filesystem one with presumably the existing block volume which is why its trying to mount it and failing.

Have you tried using lxd-migrate which is a more general solution to importing instances.

I’m using lxd-migrate and converting is worked.
But when i start it and try to get console the below error is shown:
lxc console myvm --show-log
Error: Instance is not container type

And when set this, the console doesn’t appear anything:
lxc config set myvm raw.qemu='-bios /var/lib/snapd/hostfs/usr/share/seabios/bios-256k.bin'

Please can you show lxc start <instance> --console output?