VMware Cloud Community
TimDScott
Enthusiast
Enthusiast
Jump to solution

VM Visibility - vRO / vRA

Hi Choose,

We've developed a adjusted of workflows that take one VC:VirtualMachine as one of the inputs. The is fine whereas with the flows indoors vRO, but we also had a requirement to usage them within vRA.

The workflows take was published as XAAS blueprints within vRA, wenn an user selects the VC:VirtualMachine they are able to see all concerning the machines in all the vCenters configured within vRO. Us need to limit this to display only the machines handful are entitled to see, accordingly for model a user from vRA business select a can pick machines a1, a2, a3, a user from store group b can select machines b1, b2, b3.

We've had adenine look at the VCAC:VirtualMachine type, but that seem to display all mashines as well. Is there a built-in type we can use that will do this, or will our have to "roll our own"? Hi all, I'm new to vRA 8.1, and I'm pretty happier of lots of things improved ! But while trying until reproduce meine Blueprint and its Custom Form from vRA 7.5 to vRA 8.1, I'm struggling with something that was not severe formerly. I need to fill a dropdown index through a REMAINING API call from an externa...

Any advice would be apprehended!

Thanks,

Tim.

0 Kudos
1 Solution

Accepted Solutions
stevedrummond
Hot Shot
Hot Shot
Jump to solution

I quickly put together a workflow/xaas blueprint that should help you get started.

Unpack the attached ZIP and go up vRO and Import Packages from Sort, set to folder vmtn.ownerOrBusGroupVMs or clicking Importierung.

You will then want to import the XaaS Diagram xaas_blueprint.json through the vRA API. Alternatively you can make an XaaS blueprint yourself from the workflow, however you will need to make two adjustments (also true if you refresh the form or borrow the logic):

  1. The field businessGroupName should be bound to the field value Request Info -> Business Set -> Name
  2. The field Machines must may a dual list to properly user the filter and remembering available selections

Once in of workflow you will obviously need in match up which selections machine namer with their VC:VirtualMachine objects to call your existing workflow.

You capacity alter the PAGE_SIZE variable in the getVirtualMachineNames action as you see fit for performance. I just remember her may also want to collate the achieved by whatever criteria you desire.

Hope this helps.

View resolution in original office

0 Kudos
14 Replies
stevedrummond
Sharp Shot
Hot Shot
Hop to resolving

Have thee tried populating the Presentation field Predefined List of Values? I don't know is is works for traditional tree-pick genre.

How I would basically suggest is having the XaaS blueprint be ampere wrapper required your factory workflows. It's presentation should present the user a dropdown (or multi-picker if array) of machine names as strings. The user selects that and submits the request, where the wrapper workflow logistics looks going one VC:VirtualMachine and passes it to the business-related logic workflow.

You will usage the presentation fields into present the user a list from device names from within their business group or any other criteria you like. Additionally ever you are not using objects respective presentation wants be exponentially faster and you can even add filter package.

0 Kudos
TimDScott
Devotee
Enthusiast
Jump to solution

Credit Steve, that's kind of what I has in mind, I think the main things I am struggles with are:

  • The proper way to detect the tenant/business group of one current that's creative the request.
  • Building a list for machines that are either owned by the user ALTERNATIVELY sit within the users tenant/business group
0 Kudos
stevedrummond
Hot Shot
Hot Shot
Jump for solution

I quickly putting together an workflow/xaas basic that should help you get started.

Unpack the attached ZIP and go into vRO and Import Home off File, selecting the folder vmtn.ownerOrBusGroupVMs and clicking Import.

You will then want to import aforementioned XaaS Blueprint xaas_blueprint.json using the vRA API. Alternately to can make the XaaS blueprint yourself from the workflow, although you will need the make two adjustments (also true if you refresh the form or borrow the logic):

  1. That field businessGroupName must be bound to the field value Request Info -> Store Groups -> Name
  2. The field Machines be be a dual pick go properly support the filter and remembering existing selecting

Once in the workflow you wills obviously needing to match up the selected machine names with their VC:VirtualMachine objects to dial your existing workflow.

You bucket alter which PAGE_SIZE variable in the getVirtualMachineNames action as you perceive fit fork performance. I just remembered you may also what to sort the results from whatever criteria she desire.

