canonical/pycloudlib

Feature Idea: emulate VMs with different architectures using QEMU

Opened this issue · 3 comments

It might be convenient to have a "cloud" similar to lxd that uses qemu directly to emulate a different architecture. This would allow us to write and run integration tests for arm64 machines locally on x86_64 machines.

Some downsides are:

  • performance penalty from emulation - is it so slow that it's not even worth it?
  • I don't know of a convenient wrapper for this similar to lxd, so we'd have to use qemu for a particular arch directly and figure out how to bootstrap an SSH connection. I'm also not sure what the best way to query images would be.

Thoughts?

There are a couple of other potential use cases for qemu for which a work item has been proposed.

For example, kernel command line argument support is something that is possible to test without qemu directly, but it's not ideal as this requires forcing a reboot after provisioning a virtual machine in lxd.

Oh nice! That aligns really well with what I'm hoping for. I can help if there is extra work to expand that to allow emulating different arches. I know, for example, there is a different command and different cpu flags for different arches, and those are likely different from what you'd want for kernel parameter tests.

#323 added QEMU support for x86_64 only.