VMware Cloud Community
rohankumbhare
Contributor
Contributor
Jump to solution

Getting a Drop-Down for Clusters and Datacenters in Blueprint in VRA 8.1

Hi Team,

We're working in a use-case wherein we have a requirement to get the drop-downs for vcenter cluster within the VRA 8.1, we're achieved network and OS flavors using the Json code but unable to find the parameters which match the vcenter Clusters and Datacenters.

Few example:

formatVersion: 1
inputs:
OSSelection:
type: string
title: Operating System
description: Operating System of the Virtual Machine
enum:
- win_2012_R2
- win_2016
- win_2019
default: win_2019
networkvlan:
type: string
title: Network
description: Network of the Virtual Machine
enum:
- VLAN100
- VLAN234
- VLAN235
default: VLAN100
Machine:
type: Cloud.vSphere.Machine
properties:
name: '${input.ServerName}'
image: '${input.OSSelection}'
customizationSpec: '${input.domain}'
cpuCount: '${input.cpuCount}'
totalMemoryMB: '${input.totalMemoryMB}'
networks:
- network: '${resource.Network.id}'

The way we had the parameters for name, image, customizationSpec, network Etc

We need the parameters for Cluster and Datacenters where we can select the drop-downs for Zones in the blueprint.

 

Thanks...

Rohan

0 Kudos
1 Solution

Accepted Solutions
shyamgopal
Contributor
Contributor
Jump to solution

As @jimmyvandermast suggested, the vRA 8.x way of achieving what you are trying to do is through the use of Tags.

You are attempting to make a VM placement decision by asking the user to pick the DC and Cluster. This is not the vRA 8 way of achieving this.

here is what you should do:

1. If you have multiple vCenters Tag those seperately (e.g"Site:DFW" )

2. Add a tag to your Cloud Zone (e.g) "Environment:SQA"

3. In you Blueprint add an input like this 

=================

dataCenter:
type: string
description: Datacenter where this server will be deployed
default: 'Site:DFW'
title: Datacenter Name
oneOf:
- title: Dallas DC
const: 'Site:DFW'
- title: ElkGrove DC
const: 'Site:ELK'
environment:
type: string
description: 'In what environment should this Server be deployed to? '
default: 'Environment:Development'
title: Prod / Test / Lab
oneOf:
- title: Development
const: 'Environment:Development'
- title: Production
const: 'Environment:Production'

=================

In your "machine" section of your blueprint add a constraint like this

 Machine:
#Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
constraints:
- tag: '${input.dataCenter}'

==================== 

By doing this you are relieving the user of the responsibility for placement and it stays in your control. IMHO, this is one of the objectives of automation.

 

View solution in original post

6 Replies
jimmyvandermast
Hot Shot
Hot Shot
Jump to solution

Just a quick though.
Apply capability tags to your clusters/datacenters (cloud zones, whatever you use) and then make a selection in the blueprint based on contrains(tags)?

rohankumbhare
Contributor
Contributor
Jump to solution

Which property shall I use for cluster and datacenter ? Like below example:

name (property): '${input.ServerName}'
image (property): '${input.OSSelection}'
customizationSpec (property): '${input.domain}'

(property) for zone and datacenter ?

0 Kudos
shyamgopal
Contributor
Contributor
Jump to solution

As @jimmyvandermast suggested, the vRA 8.x way of achieving what you are trying to do is through the use of Tags.

You are attempting to make a VM placement decision by asking the user to pick the DC and Cluster. This is not the vRA 8 way of achieving this.

here is what you should do:

1. If you have multiple vCenters Tag those seperately (e.g"Site:DFW" )

2. Add a tag to your Cloud Zone (e.g) "Environment:SQA"

3. In you Blueprint add an input like this 

=================

dataCenter:
type: string
description: Datacenter where this server will be deployed
default: 'Site:DFW'
title: Datacenter Name
oneOf:
- title: Dallas DC
const: 'Site:DFW'
- title: ElkGrove DC
const: 'Site:ELK'
environment:
type: string
description: 'In what environment should this Server be deployed to? '
default: 'Environment:Development'
title: Prod / Test / Lab
oneOf:
- title: Development
const: 'Environment:Development'
- title: Production
const: 'Environment:Production'

=================

In your "machine" section of your blueprint add a constraint like this

 Machine:
#Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
constraints:
- tag: '${input.dataCenter}'

==================== 

By doing this you are relieving the user of the responsibility for placement and it stays in your control. IMHO, this is one of the objectives of automation.

 

jimmyvandermast
Hot Shot
Hot Shot
Jump to solution

Yes, the way @shyamgopal describes it what I ment. Use capability tags on your infrastructure and use contrain tags in your blueprint to select them.

One small possible disadvantage is that you need to manually modify your blueprints if your infrastructure changes.
A possible enhancement might be to use a Custom Form with a vRO workflow that dynamically fills your selection lists by reading your DC's and Clusters with the respective tags and presenting them in the request form.

rohankumbhare
Contributor
Contributor
Jump to solution

@jimmyvandermast @shyamgopal - Thanks guys, I am trying out the solution and will let you know if anything comes ahead. Thanks once again 😊

0 Kudos
rohankumbhare
Contributor
Contributor
Jump to solution

@jimmyvandermast @shyamgopal - Thanks guys I am able to achieve this !

You guys are rockstars !

0 Kudos