Home > Vcloud Director, vCloud Ochestrator, VMware > vCloud Orchestrator, Automating Org,vDC,vApp Provisioning via CSV Part1

vCloud Orchestrator, Automating Org,vDC,vApp Provisioning via CSV Part1


Part 2  here: https://autodiscover.wordpress.com/2013/11/11/vcloud-orchestrator-automating-orgvdcvapp-provisioning-via-csv-part2reading-csv-files/

Hi There, during the past months I was working on this insane idea of automating the cloud provisioning. I eat,drink and breath (probably piss) cloud but I had a dream about automating the provisioning cycle and making it smart.

In this blogging series we will explore how you can use your vSphere, vCenter, vCloud and vCloud Orchestrator to provisioning clouds on the fly.

I know that there are a lot of blogs out there that speaks about how you can put some workflows to provide simple provisioning, this blog will take it a notch higher by doing it in a practical way. you don’t expect in real life people to login and supply cloud’s information, everything is in Excel.

By the end of this blog series we will:

– Configure cloud provisioning to provision Org, vDC and vApp using a single user input and link 3 workflows.

– Provision a VMs based on settings supplied in a CSV file, we will customize the HD sizes and no. of those VMs based on the settings supplied in the CSV.

– We will add a twist to add approval cycle to the process and send email to the approver with the CSV file to review and a link to approve the request, cool ha Winking smile.

If you are old or new to orchestrator I guess you will like this series, we will touch on core concepts as well as new/advanced concepts with some Javascripting as well, so let us get started:

Part 1: Linking “Add Org” , “Add a vDC” and “Compose a vApp”:

before we get started, make a folder in your vCO and call it for example (Full cloud provisioning) and duplicate the “Add Org” , “Add a vDC” and “Compose a vApp”.

Create a workflow, call it Full Cloud Provisioning or any name you want, and add the workflows to it to create an org, then a vDC and a vApp, and link them together.

image

once the workflows are linked, we need to work our way through the in-parameters so we can have them set properly.

The workflows will required various inputs including the default vCloud host, Org/vDC name and various types of settings like lease duration, storage profile..etc, the most important thing for this blog post is the name, so link the inputs in the Add Org workflow as following:

image

you can set the other settings like (LDAP mode, SMTP host..etc) as attributes and pass them to the input parameters and that will make those inputs not needed thus not visible by the user, you can do the same of number of VMs, storage/memory/CPU limits, or you can have them in the presentation, for the purpose of my lab, I linked them to attributes in the my workflow, so they are static for every customer, but you might want to customize that based on your environment:

image

here is how I set my parameters:

image

Passing out-parameters to Input parameters in vCloud Orchestrator:

Before delving in this, let us discuss first the vCO attributes/input types. If you noticed in the above screenshot, you will find that we have (for example) an attribute called host and its type is vCloud: host, so what is the type thing?!

Attributes/inputs are defined in types based on their usage, so if you are doing same mathematical operations, you create a variable of type (Number), to hold text data you create a variable of type (String).

In vCO, we have additional set of types, like the vCloud:host or vCloud:vDC (those are for example, we have zillions of other types), which allows you to set these variables, parameters or inputs to carry specific type of data in them.

For Example, the host type, will always expect to carry in or out a vcloud:host data, you can’t pass text (string) to it but you can take it out as string, and same for a vDC, it will always expect to carry in/out a vDC.

Why I Explored this first, because if you set everything correctly and run the workflow, you will find that the add vDC workflow expects to be hosted within organization, and we need to specify the organization where this vDC will be hosted (and the same applies for vApp since it needs a vDC), but we can’t specify the vDC because it has been not create yet and the same is true for the organization, so how can we fix that ?!

I spent a month trying to figure this one out, I came from .net/Opalis background where we can pass the outs of one workflow/program to the inputs of another workflow/program, but this is not the case in vCO, you can’t do that.

To do that, you will need to create a parameter of the same type that you want to pass the out parameters to it , where it could be carried to the next workflow as in-parameters, you must pay attention to the type or the data won’t pass.

so for example, I created a parameter called MMvDC (I should have named it MyOrg) with the type vCloud: Organization, to carry the organization name from my “Add Org” workflow to the create vDC workflow, the same for mVDCName attribute of type vCloud:vDC to carry the vDC name from the Add a vDC workflow to the Compose a vApp workflow.

The next step is to bind the out parameters to those attribute, so to carry the organization name, I need to link this attribute with the out parameter, and since attributes are accessible across all workflows, I can use this attribute in any upcoming workflow and this is how we can skip entering organization/vDC names in subsequent workflows because they will receive those inputs with the correct types in there in parameters:

image

Now in the Add vDC workflow, you can see that it needs input (org) as type vCloud: organization, but I can supply this input on the fly from the previous workflow by linking the MMvDC attribute to the org input:

image

You can also see that I linked the vDCout parameter to the myVDCname attribute to carry the VDC to the compose vApp workflow.

image

by doing the above trick and working out the required inputs/parameters, the resulting workflow and presentation will be something like this:

image

So all what you need to do is supply organization name, and vCO will go and create in vCloud director an organization, a vDC and vApp inside that vDC to host VMs.

In the next blogpost, we will explore how we can read a CSV file and create VMs inside that vApp Winking smile.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: