vCloud Director Automation with RES

A while back, I needed to add a new tenant into our cloud environment.  I went through all the manual steps needed to carve out storage, compute and network resources, and after a little bit of trial and error, got the tenant deployed successfully into vCloud Director.  This process wasn’t something I did fairly often, and I was aware from previous attempts that I would miss a step or two along the way.  This time, I made sure to jot down every single step so that I would have a blueprint for any future enablements.

Once I spot checked the list and made sure all the steps were in order, I realized that rather than  having a blueprint for how to go through process, I actually had a workflow for something that should easily be automated.  In now what seems like ages ago, I got my undergrad in Computer Science.  Back then, the majority of my programming was in C++.  I was never the best coder, and it always took a little prodding to get started, but when push came to shove I usually did pretty well on my programs.  I took my first job in IT right out school, mainly because it was readily available and I did have a lot of IT experience through internships.  About a year after I graduated, I relocated to Raleigh and had an interview for a developer job.  About 20 minutes in, the interviewer said point blank that he could see I was “headed down the IT path” and wasn’t serious about a career in software development.  In a nutshell, that is how I got to where I am at today!

Having been on the support side for a long time, I’m very comfortable copying commands or scripts from a kb article and running for a specific fix.  Up until this point, I had always thought about dusting off the cobwebs and digging into Powershell or some other scripting language.  Being presented with this opportunity, I figured it was time to give it a go.  My company is a partner of RES, which among many other things, has a workflow engine for automation.  I teamed up with our RES SE for some mentoring and worked on automating the process to add a new vCD tenant.  RES has some built in modules, but nothing for NetApp storage, Cisco UCS etc.  It does have the ability to define a Powershell script as a module, so we basically took every step I had documented and created a Powershell script to perform that specific function.

2017-10-31 12_36_24- - Remote Desktop Connection

Once all the modules were complete (after much testing to ensure the proper outcome), I used the automation engine to logically group the modules by the type of technology they would be used for.

2017-10-31 12_31_52- - Remote Desktop Connection

All the heavy lifting with Powershell was done at this point, and it was time to use RES to create a workflow that would automate the entire process.  I created what RES calls a “runbook” for each tech, and added the corresponding modules in a desired order into the runbook.  Then I used RES Service Store Management Portal to create a service called VDC Tenant Onboard.  This service consists of a workflow that first prompts the user for a few pieces of information, such as Tenant Name, ID, etc.  Then it stores those inputs and passes the data through to each runbook as the workflow progresses.

2017-10-31 12_33_18- - Remote Desktop Connection

Once the workflow is complete, the infrastructure has been built and the new tenant is ready to go!  The best thing is that from the perspective of the user who needs to complete the tenant build, the only thing that needs to be done is to log into RES Service Store, request the service to create the new tenant, add a few text inputs, wait about 4 minutes and you are pretty much done!

2017-10-31 12_32_49- - Remote Desktop Connection

As a day to day admin who typically uses the GUI for just about everything, this was really powerful to see the potential of using Powershell, especially for some pretty standard vCenter functionality.  Simple things like adding a new datastore to all hosts in a cluster can be so quick and easy with a short Powershell command.  Between this and studying for the VCAP Deploy exam, I feel like my motivation to expand my Powershell abilities definitely took a big jump.  I won’t say that I’m quite back to my object oriented programming days at this point, but certainly this was a good kick in the pants to try and get coding back into my repertoire.

I know there are a lot of great resources out there, especially in the vBrownBag series in regards to automation, RestAPI, etc.  I’ll dig around a bit and try to post some resources that are especially useful for people like me who aren’t seasoned developers.

Leave a Reply

Your email address will not be published. Required fields are marked *