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?
To this?
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
It uses the print request to pull the JSON from that particular blueprint.
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.
In this image I’m illustrating the windows and linux blueprints that are defined in the included configuration element.
Run the configure templates workflows to select your linux and windows base blueprints
After selecting those it will update the configuration element and is ready for use
Now you can go into vRA -> Design -> XaaS Blueprint and create a new blueprint
Select the workflow
Provide a name, description, and version
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
Give it the predefined values of Linux and Windows
Set it to be required
Then move on to Size, again set it as a drop down
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!
Set those as predetermined values in the form
Set it as a required field and move to Environment
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.
Set it to required
Set the predetermined values (case sensitive)
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.
Next we add a few cool sliders with Lease and number of machines
Define min, max, increments
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
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!
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
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 ?
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.
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.
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,
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.
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
Try this one https://vdc-download.vmware.com/sampleExchange/v1/downloads/sampleFile/55627?raw=true
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.
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.
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”
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.
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