Well happy new year and welcome to 2016! Between automation releases and cloud native applications activity, it’s going to be a very exciting year for all of us in IT.
Ever since I posted it, the “How bout we let users set their default admin or root password?” (use this for v 6)3 has been one of the most popular hits. Thankfully it has stood the stand of time through the last 2 years of vRA 6. Now that vRA 7 is here and more importantly the Event Broker, it’s time to document an updated workflow.
So let’s jump right in, there are a couple of pre-reqs that I’m assuming
- You have already setup vRA 7
- vRO (embedded) is setup as an Orchestration endpoint
- vCenter has been configured in vRO and vRA
- Downloaded my new vRA 7 ready Event Broker example package
- A linux or windows catalog item to provision
First we log into the vRO client and go to the EB Set Admin Password Example and open the Schema tab. Here you’ll see a simple 5 step workflow that does all the work to set the admin passwords.
Now let’s walk through each step, starting with the Collect vRA Payload script. I go to the Visual Binding to illustrate the variable handling.
Next we look at the Scripting tab and you can think of this as the old workflow template which is where we’ll pull in and create any logic. Here we pull out the OS, the Password, and the VM name to use in the next step.
Next step in the workflow is to get the VM by name. In this example I’m just showing you that I copied the out of the box workflow (no customization) and am passing the VM name to the criteria input for that workflow.
Next we’ll open the Convert to VC:VM and go to the Visual Binding tab to illustrate we are taking the output from the virtual machine by name and converting it to a single object.
In the scripting tab we pull the array value from “vms” and push it to the “vm” object, we also build the logic to execute the specific guest commands based on the operating system.
Final step for the workflow is to put the Run program in guest (again no customization of this standard workflow).
And now for the last piece within vRO, you will need to edit in your environment if you choose to use this workflow. You will need to set your default password which we use to login and run the commands to set it to the user requested password.
Now let’s go log into vRA web interface go to Administration -> Events
Subscriptions -> New
In this workflow we’ll use Machine Provisioning
Select Run based on conditions, All of the following, expand Data and select Lifecycle state name
Set it control to Equals and in the 3rd box hit the drop down to see the list of events. As you can see this list is very robust! Scroll all the way down to VMPSMasterWorkflow32.MachineActivated
Next we repeat the above steps choosing Lifecycle state phase, Equals, and POST.
Next we select our EB Set Admin Password Example workflow
Set a timeout and check blocking
Now we select the subscription we created and publish it
Now we just need to created the password box during request time. Administration tab -> Property Dictionary
Then Property Definitions -> New
Name is what we collect in the workflow, label is what the users sees, and the rest of these are pretty self explanitory.
Finally we assign the custom properties to the blueprint. Design tab -> Blueprints -> Select your blueprint to edit
Select the VM -> Properties tab -> Custom Properties. You will just plug in the property which will be available via drop down, and slect to have it to show in request.
Then create the extendingclouds.os and assign a value of Linux or other
And create the following property which passes all of these properties at a very specific time. I’ll cover these details in my Event Broker post.
Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineActivated and set the value to * so every value gets passed
Now request your VM and watch the magic!!!
As I stated through this post we will be doing a number of posts about this new Event Broker because of it’s power and flexibility so stay tuned!