VMware Cloud Community
TGrissom
Contributor
Contributor

Entitlements to Multiple Business Groups

I'm attempting to setup multiple Business Groups and give a select group of admin users access to request items on behalf of each of these Business Groups.

I have the environment configured as follows:

Business Group A has entitlement to CentOS 6 catalog item.

Bueiness Group B has entitlement to CentOS 6 catalog item.

User X is a support user in both Business Group A and B.

When user X logs in, there are two catalog items:

CentOS 6

Business Group A

CentOS 6

Business Group B

When user X deploys the CentOS 6 catalog item under Business Group B, the item ends up being deployed under Business Group A. I would expect this item to be deployed under Business Group B.

What would be the cause of this behavior, and is there a way to achieve the behavior I'm looking for?

0 Kudos
11 Replies
SeanKohler
Expert
Expert

We have never experienced that behavior.  That is quite strange.  If you have a single blueprint entitled to one business group and request it from that business group, it should go in that business group.  (Even if you have it available in another business group)

We do things differently.  We allow for a group to deploy machines in any business group, but they do it through a XaaS Blueprint that then uses a service account that has the entitlement to all the business groups.  The service account in this strategy acts like the person in your strategy.  We have not seen an issue with this as you describe. The service account can deploy the blueprint into any business group it is entitled to do so.

I mocked up your example though, and when I created your scenario... the behavior is as you desire.  This Win blueprint deploys in both business groups for me as a support user. (our RHEL builds are offline in lab right now, but that should be irrelevant)

multipleGroups2.jpg

I am a support user in each BG, and I am entitled to the same catalog item once in each BG.  I deploy from each.

I get both of them in the items tab because the FILTER is set to ME as the owner. 

multipleGroups3.jpg

But one is in BG A and one is in BG B.

multipleGroups4.jpg

0 Kudos
TGrissom
Contributor
Contributor

These are also XaaS requests. I'm launching a workflow which gathers the user input and then submits a request to launch the composite blueprint. In my situation though I'm giving the users the entitlement to the composite blueprint, but not assigning it to a service which keeps it from showing up on the request portal. In the end though, it sounds like it's basically the same configuration you're using except it's the user account which directly has access to the business groups rather than a service account.

Here's my results.

This is my service catalog which clearly shows I have the CentOS 6 blueprint available for two groups; Infrastructure and IT Operations.

Capture.PNG

I use the Infrastructure catalog item to request a server named TestVM1, and I use the IT Operations catalog item to request a server named TestVM2.

I end up with both being deployed under Infrastructure.

Capture2.PNG

However, if I disable the Infrastructure reservation then both items will provision to the IT Operations business group.

0 Kudos
SeanKohler
Expert
Expert

Sorry.  I am a little confused by your explanation.

1. You have a XaaS Blueprint that is entitled to the user.

2. A request of this blueprint takes in values that fulfill a server request--to include Business Group (subtenant reference)--and it runs a workflow (inside the XaaS workflow) to make a request for an IaaS Blueprint that is entitled to the user in multiple business groups? (So you are running something similar to "Request a catalog item on behalf of a user" -- using the passed user credential?)

3.  The IaaS blueprints are entitled to the user, but they do not show up for the user?  That is a strange condition.  How are you doing this?  I know of one way with a services hack.

The two items you have in the image.  These are IaaS blueprints, correct?  If you click request on each one individually... they deploy in the first business group and it's associated reservation consistently?  Or are you saying that when you run the XaaS Composite Blueprint... it does so?

If it is the "Composite" blueprint, are you sure that you are getting the correct Catalog Item target?

For example, I could see a condition where I end up calling this Catalog Item twice from a XaaS blueprint, when I think that I am calling the one on top first and then the second one second.

wtf.jpg

I just want to make sure that this is absolutely true...where you say "use" here... you are talking about clicking the "Request" button on the IaaS Blueprint Catalog Item shown in the picture?

"I use the Infrastructure catalog item to request a server named TestVM1, and I use the IT Operations catalog item to request a server named TestVM2."

0 Kudos
TGrissom
Contributor
Contributor

To clarify:

1) The catalog item in the screenshot in my prior reply is an XaaS blueprint.

2) This XaaS request takes in user and server specific information such as server name, server size, server category (dev, prod, etc.), username to be created, password, etc. I have a predefined vCACCAFE:CatalogItem defined which points to an IaaS blueprint. The workflow gets the request object, modified some of the data, then submits it.

// Get the provisioning request for the catalog item

var request = vCACCAFERequestsHelper.getProvisioningRequestForCatalogItem(catalogItem);

// Get the provisioning request data for further manipulation

var requestData = vCACCAFERequestsHelper.getProvisioningRequestData(request);

var jsonData = JSON.parse(requestData);

// ---------- Do some other things here

// Add the request data to the provisioning request

