<div dir="ltr">P. Lowe asked:<div><br></div><div><i>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 restarted?</i></div><div><br></div><div>this is exactly a cloud-init use case: cloud-init with a bootstrap script in user-data (like EC2 does).</div><div><br></div><div>You could of course swap cloud-init out for a custom salt-bootstrap, clone, state.highstate flow and still get the job done.</div><div><br></div><div>But as far as I am concerned I find the additional abstraction layer and flexibility provided by cloud-init to be convenient enough.</div><div><br></div><div>So my suggestion for P. Lowe is:</div><div><br></div><div>use cloud-init to drive the bootstrap process: early init, cloning cookbook, installing chef and whatnot</div><div><br></div><div>then let chef take over and complete the configuration phase.</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 23, 2016 at 7:44 PM, Zach Lanich <span dir="ltr"><<a href="mailto:zach@wecreate.com" target="_blank">zach@wecreate.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Umberto, I’m not 100% sure of what SaltStack uses under the hood lib wise, but it’s written in Python an already does everything that Lib does. We’re talking more of how the creation of the LXD </div></blockquote><div><br></div><div>I think the provisioning phase or how you manage containers (creation, move, destroy, etc) is beyond (actually it is before :-)) P. Lowe's question scope but you could certainly do that with SaltStack or through the container mgmt API directly.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">containers themselves, including setting Mounts, Static IP, etc. SaltStack & Chef handle everything else from there once the provisioned container is connected to the master. CloudInit would certainly be an option as the 2nd part of the equation if we weren’t already using a configuration management tool. <div><br></div><div>Does that make sense, or am I’m misinterpreting your point?<br></div></div></blockquote><div><br></div><div>Hope this clarify by previously hurried email :-)</div><div> </div><div>BR,</div><div>Umberto</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Best Regards,<br><br>Zach Lanich</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><b><i>Owner/CTO</i></b></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">weCreate LLC</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://www.wecreate.com" target="_blank">www.WeCreate.com</a></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="tel:814.580.6636" value="+18145806636" target="_blank">814.580.6636</a></div></div>
</div><div><div class="h5">
<br><div><blockquote type="cite"><div>On Aug 23, 2016, at 1:26 PM, Umberto Nicoletti <<a href="mailto:umberto.nicoletti@gmail.com" target="_blank">umberto.nicoletti@gmail.com</a>> wrote:</div><br><div>Why not use <a href="https://cloudinit.readthedocs.io/en/latest/" target="_blank">https://cloudinit.<wbr>readthedocs.io/en/latest/</a> ?<br><br>On Tuesday, August 23, 2016, Zach Lanich <<a href="mailto:zach@zachlanich.com" target="_blank">zach@zachlanich.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">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.<div><br></div><div>Hopefully that helps in some way lol. Still awaiting best practice advice for passing container params for provision!<br><div><div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Best Regards,</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Zach Lanich</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><i>Business Owner, Entrepreneur, Creative</i></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><b><i>Owner/CTO</i></b></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">weCreate LLC</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><i><a href="http://www.wecreate.com/" target="_blank">www.WeCreate.com</a></i></div></div></div></div>
</div>
<br><div><blockquote type="cite"><div>On Aug 23, 2016, at 1:05 PM, P. Lowe <<a>plowe@zitovault.com</a>> wrote:</div><br><div><div>Hi Zach,<br><br>No, I still haven't received an answer on this.<br><br>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.)<br><br>I'm currently using a technique where I launch a new image, start it, and then do a:<br><br>"lxd file push ./provision.sh /container1/etc/rc.local"<br><br>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.<br><br>Still trying to determine best way to pass provisioning parameters to the container...<br><br>-P. Lowe<br><br><br>Quoting Zach Lanich <<a>zach@zachlanich.com</a>>:<br><br><blockquote type="cite">P.Lowe, did you ever get an answer on this. I’m doing something very similar with SaltStack.<br><br>Best Regards,<br><br>Zach Lanich<br>Business Owner, Entrepreneur, Creative<br>Owner/CTO<br>weCreate LLC<br><a href="http://www.wecreate.com/" target="_blank">www.WeCreate.com</a><br><br><blockquote type="cite">On Aug 17, 2016, at 4:48 PM, P. Lowe <<a>plowe@zitovault.com</a>> wrote:<br><br><br>Hi,<br><br>I am investigating the use of lxd to dynamically spin up server instances.<br><br>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.<br><br>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 restarted?<br><br>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.<br><br>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?<br><br>Thanks,<br><br>P.Lowe<br><br><br>______________________________<wbr>_________________<br>lxc-users mailing list<br><a>lxc-users@lists.linuxcontainer<wbr>s.org</a><br><a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.o<wbr>rg/listinfo/lxc-users</a><br></blockquote></blockquote><br><br><br><br></div></div></blockquote></div><br></div></div></div></blockquote>
______________________________<wbr>_________________<br>lxc-users mailing list<br><a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.<wbr>linuxcontainers.org</a><br><a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.<wbr>org/listinfo/lxc-users</a></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div></div>