I contribute to an open source project that leverages LXC for continuous integration on Travis CI.
Recently we’ve been facing an issue that we can’t seem to figure out a solution for - namely that our LXC tasks are failing when attempting to create a bridged network using the following command lxc create network testbr0 with the following error error: unknown command: network.
I have tried tried various approaches, for example explicitly running apt install lxd-client, but it’s a no-go as far as I can tell.
If anyone can point me in the right direction, I would be greatly appreciative of the help. If it helps, the last output from Travis can be found here.
Then you just need to install it with snap install lxd. AFAIK there is no ansible module to manage snap, so you need to install it with the shell or command module.
One of the caveats of using snap is that the binaries are under /snap/bin, so the commands are not available directly unless you call /snap/bin/lxc, so make sure to either call lxc that way or add /snap/bin your PATH env variable.
one approach that I use is to go ahead and install 2.0.11 on travis and then launch a nested xenial container, install the latest lxd in there, and then perform my testing in that subcontainer
Just came back for a follow up, the snap approach ended up working after a bit of fiddling around.
The end result can be seen here for those interested.
I was passing by this link. I recently hit a problem when the Feature branch of LXD was removed from trusty. I use an ansible lxd role that I wrote to manage the install/configuration and deployments of my linux containers.
The feature branch have a lot to offer with the API, I already wrote an lxd_network module based on the lxd_profile one and I would certainly do the same for an lxd_storage one. (I have send a PR, but don’t have enough time to push it further.)
So without the possibility to use the Feature branch on travis, outside of snap, but I hade some trouble using it. I decided to add the possibility in my role to install an LTS version of LXD.
I use my lxd-role inside my other ansible role in order to test them with Travis. If it can help in any way, or interest someone, I leave it there :