Since I haven’t used LXD for anything yet, let’s install incus on an Arch Linux server I have.
In my Ansible playbooks, I’ll update lxd to incus.
I installed Incus but forgot to uninstall LXD, so some things went to one and others to the other. Uninstall lxd now.
For some reason the Incus network I created exists in incus network ls but can’t be referenced or incus network rm’d or incus network inspect’d (404 from the API.) I’ll just create a new one for now.
lxd_container gives a 404 Not Found error for the endpoint /1.0/containers
I suspect that this error is due to the rename to “instances” with containers and VMs being sub-types. Unfortunately, I need to get work done, so I decided to switch back to LXD in the meantime. It turns out this is not tenable either as the image server has restricted access to my distro of choice (Arch Linux): Important notice for LXD users (image server)
Is there an Ansible plugin that is suitable for use with Incus? Is there a reason not to leave the /1.0/containers endpoint for backwards compatibility? How are users expected to work around this issue?
Yeah, that API endpoint is incorrect even for current LXD (though still functional), it should be changed to /1.0/instances. You should be able to do that locally pretty easily or ask the Ansible maintainer to sort it out.
I’ve never actually used that particular Ansible plugin, I prefer the idea of using Terraform to create my instances, storage volumes, … and then using the Ansible Incus connection plugin to deploy stuff into those instances, keeping the two things separate if that makes sense.
That API has been completely untested for years on the LXD side, so it felt like keeping it around would just make thing worse. It’s unfortunate that some tools are breaking as a result of it, but it’s also been convenient to find which tools are still using the deprecated APIs and get them updated as even for LXD, they’re not using something that’s really supported these days.
Thanks for the response! I’m working on getting Terraform setup. Unfortunately, this means adding yet another tool to my deployment environment.
It looks like the Terraform module doesn’t support SSH authentication for communicating with the Unix socket, so in addition to the operational complexity of supporting yet another auth flow, I am also increasing surface area by opening another port on this box. (The latter bit is mitigated by the fact that I have a private, encrypted overlay network I can bind to…)
I understand the reasoning behind using Terraform for creating infrastructure, and the provisioning with Ansible - however for a simple topology like I have (one or two “pet” servers running Incus - not a bunch of “cattle” in AWS), it would’ve been nice to just keep it all in Ansible.
Regardless - thanks for your work on Incus and keeping all the hard work that went into LXD firmly in the community’s hands!
If you have some familiarity with Python, I’d recommend looking at that lxd_container Ansible module, the change to make it use the instance API instead of container should be rather trivial.
Indeed, overriding the instance variable and setting it to /1.0/instances seems to work to create a container. The only issue now is that I believe this only support containers since the endpoint serves both containers and VMs but there is no explicit “instance type” parameter being sent.