In a previous article I covered implementing VMware Webhook Shims functionality using the source on https://github.com/vmw-loginsight/webhook-shims. As I previously stated, this is not officially maintained so it’s a “use at your own risk” scenario.
I was recently contacted by a customer asking how they would go about leveraging a single webhook shims server with multiple vRO servers so that’s the basis of this article.
There are several approaches I could use here. The first is to modify the code of the vrealizeorchestrator python file to include additional attributes for other vRO servers and add new code to provide the logic for which vRO server to use.
The second approach is to add new python files for the new vRO servers (or any endpoint type you are dealing with) and perform some minor modifications to allow those to be used. This is the approach I am going with here.
The first step is to create a copy of the existing vrealizeorchestrator.py file. Here I have just called it vrealizeorchestrator2.py.
The second step is to now modify this file. This is to not only specify a different vRO server but also to provide different the endpoint paths/routes within flask. The idea here is that by using a different request URL you can target a different vRO server. If you don’t do this then you have no method (from the source application server end i.e. vRLI) to specify using one vRO over the other.
In this example I have modified each application route in the new file to use “vro2” instead of “vro”. Additionally the function name in the file needs to be adjusted so that it is unique across the whole implementation. If you don’t do this the server will error when it starts.
Lastly the server needs to be told to import the new python file when it starts.
Once the server is started you can verify the implementation by pointing a web browser at the server. There should be an additional section for the 2nd vRO server which shows the different application routes, as shown below.
The same method can be used for any of the other endpoint types.