How to deploy VMs on an LXD cloud?

Hello,

When working with LXD clouds, juju deploy creates a container by default. But LXD allows one to create virtual machines as well.

There are some applications that don’t make much sense to runs as containers (see also [Feature request] Forbid LXD for some charms), so VMs for local development are essential.

How do I juju deploy applications as virtual machines on LXD?

1 Like

Typically for a local VM-based cloud, we deploy MAAS and use Pod VMs deployed by MAAS which used libvirt for deploying and managing the VMs. The Juju integration for LXD is container-only, as far as I’m aware.

Hi@ heitor

maybe About VM hosting (snap/3.1/UI) can help you.

1 Like

Thanks for the comments!

I was particularly interested in a local development setup, so deploying MAAS might be a bit “too much”?

We do use it in production, though, so it would be nice to heave as well…

1 Like

If this could be used somehow, it would be a real nice feature.

I’m working on figuring out how LXD profiles work if you are keen on learning more on this topic. How does LXD profiles really work?

If anyone comes across this, it’s worth noting that this is apparently supported in modern Juju.

Per https://bugs.launchpad.net/juju/+bug/1897746/comments/3:

Marking as fix released as Juju 3.1.0 grew support for spawning VMs (https://github.com/juju/juju/pull/15004)!