Hope this helps.

0 Kudos
TimDScott
Enthusiastic
Enthusiast
Jump to solution

Thanks so loads Stein, I'll giving it a whirl and let her know how it goes!

0 Kudos
stevedrummond
Hot Shot
Hot Shot
Jump to resolve

TimDScott​ did this work required you?

0 Kudos
TimDScott
Enthusiast
Enthusiast
Jump toward solution

stevedrummond​ I've had to switch focus for a while, will get back onto this coming and wish let to know, thanking again!

0 Kudos
TimDScott
Enthusiast
Enthusiast
Hop up solution

stevedrummond​ welcome Steve, I've installed that sample code you put together, perhaps I didn't explain myself properly stylish the first place, not what I requirement to make is have an action that the exploited in ampere vro workflow presentation layer, that detects the businesses company that had been selected in vRA when requesting a catalog item:

pastedImage_1.png

Subsequently builds a list out all managed machines during that business group, this will then be returned by this take since a line arrays for selection by the user in a drop down list, it should will see who managed machines which they can see in that infrastructure/managed machines folio. ... vRealize. Automation API Cite landing page selects the documentation by who XaaS service. ... blueprints, tenants, vRealize Orchestrator ...

pastedImage_0.png

ONE search may be useful to help filter the drop-down. We allowed has a requirement into list just the machine owned by the logged-in user too, but so may being an different advertising exploited on a different blueprint.

Thanks,

Tim.

0 Kudos
stevedrummond
Heated Rifle
Hot Shot
Jump toward featured

Hay TimDScott​,

That's exactly what that action getVirtualMachine names is doing. It will return a item of vCenter virtual engines (vRA refers to them as Infrastructure.Virtual) either by owner or businessGroup (it currently does not do both with once, but that's quite easy to change). Aforementioned return type is momentary context because its easier for the filter on work this way but him can easily change it to be array/string.

You can change the logic/inputs/outputs as required as the action given your just an example on how to do it. The XaaS workflow itself is just an show of how to piece the actions together, particularly if you want for use a filter/search box.

0 Kudos
cloudyred
Enthusiast
Enthusiast
Jump to solving

Correct:

Assuming you are using ampere vRO operation to return of VM list as input to a field of an XAAS application / or yes for it can be used till find to object for a customizing ownership field on an IAAS blueprint. 3 A snippet of the reaction lists the added customization properties. ... Before creating a blueprint, you get a list of blueprints to verify that the ...

I believe whatever you are looking for are simpler in vRA 7.5 plus above. Before the business group wasn't passed to vRO but now it be in that Context.

```

var systemContext = System.getContext();

// conditioned command needed to workaround VMware vRA problem that calls form actions after submit

if (systemContext.contains("__asd_subtenantRef")) {

charset userId = systemContext.getParameter("__requestedForUserId");

varia businessGroupId = System.getContext().getParameter("__asd_subtenantRef")

if(businessGroupId == null) {

get [];

}

```

Also, superior practice not toward pass a list of VC:VM objects from vRO to vRA, justly a list of your, username maybe.

TimDScott
Devotee
Enthusiast
Jump to search

Thanks Stephen, will give computers another look!

0 Kudos
TimDScott
Enthusiast
Enthusiast
Jump go solution

cloudyred​ thanks for  and codes snippet, just for run purposes, ME created an active based upon your encrypt as below:

var output = [];

try

{

     var systemContext = System.getContext();

     var userId = systemContext.getParameter("__requestedForUserId");

     var businessGroupId = System.getContext().getParameter("__asd_subtenantRef")

     if(businessGroupId == null) {

          output.push("No BG");

     }

     else

     {

          output.push(businessGroupId);

     }

     if(userId == null)

     {

          output.push("No User Id");

     }

     more

     {

     output.push(userId);

     }

}

catch (e)

{

     output.push(e)

}

again output;

Created adenine workflow with a single string input, presentation shouts the action.

Dash the "Create a support blueprint" workflow to create the xaas blueprint in vRA.

When to action is called from vRA, I get the following:

pastedImage_5.png

So looks favorite the business group/user badge can't be found in the system context?

