«

»

Jul 07

vRealize Automation 7 – Custom request form using XaaS

Have you ever wanted to simplify the catalog request form? Maybe your users don’t qualify to know how many CPUs or Memory are needed? Perhaps all you need is to have a custom request form using XaaS!

Well today I’m here to help with a simple workflow that you can customize to make your own request form. As always feel free to check out the video below, and download the package from here.

 

 

So what if you could go from this?

01-custom-request-formmp4

To this?

02-custom-request-formmp4

 

Assuming you’ve downloaded and imported the package above here’s what’s included. It’s a simple workflow that makes a decision based on the users OS selection

03-vmware-vrealize-orchestrator---administrator---va-vrabitebackrecords

 

It uses the print request to pull the JSON from that particular blueprint.

04-vmware-vrealize-orchestrator---administrator---va-vrabitebackrecords

 

Now the best part about XaaS services is that you can test them without having to go to the web interface. Use the inputs to test and troubleshoot your workflow then those will get surfaced up to vRA when you create the XaaS blueprint.

05-custom-request-formmp4

 

In this image I’m illustrating the windows and linux blueprints that are defined in the included configuration element.

06-custom-request-formmp4

 

Run the configure templates workflows to select your linux and windows base blueprints

07-custom-request-formmp4

 

After selecting those it will update the configuration element and is ready for use

11-custom-request-formmp4

 

Now you can go into vRA -> Design -> XaaS Blueprint and create a new blueprint

12-custom-request-formmp4

 

Select the workflow

13-custom-request-formmp4

 

Provide a name, description, and version

14-custom-request-formmp4

 

Now you can customize the form as you see fit. Remember though that the current workflow makes decisions and edits the request based on the scriptable tasks.

So for our OS we set it to a drop down menu

15-custom-request-formmp4

 

Give it the predefined values of Linux and Windows

16-custom-request-formmp4

 

Set it to be required

17-custom-request-formmp4

 

Then move on to Size, again set it as a drop down

18-custom-request-formmp4

 

Take a look at the scriptable task for size to see that we have defined small, medium, large, and xlarge. You can edit these in the scriptable task for your needs!

19-custom-request-formmp4

 

Set those as predetermined values in the form

20-custom-request-formmp4

 

Set it as a required field and move to Environment

21-custom-request-formmp4

 

In my example I used environment by calling out a reservation policy which I have defined Test, Dev, QA, and Prod. In your environment this may not make sense or you may want to change those settings in the scriptable task in vRO but it’s a good example.

22-custom-request-formmp4

 

Set it to required

23-custom-request-formmp4

 

Set the predetermined values (case sensitive)

24-custom-request-formmp4

 

Now we fill in the requested for, this is where I  populate it with a field value of who’s requesting it using their email. I then make it invisible to the consumer.

25-custom-request-formmp4

26-custom-request-formmp4

 

Next we add a few cool sliders with Lease and number of machines

27-custom-request-formmp4

Define min, max, increments

28-custom-request-formmp4

Now publish it and assign it to a catalog service and you’re off to the races with a customized form for your consumers. As always I hope it helps and I can’t wait to hear any feedback!

 

14 comments

