«

»

Mar 14

New disk on a new SCSI adapter at request time

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.

  1. Choose your disk persistence mode
  2. Choose if you want to use thin provisioning or not
  3. Choose the adapter type (SAS, BUS, LSI, or PARA)

01-disk-add-at-provision-timemp4

 

Next I’ll review the steps we take in this simple 4 step workflow

  1. Collect the payload (i.e. properties) being passed by vRA and populating the outputs needed to call our add disk on new adapter workflow.
  2. Search for the name of the machine in vCenter and output an array of objects it finds
  3. Convert that array into the proper VM object
  4. Execute the Create Disk workflow we utilized in the previous post.

02-disk-add-at-provision-timemp4

 

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.

03-disk-add-at-provision-timemp4

 

Now we move right into vRA. Go to Administration tab -> Property Dictionary

04-disk-add-at-provision-timemp4

 

Property Definitions +new

05-disk-add-at-provision-timemp4

 

This is were we populate the setting for the user input.

  1. Name: This is the property that gets passed into the vRO workflow. custom.disk.size
  2. Label: This is what the consumer will see
  3. Visiblity and Description are optional
  4. Order index: This is what order it will display on the request page
  5. Data type: Since it’s a number I choose Interger
  6. Required: Self explanatory
  7. Minimum and maximum values: You will need at least 1 for minimum or the workflow will fail
  8. Increment: This is how many per slide it will go up.
  9. Display advice: This is the type of input it will show the consumer

06-disk-add-at-provision-timemp4

 

Next Go to Property Groups and Add a new property group.

  1. Name: This will be the name of the group you add to your blueprint
  2. ID: Will be populated for you
  3. Visibility and Description are optional
  4. Properties you will want to define these 2
    1. 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
    2. Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned with a value of * so that we pass all the properties to the payload in VRO

08-disk-add-at-provision-timemp4

 

Once that’s complete go to Design tab and select your blueprint

10-disk-add-at-provision-timemp4

 

Click on the blueprint in the canvas, go to the properties tab and click Add to add the property group.

11-disk-add-at-provision-timemp4

 

Check the box to add that property

12-disk-add-at-provision-timemp4

 

Now to validate the properties you can click on the View Merged

13-disk-add-at-provision-timemp4

 

Finally we’ll create the proper Event Subscription

Go to Administration tab -> Events

14-disk-add-at-provision-timemp4

 

Subscriptions and New

15-disk-add-at-provision-timemp4

 

Select Machine provisioned

16-disk-add-at-provision-timemp4

 

Run based on conditions – All of the following

Data > Lifecycle state name – Equals – VMPSMasterWorkflows32.MachineProvisioned

 

17-disk-add-at-provision-timemp4

 

Repeat for Lifecycle state phase – Equals – POST, and blueprint name – Contains – %Blueprint Name%

18-disk-add-at-provision-timemp4

 

Choose the EB Trigger workflow

19-disk-add-at-provision-timemp4

 

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.

20-disk-add-at-provision-timemp4

 

Oh and don’t forget to publish!!!

21-disk-add-at-provision-timemp4

 

Finally go to your catalog and request the item, notice the slider that is available for your users!

22-disk-add-at-provision-timemp4

 

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

  1. Ferdinando Simonetti

    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

    1. gary.coburn

      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.

  2. JB

    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.

    1. gary.coburn

      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!

  3. Damion Terrel

    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?

    1. gary.coburn

      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!

  1. Introduction to the VMware Sample Exchange » Extending Clouds

    […] 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 […]

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>