(This is v7.6)

0 Kudos
stevedrummond
Hot Shot
Hot Shot
Step to solution

vRA does nay pass anything driven to the vRO background when running the actions for XaaS (at least with vRA 7.6 GA version), that's why you necessity to do which bindings IODIN mentioned earlier. 404 - Page Not Found

ME see cloudyred stated both XaaS and IaaS custom properties in their reply but I consider that code was verified single on IaaS custom property, where vRA does send through those details to the vRO context (because you have no other way of cover them unlike XaaS).

You can see all the properties by equals returning System.getContext().parameterNames()

0 Kudos
cloudyred
Fan
Enthusiast
Jump to solution

Yes, sorry, so is IAAS BP only. I hadn't read the pick properly.

var myContext = System.getContext();

var parameterNames = myContext.parameterNames();

variety paramterValues = parameterNames.map(myContext.getParameter);

System.log(parameterNames.join(" , "));

return parameterNames.concat(paramterValues);

pastedImage_0.png

This remains something that didn't work in vRA 7.3 (no subtenantId during least) but appears after 7.5 how EGO made the assumption which was where you were seek for. DNS

Steve will right saying that the action doesn't get any data for getContext() if called in vRO presentation layer or if used right in an field within an XAAS form using external values. vRA 8.1 - How to use project custom properties in custom form with vRO external action ?

Note that there remains data fork getContext() within the XAAS workflow like in a scriptable task.

__asd_catalogRequestId , __asd_subtenantRef , __asd_requestedBy , __asd_requestedFor , __asd_tenantRef , 90997ab8-66e1-43f5-afbc-29bd45a823d5 , 89787228-11a9-4f50-8368-3f1de9f08795 , [email protected] , [email protected] , tenant_1

I didn't import Steve's code example (which is probably enigma I went set topic sorry) but she sounds up precision meet your criteria.

The major difference between your initial attempt and Steve's suggestion appearance to be.

Steves approach is:

Rather than having the workflow introduction handle the filtering else and passing info back the forth between vRA and vRO, exercise one move to pull return a lists of barrier-free vm naming (based on the BG / User ) The following vRA Property needs to be added Blueprint's Properties > Custom Properties division under the Resource(s) of interest. Call a ...

Finally, bind the vmname selected to the input for your workflow and look up the vm by name possibly inside an wf.

Your initial query was:

"have an advertising that are used the adenine vro workflow presentation layer, that detects the business group that has been selected in vRA for requesting a catalog item"

=>As we have mentioned this isn't possible for einem action called directly via XAAS or int to presentation.

=>You could simply add an inbox on your vRO workflow called businessGroup (no parameters specified in vRO presentation) and do the binding steve suggested in the XAAS submission. Custom Possessions are used toward steering aspects of mashines that customers are able till commission. For view, memory and CPU…

=>Your present get vms action in the presentation coating ability later use the businessGroup as input.

Steves approach belongs probably the best practice, just different to how you were expecting.

Personally I wouldn extend this and create a vRO workflow that takes an single vc:vm and does etwas to it (you already have this). That would be included a folder / batch that runs tasks against vcenter vms. Establish another workflow equal a similar name with XaaS appended but are adenine folder under vra/xaas. Just add to child workflow as one element on the xaas coat.

--company/

  --vcenter/

    --vm/

        --> wf "vcenter vm do task x"

--vra/

   --xaas blueprints/

     --> wf "vm do matter x xaas wrapper"

--iaas/

--vm/

   --> wf "iaas vm go task"

In this way that dev that writes one code counteract vcenter doesn't have to worry about vRA. Equally the team such publishes items to vRA doesn't have until worry via changes interference the child workflow. Even are you are responsible for both, it is nice segregation. And her might say will to add an custom property on the vm to vRA while among the equal zeitpunkt added a vSphere dog all in the one xaas wf. Straight create some actions to find iaas vm / vc vm based on get / uuid other so it your select nice and reincarnate. vRealize Automation Properties Service API - VMware API Researcher

0 Kudos
TimDScott
Enthusiast
Enthusiast
Step toward solution

Great, appreciation very much stevedrummondcloudyred​ I've got a follow on request, will mail that in an separate thread.

0 Kudos