Skip to comment form

  1. Bob

    Awesome post Gary!
    I have one question. I would like the user to add disks just like the IAAS blueprint. How would I modify the JSON data to do that?

    Thanks!

    1. extendingclouds.com

      There are a couple ways to do this obviously you’ll want to look at updating this portion of the catalog request
      “disks”: [
      {
      “componentTypeId”: “com.vmware.csp.iaas.blueprint.service”,
      “componentId”: null,
      “classId”: “Infrastructure.Compute.Machine.MachineDisk”,
      “typeFilter”: null,
      “data”: {
      “capacity”: “16”,
      “custom_properties”: null,
      “id”: “0”,
      “initial_location”: “”,
      “is_clone”: “true”,
      “label”: “Hard disk 1”,
      “storage_reservation_policy”: “”,
      “userCreated”: “false”,
      “volumeId”: “0”
      }
      }
      ],

      I haven’t dug into it much but it would probably look to be replaced by a string like this
      “disks”: [
      {
      “componentTypeId”: “com.vmware.csp.iaas.blueprint.service”,
      “componentId”: null,
      “classId”: “Infrastructure.Compute.Machine.MachineDisk”,
      “typeFilter”: null,
      “data”: {
      “capacity”: “16”,
      “custom_properties”: null,
      “id”: “0”,
      “initial_location”: “”,
      “is_clone”: “true”,
      “label”: “Hard disk 1”,
      “storage_reservation_policy”: “”,
      “userCreated”: “false”,
      “volumeId”: “0”
      },
      {
      “componentTypeId”: “com.vmware.csp.iaas.blueprint.service”,
      “componentId”: null,
      “classId”: “Infrastructure.Compute.Machine.MachineDisk”,
      “typeFilter”: null,
      “data”: {
      “capacity”: “16”,
      “custom_properties”: null,
      “id”: “1”,
      “initial_location”: “”,
      “is_clone”: “fals”,
      “label”: “Hard disk 2”,
      “storage_reservation_policy”: “”,
      “userCreated”: “false”,
      “volumeId”: “1”
      }
      }
      ],

      Notice the differences in the second set of {} under the disk heading. Now with that you’ll have to add an input and copy one of the existing Set scripts in the workflow. I would probably add a boolean value for the user to add disk and then a size. Then if they say yes you run the new Set disk script, if not it just submits the request.

      Alternatively you could also look to do something like setting a custom property then adding a disk with event broker during the provisioning phase like https://extendingclouds.com/new-disk-with-a-scsi-adapter-copy-2/

      Just a thought

  2. Ivan Tung

    Hi sir :
    I use version 7.0.1 . but failed .
    it show ” TypeError: Cannot call method “createCatalogClient” of null (Workflow:Print catalog item request as JSON to output / Scriptable task (item1)#1) ” on apply request .

    And I try to run the vRO flow on Jave . also failed like ….

    2016-08-20 17:49:45.853] [I] ——————————————————————- Submitting final request —————————————–
    [2016-08-20 17:49:46.080] [E] Error in (Dynamic Script Module name : requestCatalogItemWithProvisioningRequest#0) 404 Not Found
    [2016-08-20 17:49:46.092] [E] Workfow execution stack:
    ***
    item: ‘XaaS Request/item8’, state: ‘failed’, business state: ‘null’, exception: ‘404 Not Found’
    workflow: ‘XaaS Request’ (eaa6d092-0873-47e7-a912-7d059f769e04)

    Is anything I missing ?

    1. extendingclouds.com

      Ivan,

      Troubleshooting a workflow via comments is kind of tough but I would first look at the workflow to determine where in the pipeline it failed. The way that error reads is that it’s in the actual action of requesting the catalog item. Can you verify the JSON string is accurate when it executes (that will be in the log). Next can you validate that you have selected and associated the blueprints you wish to use in the workflows? That’s a start but it might be worth a webex just so I can see what’s going on.

    2. Gavin

      Hi Ivan. Did you find the solution to this problem? I am having the exact same problem. It was working fine yesterday, I didn’t change anything and today I am also getting this error. I even restarted the vRA and vRO appliances to no avail. Really stuck with this one.

  3. Jhotly Debrosse

    Hi Gary,

    I’m trying to create a blueprint that will give my developers the possibility to choose different vm templates at request time. I was thinking of using the “CloneFrom” custom property to list for example Linux templates and then be able to request it.

    What would be the best approach with XaaS ?

    Thanks,

    1. extendingclouds.com

      Well if you just want them to be able to select a blueprint you’ve already created you can utilize the built in workflows with XaaS to Request a catalog item with provisioning request.
      You could also use the method I’ve done here to just call out and execute a json command against catalog items that decides for the customer which blueprints you want to trigger.

  4. Gavin

    This looks great Gary. The download link you provided for the workflow doesn’t appear to be working. Do you have an alternative link? Thanks, Gavin

      1. Gavin

        The download linked worked a day later and I’ve been able to have a look. This is a much better solution than showing custom properties during the request stage. The Caveats with that were the allocation based on the blueprint (and changing resources later via Orchestrator didn’t accurately reflect the allocation) plus I can now use the vRA IPAM again when making a custom network selection on the form.

  5. Aaron

    How do you hide the “complex” catalog item from the end user, though? When I try, I’m unable to set requestedFor; I get 403 Forbidden.

    1. extendingclouds.com

      Aaron, Sadly because the user must be entitled to the item to request it they will still have it exposed in the catalog. What I’ve seen done is defining a category for the complex and a separate on for the XaaS. Then use message of the day to let them know only use the simple catalog items unless they are “Advanced users”

      1. Ralph

        I got around this by going back into the catalog item after everything is setup and changing the service back to “none”, which makes it now show in the catalog. Just make sure the user is entitled to the catalog item, not the (former) service. Also worth noting, my setup is a little different, but I believe the catalog item needs to be assigned to a service and show in the catalog when you select it in the TemplateSelection workflow.

  6. Gavin

    Hi Gary. I can’t seem to get setting a lease working. Even though the JSON request is showing my new lease, the provisioned resource is still shown as unlimited. Even if I set the blueprint to default to ‘1 day’ I am still unable to change this. Do you have any ideas? Thanks, Gavin

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>

%d bloggers like this: