Robert Szymczak created a Plug-In for VMware vRealize Orchestrator which should help Administrators and Users to easily deploy and manage Docker Instances, Containers and Nodes on VMware Infrastructure. The project is open source and is located on GitHub and there is also a ReadMe and a Wiki available. You could also download it as a vRealize Orchestrator Package from VMware Solution Exchange here.
Install to Demo Environment
I have successfully installed the PlugIn and the Package File and i have a Docker Host on CoreOS running Server Version 1.4.1 with API Version 1.16.
But you can use any other OS or Docker distribution. Install instructions are available at docker.com
Check your version of Docker by typing
In vRO Workflow Library you see the new menu Coopto which is structured into four sections
In Configuration you can Add and Remove Docker Nodes / Hosts. In Containers you can manage your Containers on the specified Node and on Images you can handle images from Dockerhub. Sandbox is a section to show you how you can predefine Applications using Docker Containers.
There are also some Actions coming with the Coopto Plug-In and the Coopto Package which are needed for the predefined Workflows and Sandbox Samples.
Let’s get started with adding a new Docker Node by simply starting Add Docker Node from the Configuration Section
After successful Workflow run check the vRO Inventory Tab and expand the Coopto Menu and select the Node you added before. The Status in the General Tab should be ONLINE!
As you can see in the screenshot the Node was added and it scans for existing Docker Images on that Host which are shown under the Host in the Inventory.
By simply running
on the Docker Host you can double-check the downloaded Images.
Use case / Example
As an quick and easy test we use one of the prepared Workflows Create Web SSH Console in the Sandbox Section coming with the Plug-In.
Let’s asume we did not have access to a SSH Client but we wanted to connect to a Linux Host. Therefore we can use wetty, a web based SSH console which is based on ChromeOS’ terminal emulator (hterm). You’re wright – this only works with a Chrome Browser :-)
After successfull workflow run switch to the Logs tab and copy the URL highlighted in the screenshot and paste it to a Chrome Webbrowser
et voilà – we have a connection to the Linux Host.
RealWorld Integration to vRealize Automation
So now we come to the most interesting part of the story - bring technology to the people so everyone can use it even when he doesn’t have access or knowledge of docker.
The ShowCase is to enable User to request a docker application through vRealize Automation Portal.
vRealize Automation - Advanced Services
If everything is fine and running in vRealize Orchestrator let’s start with the Advanced Services in vRealize Automation.
To manage Docker Containers through vRealize Automation we have to create a Advanced Services > Custom Resource with Orchestrator Type Coopto:DockerContainer which could be selected by only typing coo. Give it a Name like DockerContainer and some Description. For this demo i leave the Details From as it is but for a real scenario i would hide all fields which are not necessary to the user.
As a first Service Blueprint i wanted to add on of the prepared Coopto Workflows from the Sandbox folder in the Coopto Plug-in. Start with Advanced Services > Service Blueprints and click Add to create a new Service.
Browse the vRealize Orchestrator Library to Library : Coopto : Sandbox and Select the Create Web SSH Console Workflow.
Give a Name, Description and maybe Version to the Blueprint. I love the possibility to hide this ugly catalog request information page from the Service Request.
As in the Custom Resource Form i keep all information in this Blueprint form which come from the Workflow.
An important step is to bind the Output Parameter from the Workflow to a Provisioned Resource. Otherwise you did not receive any manageable Items in vRealize Automation.
For Coopto i created a Services Group in Administration > Catalog Management > Services and i linked the created Service Blueprint Create Web SSH Console to this Services Group. A nice new logo and then we can preview our new Service in the Catalog View.
Let’s request one container through vRealize Orchestrator and we wanted to use this Container as a SSH Client to connect to a SSH Host with the IP 10.111.6.212 Port 22 and User root.
You can give a Name to the Container which later also appears in the Items list.
After a few seconds check the Items List for the Name given to the Container in the previous request. Click on the Name to view the Details of this Item.
New Resource Action : Remove Container
Now that we have created a Docker Container as Custom Resource managed by vRealize Automation we should create some Resource Actions specially for the management of Docker Container Items.
Go to Advanced Services > Resource Actions and Click Add to create a new Action.
Browse the vRealize Orchestrator Library to Library : Coopto : Containers and Select the Remove Container Workflow.
Define the Resource type and the Input parameter to match with the Custom Resource created earlier.
Keep the Name and Description and give a Version to the action. Don’t forget to check Hide catalog request information page - if you want. You can also check the Type : Disposal and as the Target criteria select Always available.
Keep the form Elements and click Add.
Resource Action : Get Connection in vRA
For some Applications in Docker Container it is helpfull to get the URL or Connection string. Our example Service Container Web SSH Console to connect to a SSH Host creates such a connection string but unfortunately it is not redirected to the vRealize Automation Portal directly.
A Resource Action could be the solution …
Browse the vRealize Orchestrator Library to *Library : Coopto : Containers : vRA ** and Select the *Get Connection in vRA Workflow.
Map the Resource Action to the Custom Resource of the Docker Container.
Give a Name, Description and Version…
You can define Prefix and Postfix if you want and sometimes it make sense to remove or hide these fields. In my example i normally would define http:// as a Prefix but this is currently not in the Screenshots.
You have to publish and configure the Actions to the Entitlement before they are visible to the Items Actions menue!
Select your Container for the Web SSH Console and Click Actions > Get Connection in vRA
You don’t have to define a Prefix or a Postfix as you don’t need them in this example. Click Next.
In this Output - Form you can see the link to my Docker Host and a Port which is mapped into the Container i created before. If i had configured a Prefix like http:// i could directly click on the URL to open the connection. I have to copy the URL s00-lxc-01:49155 and paste it to a Chrome Browser…
and again : it works I’m now connected to the Container on my Docker Host which has created a SSH Connection to the ip i configure in my Request.
Last step is to go back to my Items View, select my Container and remove it with the created Resource action.
Have some fun with Coopto, vRealize Orchestrator and vRealize Automation.