I need to find a solution to provide a local virtual stack of vm/containers to developers. I assume that LXD is probably already installed on developper computers. But it is also possible to find a way for a clear environment without LXD.
The main goal of my script is to create a dedicated network and containers/vm on it. This stack will be used locally and not need to be accessible from the outside. Only outbonding networking.
I tested different things with LXD Projects (all features enable or disable) but I have difficulties to make something good.
My main installation process is:
- ensure LXD is installed or preseed it with default bridge and storage pool (same as an LXD already installed on the system)
- create a projet (with or without features enabled)
- create a dedicated network bridge for this project
- with its network range and with dnsmasq configuration
- create a dedicated storage for this project (on the same computer without any additionnal devices)
- btrs if the system is btrfs or dir seems ok
- create a dedicated profile to use for the common way of not having to add/attach containers volume
- but without eth0 device because I need to set fixed ip for each containers/vm of the project
After that I have another method to:
- build/publish containers/vm customized using cloud-init
- remove all containers/vm after publishing them
And finally, I have a method to:
- init the stack of containers/vm from local project’s custom images
- add eth0 device with the good IP address for each ones
- start each ones
After reads here. I saw that I can’t create network of type bridge when project’s network feature is enabled. And my actual experience say me that creating and using dedicated LXD projects seem bad. I’m not sure and is the reason I opened this topic.
If anyone have advises about a way to process. And If I need to avoid using LXD project too.
Thanks in advance.
PS. I pushed my shell script on github if you want taking a look on it