Here is a very early look at an LXC container provisioning cookbook I’m currently working on. The goals for this project are to have a quick, mostly automated, consistent way of deploying replacement nodes or additional resources in my environment. I have a lot of ideas I want to implement, but here’s what is working thus far:
- Creation of the LXC container itself
- Using LXC to generate a unique MAC address per container
- Writing a custom LXC config
- Starting the container
- Stopping & Destroying the container
A set of attributes on the LXC host is what is controlling which container is brought online (or offline & destroyed), and the name of that container. The MAC address is also an attribute inside the file, but the initial value does not matter. The MAC address gets pulled in via Step 2 above, and is then written and saved over whatever value happens to be present at the time of execution.
So far I’m happy with the functionality, but since this was started this morning as a “I wonder if we can do this” project, the code is horribly written. So before we move forward, tomorrow’s goal is to get the current base re-written and then we can start implementing the additional ideas and wants I have for this little project.
Enjoy the video, and be sure and watch at 1080p for best viewing!