Containers are coming to a company near you! Containers are all the rage. They are one of the hottest technologies in IT. In all seriousness, all technologies have to mature, fit a business need. Docker is a leading company in this space.
Within vRealize Automation 7.2, there is a container option. Here are docs about containers and vRealize Automation 7.2. As a vRA admin, I want to understand all features. To help achieve my goal, I wanted to setup a catalog item similar to these articles.
- Publish vRealize Orchestrator OVF as a catalog offering (mine)
- Deploying-containers-with-vrealize-automation-7-2-part-1-containers by Mark Brookfield (@virtualhobbit)
Mark’s article was very helpful. His article uses a DHCP scope (which is ok) and default networking in Photon assumes DHCP. My article uses a vRO workflow, script on the template to set networking based on ip settings handled by vRA.
My article is related to vRealize Orchestrator, but the concept is the same. Maybe I’ll blog my Photon example later although it’s similar to Mark’s article. Here are my Photon workflows and addnetwork.sh I used on Photon vRA example
Regardless of how you setup your template, one of the features of Docker has it’s own internal networking. The default is 172.17.0.0 (more info here). For some enterprises, this can conflict with existing non-routed internet address ranges ( 10.x, 172.x, and 192.168.x).
I ran into this and needed to adjust my default docker network. My docker network wouldn’t persist reboots. I initially found out how to change default docker network, but it wouldn’t persist a reboot. (Links are listed below)
I wanted to setup my Photon template, used by vRA, with a persistent docker network that wouldn’t revert back to 172.17.x.x after reboots. Follow Marks or my article to setup a Photon template, catalog items in vRA, then adjust your Photon template using instructions below.
After working with VMware and some experimentation. This worked for me.
Photon OS use systemd-networkd to manage the network. Here is the external documentation on how to setup a bridge with systemd-networkd: https://wiki.archlinux.org/index.php/Systemd-networkd#Bridge_interface
# cd /etc/systemd/network
# vi 10-static-docker0.netdev
# vi 10-static-docker0.network
# chmod 755 10-static-docker0*
# systemctl restart systemd-networkd.service
# systemctl restart docker
Modify whatever you want, I left 192.168.3.0/24 as that will work in my network.
Here are other links that helped along the journey.
There is a few ideas.
Showed how to adjust the docker networking, didn’t persist reboots though
Known issue, I applied this hotfix to vRA