VMware Cloud Community
sbeaver
Leadership
Leadership
Jump to solution

Who thinks they might be able to point me in the right direction?

Long story short, I am working on recreating and enhancing my blueprint as an Advanced Service utilizing the request a catalog item workflow.  I have been able to recreate and enhance most of the blueprint but I am struggling with finding a way to reproduce one specific area.  On the storage tab of a blueprint, you have the option to click a link to add more storage.  I am going to assume some kind of function.  In my first attempt I have a check box that when checked will present 3 other windows to get the answer to size, drive letter and label. So I am thinking I can might be able to use the link property but this is where i could use some input.  I guess I could copy and past and keep hidden but that just does not sound that efficient

Everybody understand what I am really looking to do and have anything to share with the class?

Cheers

Steve. 

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
1 Solution

Accepted Solutions
sbeaver
Leadership
Leadership
Jump to solution

kumarankpl posted the link for the true method to get the owner.  Now with that said when you are using the Advanced Designer with the request a catalog item vCAC will present additional properties and value that are...

__asd_requestedBy -- upn of requesting owner

__asd_requestedFor  -- upn of designated user requested for

__asd_tenantRef -- name of tennent (vsphere.local)

__asd_subtenantRef -- GUID of tenent

__asd_catalogRequestId -- GUID for request record in database

So knowing that these variables will be coming from vCAC to VCO when  request using the designer comes I have created an action that is the first thing of the VCO workflow that runs and gets the value that vCAC presented

See if you have this folder of actions...  com.vmware.library.asd

If you do not, here are the command for the actions

return System.getContext().getParameter("__asd_catalogRequestBy");

Cheers

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**

View solution in original post

0 Kudos
34 Replies
poorem
Enthusiast
Enthusiast
Jump to solution

Hi Steve,

We've been working on something very similar on the project that I'm working on at present. The service that we're creating fortunately places certain restrictions on the Virtual Machine being provisioned which have helped us out. Rather than try to recreate the entire functionality offered by the standard IaaS blueprint form, we only have to create the new disks - it is up to the owner of the VM to configure them.

On the ASD form, we're asking how many disks should be added to the VM. The default is 1 (the system disk) and the maximum is 15. Depending on the number selected, we reveal that number of drop-downs to select the individual drive sizes (the sizes shown are pulled from the blueprint min / max sizes and we list the sizes in-between in pre-determined increments).

The actual blueprints are entitled only to a specific automation user account so that normal users cannot see them. The ASD workflow requests the catalog item as this automation user account. Once provisioning is completed we're changing the owner of the VM in the background to that of the user who submitted the ASD request.

It all works well so far but I'll have to look into what I can share publicly as it contains customer specific information.

Michael

0 Kudos
kumarankpl
Hot Shot
Hot Shot
Jump to solution

The idea looks good. But from 6.2 onward's you can have Maximum of 60 disks(previously its was 15 disk). And how are you doing the change owner action from UI or through vCO workflows?

0 Kudos
poorem
Enthusiast
Enthusiast
Jump to solution

This is built on 6.1 so the disk limit is still in place. Yeah, it wouldn't scale very well up to 60 disks but, as I mentioned, this customer is restricting their service to 15 disks.

The change owner is executed using vCO requesting a resource action on the machine:

System.getModule("com.vmware.library.vcaccafe.request").requestResourceAction(operation,inputs)

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

I am using the request a catalog item as the service blueprint which allows me to set the owner as the person who submitted the request

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
SeanKohler
Expert
Expert
Jump to solution


Steve,

I hope you will be sharing a lot of detail about this ASD request form you made! Smiley Wink

If you were looking at simplifying the process a bit, you could make storage addition a day 2 service.  You could just allow the machine to be provisioned with storage defined by the Blueprint, and then present the option through a Resource Action to extend or add storage.

That can be done through VC and the inventory service in VCAC will come back through and pick up the disk architecture changes and present them appropriately in the machine item.

If that was operationally acceptable, it may be a viable workaround.

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

