I promised in the last post that I would follow up with a section 2, well here it is! How to add a new disk on a new SCSI adapter at the time of request using vRealize Automation 7 and the new event broker, this is the post you’ve been looking for!
You may recall from the previous post there was a simple request that a customer was hoping they could provision a new virtual hard disk onto a new SCSI adapter for performance purposes. While it took a bit of leg work we created a great workflow that did this for you as resource action.
Inevitably the scope of that request expanded to include doing this activity at the time of the request. Which is why I broke it down into 2 different use cases.
If you haven’t already I highly recommend reviewing the first post which illustrates how to do this as an action item exposed to an existing item.
In this post we are actually going to utilize the Event Broker. If you haven’t reviewed how powerful that is yet I recommend reviewing this post!
Here’s the video walk through that illustrates exactly what we will build in the post today. Also here’s the link to the vRO package.
In this first step we’ll examine the workflow that is “EB Triggers Add Disk”.
Specifically we’ll start with the entries in the General tab that you may choose to edit. It’s important to note that none of these MUST be changed but I suspect you have a standard that you will want to follow here.
- Choose your disk persistence mode
- Choose if you want to use thin provisioning or not
- Choose the adapter type (SAS, BUS, LSI, or PARA)
Next I’ll review the steps we take in this simple 4 step workflow
- Collect the payload (i.e. properties) being passed by vRA and populating the outputs needed to call our add disk on new adapter workflow.
- Search for the name of the machine in vCenter and output an array of objects it finds
- Convert that array into the proper VM object
- Execute the Create Disk workflow we utilized in the previous post.
Here’s an example of the script and as you can see all we are doing it populating the criteria which searches for the VM, and the custom.disk.size which we will populate based on user input during the request.
Now we move right into vRA. Go to Administration tab -> Property Dictionary
Property Definitions +new
This is were we populate the setting for the user input.
- Name: This is the property that gets passed into the vRO workflow. custom.disk.size
- Label: This is what the consumer will see
- Visiblity and Description are optional
- Order index: This is what order it will display on the request page
- Data type: Since it’s a number I choose Interger
- Required: Self explanatory
- Minimum and maximum values: You will need at least 1 for minimum or the workflow will fail
- Increment: This is how many per slide it will go up.
- Display advice: This is the type of input it will show the consumer
Next Go to Property Groups and Add a new property group.
- Name: This will be the name of the group you add to your blueprint
- ID: Will be populated for you
- Visibility and Description are optional
- Properties you will want to define these 2
- custom.disk.size will be in the dropdown since we have the definition defined, set a default value of 1 and make sure to Show in Request
- Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned with a value of * so that we pass all the properties to the payload in VRO
Once that’s complete go to Design tab and select your blueprint
Click on the blueprint in the canvas, go to the properties tab and click Add to add the property group.
Check the box to add that property
Now to validate the properties you can click on the View Merged
Finally we’ll create the proper Event Subscription
Go to Administration tab -> Events
Subscriptions and New
Select Machine provisioned
Run based on conditions – All of the following
Data > Lifecycle state name – Equals – VMPSMasterWorkflows32.MachineProvisioned
Repeat for Lifecycle state phase – Equals – POST, and blueprint name – Contains – %Blueprint Name%
Choose the EB Trigger workflow
I always set blocking task and time out for the sake of outputs and so nothing else may be running against that at the same time.
Oh and don’t forget to publish!!!
Finally go to your catalog and request the item, notice the slider that is available for your users!
After completing this you should now be able to execute the add disk on a new scsi adapter at time of request and provide the users a simple slider interface to select the disk size.