In the concluding paragraphs of my last post, UrbanCode Deploy with Patterns: Hello World ,I briefly compared the UrbanCode Deploy with Patterns (UCD+P) use of OpenStack HEAT Templates (HOT) for blueprints with my own simple XML blueprint for vSphere compute resources. In the past week a Fix Pack was released for UCD+P which adds initial support for provisioning to VMware vSphere infrastructure. So in this post I’ll do a “Hello World” -style example of connecting UCD+P to a vCenter 5.5 server, provisioning a VM on it and deploying multiple UrbanCode Deploy (UCD) components to the VM.
Since writing up UrbanCode Deploy with vSphere and Chef I’d managed to trash my ESXi/vCenter setup so I recreated it from scratch. First I installed ESXi into a VMware VM and then imported the vCenter Server appliance into another VM. I also created an Ubuntu 14.04 x64 VM, installed cloud-init into it and cloned it to a VM template. To make life simpler for all concerned (well, me:-) I put the ESXi Management network, the VM network and the VCentre server all on the same virtual network as my UCD+P/UCD VMs and turned on promiscuous mode and forged transmits on vmnic0.
The updated version of UCD+P also has some changes in how the authentication and authorization is configured (see “Cloud Projects” in the UCD+P Knowledge Center). Essentially I will still get UCD+P to use the same OpenStack Keystone service for identities as before. However I create a new Cloud Project that maps an OpenStack project (tenant) and user to a VMware vCenter user.
I also need to assign the project to a team.
Now when I login, I authenticate as the “demo” OpenStack User and use the Projects menu to access and use compute resources from vCenter/ESXi.
Now click “New..” in the Blueprints page, give the blueprint a name, select “Blueprint” for Type and click Save.
Next open the Component drawer, which shows the UCD components, and drag and drop the mtm.app, mtm.db and mtm.web components onto the ubuntuCI Compute resource. Select each of the components on the compute resource and set the Version property to “1.0” and the Component Process property to “deploy“.
With this we’ve instructed UCD+P to provision a new VM based on the ubuntuCI template, deploy the UCD agent to it, and invoke the “deploy” component process for each of the mtm.app, mtm.db and mtm.web components on it.
UCD 101 says that usually the Application process orchestrates the order in which its components are deployed. In UCD+P we use the Deployment Sequence policy to achieve something similar. Expand the Policies drawer in the palette and drag and drop the Deployment Sequence policy first onto the mtm.db, then the mtm.app and finally the mtm.web component. If you need to change the order click any of the Deployment Sequence icons and edit as required.
Now since the OpenStack Heat engine has been extended with the special VCenter resource types , I need to externalize the properties into a configuration file and UCD+P will make sure that core OpenStack types are mapped to VMware VCenter types in the configuration file.
To do this click New.., select “Configuration for VMware” for Type, select the new HelloWorld_VMware blueprint, give it a name and click Save.
This will create a property file with just the core OpenStack to VMware vCenter types mapping in it. To add the properties from the associated blueprint to it click Add . Then change the property values as required.
Select the Source tab and in the in the “resource_tree” section, change the value of the application property from TODO to “MTM” (quotes included). While I’m in the source view I’ll also take the opportunity to change the name given to the server to “mtmserver” using search and replace (Ctrl+F).
Now I’m all set. Click Provision.., specify a name for the new environment , select the Configuration file created above, change any property values if required and click Provision.
The blueprint is validated and if there are no errors UCD+P connects to vCenter and UCD to begin provisioning. A couple of informational sliders show up at the top-right of the window and clicking the View Deployment Request link displays the provisioning in progress.
Given a few minutes (or more depending on the complexity of the component processes) the agent comes on-line, registers itself to the UCD server and the component processes are kicked off in the order specified. On completion the UCD Resources page shows the new resource with the “1.0” version of the “mtm.*” components deployed on it.
As with the last post revisiting UrbanCode Deploy with vSphere and Chef here is a summary of what’s different/better/easier:
- I used a graphical editor to do most of the HOT creation and editing, with an “intelligent” text editor still available to work directly with the HOT source. In UrbanCode Deploy with vSphere and Chef I cooked up my own XML “blueprint”.
- I don’t need the generic UCD process and associated PowerCLI script to create a new VM and install the UCD agent into it. Once the blueprint is designed UCD+P takes care of all the VCenter interactions.
- I also don’t need to create the new environment from a UCD blueprint. UCD+P takes care of creating the environment, resource group and putting the agent resource in the right place.
- Deleting the environment in UCD+P cleans everything up: the VM plus the UCD environment and resources