I was struggling a little with adding the storage as a 2nd day operation in that the disk would be presented but configuring the drive to automate creating the drive, volume and partition.  Enough so that I added the guest agent to my templates.  For this this version of the zone I have enough hidden properties for the end user to add up to 5 drives.  I have a great deal more control for the logic / data driven dynamic properties.  I tried a couple of different variations with one blueprint to do all servers in one and settled for one blueprint for windows and one for linux.

So attached is what the end product looks like

Cheers

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
SeanKohler
Expert
Expert
Jump to solution


Cool... Great work Steve!

How are you building the dropdowns?  In vRA or vRO.

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

This version is mainly configured from vCO but there were a couple of the settings that were done in vRA, namely I have an offering or size that is calculated based on the amount of CPU and RAM and that action is run from vRA but most of there others actions were done inside vCO

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

Steve,

I was wondering if you could give me a pointer on how you set the owner as the person who submitted the request?  I struggling a bit with this piece in my script.

Thanks,

Steve

P.S. Good name, by the way!

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

kumarankpl posted the link for the true method to get the owner.  Now with that said when you are using the Advanced Designer with the request a catalog item vCAC will present additional properties and value that are...

__asd_requestedBy -- upn of requesting owner

__asd_requestedFor  -- upn of designated user requested for

__asd_tenantRef -- name of tennent (vsphere.local)

__asd_subtenantRef -- GUID of tenent

__asd_catalogRequestId -- GUID for request record in database

So knowing that these variables will be coming from vCAC to VCO when  request using the designer comes I have created an action that is the first thing of the VCO workflow that runs and gets the value that vCAC presented

See if you have this folder of actions...  com.vmware.library.asd

If you do not, here are the command for the actions

return System.getContext().getParameter("__asd_catalogRequestBy");

Cheers

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
thawkbravo
Enthusiast
Enthusiast
Jump to solution

Thanks for posting the code. I have been looking for this line of code for past few days.

0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

Thanks for both responses.  I am using 6.1 and I get a null pointer exception even when submitting all properties for "request a catalog item".  Instead, I have been requesting the catalog item with the API call.  This works fine, but I can't seem to set the user name to the currently logged in user when I call it from ASD. I loaded the actions that you refer to and tried to assign the UserName input from the asd_requestedBy and the asd_requestedFor, but they both appeared blank during a catalog request.  Maybe they don't work with an API request?  Maybe I have to get the catalog request workflow to work.  Have you had success with the "request a catalog item" workflow with 6.1?

Thanks,

Steve

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

I have a really cool custom form that is using the Request a catalog item for a user that I am not sure if I started that on 6.1 or 6.2 but it is working really well.  What steps did you follow to setup the properties for the workflow?  There are a few properties that have to be a specific way.  Can you post the code you were using to create the properties to make the request?  The provider-property part

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

I tried just the minimum fields, but with this last try, I submitted all of them.  I attached a pic of the properties below.  I have removed any potentially proprietary data, but all of the syntax is there.  This was just a test case, so I manually selected the catalog item and matching ID I had from a JSON request.

Thanks for checking it out,

Steve

0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

Also, the catalogitemrequest variable is never set.  I get the error java.lang.nullpointexception (Dynamic ScriptModule name: requestCatalogItem#1).

I am worried it is a 6.1 issue, but I may be wrong.  As I mentioned, if I just request with an api call, it works fine except the username is not set unless I set it manually.  I tried a few methods to try and set it programatically.

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

Your code has what I was looking for so can you post the plugin version you are using?  When I get into the office this morning I will verify what my cluster has installed and see if we match  Smiley Happy

Cheers!

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

These are the plugin versions I am using on one of my vCO cluster that is working

vCloud Automation Center 6.1.0.2246588

vCAC Infrastructure Administration 6.1.0.2040915

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
SeanKohler
Expert
Expert
Jump to solution


One thing of note (that you may already know)... after a workflow run requested through ASD, all of the variables are shown as part of the run.

asdVariables.jpg