VMware Cloud Community
FARID2
Contributor
Contributor
Jump to solution

VRA 8.2 Custom Form VM naming

I want to make a custom request form for vRA users so that user can choose their department, Group. And it will generate VM names according to those filed. Also wants to provide the chance to choose VM Size/ Flavour the user for users. 

The naming conventions for virtual machines will be based on the business group shorthand, the use case if it is under Production or Development, an application name and a postfix number. 

The exact schema is as follows:

{OrgName/Department}-{P/D}{AppName}-{##}

  • OrgName/Department – Radio Button
  • P/D – Dropdown list
  • AppName – 5 Characters free text

 

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

Every machine blueprint that is created and published will display a request form for users to request the following blueprint in the catalog. It can include inputs from users before provisioning the VM. The following request form will be customized:

  • Option to select Application Name
  • Option to select Storage Tier
  • Option to Select use case
    • Production (P)
    • Development (D)
  • Option to specify number of NICs and select the following network to be attached to
  • Option to choose flavor mapping available
    • Small – 2 CPU / 4GB Memory
    • Medium – 4 CPU / 8GB Memory
    • Large – 8 CPU / 16GB Memory

I've created the custom from but how to integrate this form with my blueprint?

Reply
0 Kudos
1 Solution

Accepted Solutions
MagnusB
VMware Employee
VMware Employee
Jump to solution

Hi

Using extensibility and the ABX action for changing a VM name might be a way forward.

..of course, your customer name have to be put together from all the components, App name and Department etc, , in the Python code first

Youtube version: https://www.youtube.com/watch?v=HyVzWvw7F_g

Blog version: https://www.vrcloud24x7.com/2020/07/custom-naming-for-vm-in-vra-8x-using.html

/Magnus

View solution in original post

Reply
0 Kudos
5 Replies
MagnusB
VMware Employee
VMware Employee
Jump to solution

Hi

Using extensibility and the ABX action for changing a VM name might be a way forward.

..of course, your customer name have to be put together from all the components, App name and Department etc, , in the Python code first

Youtube version: https://www.youtube.com/watch?v=HyVzWvw7F_g

Blog version: https://www.vrcloud24x7.com/2020/07/custom-naming-for-vm-in-vra-8x-using.html

/Magnus

Reply
0 Kudos
thegrumpyengine
Enthusiast
Enthusiast
Jump to solution

Within your blueprint I would add a these fields as custom properties, which will then be held against with the VM meta in customProperties['orgname'] (for example)

In YAML it would look something like..

inputs:
    orgname:
    type: string
    default: ''

resources:

     cloud_machine_1:

     type: Cloud.vSphere.Machine
     properties:
           orgname: '${input.orgname}'
     

Within your service broker form these inputs will be pulled through for the user to fill in.

Then, once the request is submitted use vRO to grab these properties and construct your VM name and pass it back into the event broker. In terms of numbering, you could hold a constants file within vRO with the latest VM ###, which could then be incremented so VMs are sequentially numbered.

Reply
0 Kudos
RT75
Contributor
Contributor
Jump to solution

can I have more than one constants file? Say a constants file by org name so the script can refer to the specific constants file for getting the next VM number for that org? I want to know if it is possible to create VM names like A-001, A-002, B-001,B-002 instead of A-001, B-002, A-003, B-004.

Reply
0 Kudos
thegrumpyengine
Enthusiast
Enthusiast
Jump to solution

Yep you could do this, although probably simpler to have a single constants file with multiple properties.

Let's assume you have a custom property on your VM which identifies the org name, then within your vRO script, query this property and then based on the result, extract the relevant key/value from the constant file, do value+1 and re-write it back to the file whilst also using this value to set the VM name.

 

Reply
0 Kudos
carl1
Expert
Expert
Jump to solution

I must be missing something here.  I don't understand how ABX can do this. I am assuming that you want to generate a VM name prefix using the org but then append it with some kind of a sequence number to guarantee unique VM names.  It is the sequence number that I have a problem with.

With ABX, having files is moot since ABX is not persistent space.  Also, if you are generating unique names, in production you will be running clusters so you had better find some way to do safe locking of a sequence number.

With vRO, it has a Locking mechanism that is vRO cluster safe so that solves problem one.  But, configuration element values are cached so you must reload the config element to get the most current value.

bit, bit

my 2 bits worth,

Carl L.

Reply
0 Kudos