VMware Cloud Community
dgberrid
Enthusiast
Enthusiast

Set Vrm.DataCenter.Location based off of other Blueprint properties set by User?

Hello, how can you set the Vrm.DataCenter.Location (or any property for that matter) to a *single* value based off of user input on a Blueprint. 

What I would like to do is set the Vrm.DataCenter.Location based off of a location property set in a dropdown by the user and a hidden property set on the blueprint.

My location dropdown has 2 values: North and South, the blueprint will have a statically set property which describes what type of server the blueprint is going to provision. This could be web, middle, db, etc. The combination of the location and the type will be used to set the Vrm.DataCenter.Location. So if the user has set the location to North on the type 'web' blueprint the Vrm.DataCenter.Location will be set to North-web. I would like this to be done transparently in the background (Vrm.DataCenter.Location should be hidden).

I am able to set the Vrm.DataCenter.Location setting its type to a dropdown and binding the other two properties as inputs to the external source using a vRO action but this forces Vrm.DataCenter.Location to be a dropdown but I don't want this. For one Vrm.DataCenter.Location will always be a single value once a user selects North or South and secondly you can't set a default value on the dropdown when it is populated by an external vRO action which would force the user to have to select the single element in the dropdown!

I know you can use xml value expressions but I would really, really like to use vRO.

Reply
0 Kudos
12 Replies
daphnissov
Immortal
Immortal

So this use case is something I've done a few times now exactly as you describe. The idea, as you outlined, being that you have one or more custom properties that are present (maybe statically set and user set) that influence, transparently, the value of another custom property. It's really very easy and extremely flexible with the Property Toolkit module from SovLabs. I wrote a blog here that outlines what you're trying to do and demonstrates how to set all this using dynamic property sets. Best part about it is it requires zero custom vRO code to accomplish and everything is done within vRA itself.

Reply
0 Kudos
dgberrid
Enthusiast
Enthusiast

Thank you, this seems to be what I need. I'm just waiting for them to respond with the free trial.
Reply
0 Kudos
AnotherPassword
Enthusiast
Enthusiast

I have the same requirement. Beyond SovLabs Property Toolkit, is there a way to do this using vRA/vRO?
Reply
0 Kudos
hawks76
Enthusiast
Enthusiast

Yes, you can do it without the Property Toolkit.  Basically, you will need a custom actions that accepts your input (properties that determine the location), processes it, and returns a value to a dropdown menu.  I use this quite a bit in our blueprints, and it work well.

Reply
0 Kudos
dgberrid
Enthusiast
Enthusiast

I've been exploring using the Event Broker to set the property when the Catalog Item is requested.  I am attempting to get th request using vCACCAFEEntitiesFinder.getCatalogItemRequest method. The problem I'm now running into is that the vcaccafe plugin is broke and won't return any requests. Apparently a known issue, https://communities.vmware.com/thread/573870.
Reply
0 Kudos
hawks76
Enthusiast
Enthusiast

We also use the payload to set and update custom properties in the Machine Requested Pre with the Event Broker.  Just make Vrm.DataCenter.Location a custom property on the blueprint, and then you can update it via EBS prior to build time. 

Reply
0 Kudos
AnotherPassword
Enthusiast
Enthusiast

The issue I have is I only have 1 environment. I was looking for a way to test my setup using a vRO action, which will populate the VirtualMachine.Network0.Name dropdown list, but also keep the way I have VirtualMachine.Network0.Name setup in the dictionary as a text field.

I can't do this since once it is defined as a property definition, it is stuck that way. I was not sure if i could set that property at the blueprint level using VirtualMachine.Network0.Name and some tilde ~ special character trick to reference another property.

Reply
0 Kudos
dgberrid
Enthusiast
Enthusiast

I set up the EBS to set the Vrm.DataCenter.Location Property based on inputs but the requests fail with this error...

Allocate reservation operation failed for business group

How can I get the event broker to fire before vRA tries allocating reservations?

Reply
0 Kudos
hawks76
Enthusiast
Enthusiast

Where is the EBS set to run?  If it is running at Machine Requested PRE, that's as early as it can run unless you shim the Approval process with a workflow.  I've heard of that working, and i have some code from VMWare PSO, but never tried it. Maybe the better option is to create a custom action that is linked to a dropdown on the form that returns what you want as far as location so the end user only has one choice.  If you want to take a look at that option, let me know and i can provide further details on how it can be done.

Reply
0 Kudos
dgberrid
Enthusiast
Enthusiast

The EBS was set to run on Machine Requested PRE. I set an approval on the catalog item but the request failed and the workflow never ran.

As for the other option, I have already set that up but I don't like have the end-user be forced to select the data cluster from a drop-down. I wish VMware had at least allowed for a parameter to be sent back that makes the single element sent back to the drop-down the default selected. Then I could make the drop-down hidden. I want the user to just select what datacenter they want the VM at and let vRA handle the Vrm.DataCenter.Location.

I think the next route I will look at is fixing the vCACCAFE plugin so I can trigger a workflow to update the request with the correct Vrm.DataCenter.Location property using the Catalog Item Requested event.

Reply
0 Kudos
vMbanusi
Contributor
Contributor

Hi, I've got this same use case, and wondering if anyone was able to get Vrm.DataCenter.Location loaded in the background with a value, through a script action before it launches the request.

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

Hello!

In vRA 7.4 you can do this quite easily with Custom Forms. As far as I know in versions < 7.4 there is no out-of-the-box Solution for this.

Robert

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos