Post by Zach Lanich
Iâm not sure of the best way to pass LXD/Container specific parameters is
yet (so anyone, please chime in if you have advice), but Iâm using
SaltStack at the moment and doing something similar. Iâm currently running
w/e necessary commands to provision the container itself, setting the
containerâs IP via a custom dnsmasq conf file, then using lxc exec to
download the latest salt bootstrap and run it, then I just trigger a
key-accept on the master for the container so the container acts just like
any other minion and I can run State/Scripts, etc on it from there on.
Hopefully that helps in some way lol. Still awaiting best practice advice
for passing container params for provision!
*Business Owner, Entrepreneur, Creative*
No, I still haven't received an answer on this.
I'm still trying to determine if there is a best practice for passing
provisioning parameters to an lxd container (hostname, block device mounts,
secrets, monitoring server name for pub/sub, etc.)
"lxd file push ./provision.sh /container1/etc/rc.local"
Then I restart the container and it runs the provisioning in
/etc/rc.local (pull and execute chef cookbook from git), and then reset
rc.local to empty, so that future restarts won't re-run the provisioning.
Still trying to determine best way to pass provisioning parameters to the container...
P.Lowe, did you ever get an answer on this. Iâm doing something very
similar with SaltStack.
Business Owner, Entrepreneur, Creative
I am investigating the use of lxd to dynamically spin up server instances.
I'm thinking about using a code-as-infrastructure approach using a
chef-solo cookbook that is pulled out of git upon the container's initial
boot and does all the provisioning upon initial boot.
Would people recommend creating a new container from a base image,
modifying rc.local to pull the cookbook from git and launch it upon initial
bootup, after which rc.local is reset to be empty and the server is
After rc.local is modified, the new container would be published to the
local image store, so that whenever a new container is launched, it will
boot up, run rc.local, pull the cookbook from git, run the cookbook and
apply all the local provisioning operations, empty out rc.local, and then
reboot the machine, after which it will boot with the customized
provisioning parameters for normal operation.
What is the recommended way to send provisioning parameters (e.g. ip
address, gateway, hostname, block device mounts, secrets (certs / keys)) to
the container? Would people just drop a config file into the container
using the lxc push command, or any other better techniques?
lxc-users mailing list