[lxc-users] setting up lxd with ansible (unattended - no lxd init)

Spike spike at drba.org
Wed Mar 15 03:24:04 UTC 2017


Hi,

I'm trying to set up a host to run containers and not sure how to go about
achieving the equivalent of lxd init from ansible/in an unattended fashion.

I can create the bridge before hand, no prob, and I have zfs with a
tank0/lxd dataset ready for it, which I can set up with lxc storage create
default zfs source=tank0/lxd and that seems to create the relevant dirs
just like lxd init does.

lxc network already shows my pre-created bridge, so nothing needed there it
seems.

another thing lxd init seems to do is setting up the default profile, which
can I do with:

lxc profile device add default root disk path=/ pool=tank0/lxd (I don't
need the net part, but could do that the same way)

after this however I'm still left with a broken installation. Trying to
start a container results in an error:

lxc launch local:xenial c1

Creating c1
error: not found

I tried --show-log and lxd monitor, but I don't see anything obvious.

However doing an ls shows that contrary to usual when I use lxd init none
of the stuff under /var/lib/lxd/ is bind mounted to the various datasets
the above storage command created:

tank0/lxd              480K  1.32T    96K  /tank0/lxd
tank0/lxd/containers    96K  1.32T    96K  none
tank0/lxd/custom        96K  1.32T    96K  none
tank0/lxd/deleted       96K  1.32T    96K  none
tank0/lxd/images        96K  1.32T    96K  none

any input?

thanks,

Spike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170315/ac4bb259/attachment.html>


More information about the lxc-users mailing list