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.
6 comments
1 ping
Skip to comment form
Hello from an Italian VRA/VRO newbie.
We’ve already got a multifunction (get new IP, build custom hostname, register on IPAM, register on CMDB, bells&whistles) workflow linked to VMPSMasterWorkflow32.MachineProvisioned machine state.
It works for *every* provisioned VM.
Is it possible to attach your EB Trigger as “another” subscription linked to VMPSMasterWorkflow32.MachineProvisioned state, too?
Maybe it should be run *before* our custom one, can we play with priority for this to happen?
Just another newbie question: from a single OS template, I should define four Blueprints, each one with a disk added at request time, but with different *minimum* additional disk size.
Can I define four Property Groups, each one with the same custom.disk.size property configured with his own minimum size, add them to their related blueprints, and set four subscriptions for VMPSMasterWorkflow32.MachineProvisioned machine state and matching blueprint name?
Thanks in advance
Best regards
Yes this is the beauty of the EB system you can have any number of items running at the same phase and state and have them run based on priority. One important gotcha is that if you are updating any properties from a workflow in the same phase it will not get the update in the next workflow if running on the same phase.
Priority of the running subscriptions are based on the number lowest first (ie 1 runs before 2) and then by alphabetical order if they are using the same priority.
Hello Gary, great article. Your series on the Event Broker is very easy to follow, and very informative. I had a question about this particular workflow. Can it be modified to increase the size of Hard Disk 1 instead of adding a second disk? Thank you.
JB probably could increase the size but the bigger issue is how you expand the drive on the OS automating that would be the bigger challenge I believe!
What if you want to use the original SCSI controller 0 and simply add a second disk? I assume I can pick drop drown for a specified 250,500, 1000GB drive. what if none is selected?
There is actually an out of the box workflow that allows you to add a hard disk and it will do that against your exiting SCSI controller. If you use that and set up the right values you can automate that very quickly!
[…] be a great place for all of us to share blueprints, workflows, scripts, and CLI. This is where my add disk workflows are, where my prepare vRA template for windows is, and where all future content […]