We’re running multiple Openstack clusters thanks to Juju/MaaS and our networking infrastructure is based on Cisco ACI which is great because it gives us a lot of flexibility since the network is, itself, manageable.
Thanks to ACI, I can easily automate the creation of vlans and apply them to my hypervisor’s ports.
However, since not all the machines available in our MaaS setup are meant to become Openstack compute nodes, we didn’t pre-configured each ports with all the required vlans and apply them afterwards with some automation. Works great most of the time except at one moment, when we add new compute units in our cluster because some mandatory vlans are not there and thus, adding units fails.
So comes my question : is there a way to automatically run some kind of custom hook (script or whatever) when running some actions ? For example, I would like to execute a script that would automatically configure my hypervisor ports when running the “add-unit” command in my deployment. This script should be a “pre-hook” or even a “post-hook” so that the action could be run before the add-unit command or after. Off course this could be done aside by running the script by hand but doing so through juju would avoid human error and would let us gather some contextual informations passed as parameters (such as hypervisor informations needed to configure the port like MAC address, hostname, IP, …) that could be used to run the script.