// System.log("New requestData = " + JSON.stringify(jsonData));

vCACCAFERequestsHelper.setProvisioningRequestData(request, JSON.stringify(jsonData));

// Submit the request

result = System.getModule("com.vmware.library.vcaccafe.request").requestCatalogItemWithProvisioningRequest(catalogItem, request);

3) The whole process I'm using to hide the IaaS blueprint is as follows:

   1. Publish the IaaS catalog item to a service.

   2. Entitle the user to both the item and the service the item belongs to. (At this point the IaaS catalog item shows up in the request portal.)

   3. At this point I'm able to assign this blueprint to my workflow. (See screenshot below)

   4. Now I go back to my service in vRA and remove the IaaS blueprint from the service.

At this point, my XaaS workflow can still get the request and submit it and my user is still entitled to the IaaS workflow, but it no longer shows up in the request portal.

Capture3.PNG

0 Kudos
SeanKohler
Expert
Expert

Okay... I follow.  I have seen the services hack before.  (Steve came up with it I think.)

Couple of things you probably already tried...

Syslog the "catalgogItem" organization (business group) before....

               var request = vCACCAFERequestsHelper.getProvisioningRequestForCatalogItem(catalogItem);

To really make sure that you have the correct business group... and not some unexpected behavior.


You are getting this value in your json string Syslog, but I would just really make sure that the request is going in with the right organization.


If you request the original IaaS blueprints in each business group... they do go into their business group, correct?


This would probably mean that there is some sort of issue with the RequestsHelper, because it sounds like you are doing everything correct for what you are trying to accomplish.

0 Kudos
SeanKohler
Expert
Expert

With your services hack... can you try to entitle the service and the catalog item, and then instead of removing the service... just disable the service.

If you cannot get around this issue through the method you are using, I would look into taking the user out of the picture of the IaaS deployment.  It is easy enough to take in an owner as custom property, make the request as your vRA service account  (who will own the machine initially) and then run a change owner through Event subscription to set the owner to the requester.  In this model, you do not need to to ever entitle catalog items to users and then hide them through a method that I believe shouldn't work.  It is almost like taking advantage of a bug to perform an end-to-end activity that can be solved another way.

0 Kudos
TGrissom
Contributor
Contributor

It looks like the Catalog Item's organization property is only giving me the tenant name:

DynamicWrapper (Instance) : [vCACCAFECatalogOrganizationReference]-[class com.vmware.vcac.catalog.rest.stubs.CatalogOrganizationReference] -- VALUE : Tenant: {tenant name here}

However, I do recall that when I selected the catalog item the use for the workflow I was presented with two options; one for each business group. I had selected the first one which would have been for the Infrastructure tenant. So far I've assumed that this shouldn't matter since when I disable the Infrastructure reservations, the deployment ends up in the IT Operations business unit. I am now starting to second guess that however and will try assigning the other one to the workflow and see what happens. How are you accomplishing this? Are you using some logic to actually select one of the two IaaS blueprints?

I will look into your method of using a service account for the requests to avoid using the current method.

0 Kudos
SeanKohler
Expert
Expert

I just hand in the business group (which is part of the normal form items for a XaaS request) and then I parse for the the catalog item of that business group.

in psuedocode -- (I am typing this on the fly from memory)

for each ( tempCatalogItem in catalogItems) { //this is already filtered by type of blueprint)

     if (tempCatalogItem.getOrganization().getSubtenantRef() == "MYSUBTENANTNAME"){

          catalogItem = tempCatalogItem;

     }

}

0 Kudos
TGrissom
Contributor
Contributor

Ah, this makes sense. I'll get this setup and see how it goes.

Thank you.

0 Kudos
SeanKohler
Expert
Expert

Good luck!

0 Kudos
TGrissom
Contributor
Contributor

I've updated most of what I'm doing currently to align with the model you've described. There are two last items that I'm struggling with:

1) How can I have the XaaS blueprint launch the vRO workflow as a service account?

2) I'm filtering my list of catalog items available and getting the one that matches to my requested business group, but the vCACCAFERequestsHelper.getProvisioningRequestForCatalogItem() method is still giving me the wrong catalog item. I'm currently using a workaround of just setting the business group directly on the request before submitting it.

for (var i = 0; i < catalogItems.length; i++) {

  var ciBusinessGroup = catalogItems[i].getOrganization().getSubtenantRef();

  var ciType = catalogItems[i].getProviderBinding().getProviderRef().getLabel();

  if (ciBusinessGroup == __asd_subtenantRef && ciType == 'Blueprint Service') {

  // Get the provisioning request for the catalog item

  var catalogItem = catalogItems[i]

  request = vCACCAFERequestsHelper.getProvisioningRequestForCatalogItem(catalogItem)

  }

}

Then my workaround is:

request.setBusinessGroupId(__asd_subtenantRef);

0 Kudos