VMware Cloud Community
vmsiul
Enthusiast
Enthusiast
Jump to solution

vRA 8.6 | How to Allow Requesters to Specify Machine Host Name

Hello,

Using vRA 8.6 and we are trying to allow the user requesting the VM to specifiy the machine host name. The request might be a linux or a windows VM. We need to the VM hostname to match the name they have provided while creating the request. 

Looks like in vRA 7 there a was a way to get this done:

https://docs.vmware.com/en/vRealize-Automation/7.6/com.vmware.vra.prepare.use.doc/GUID-4099B102-AAA7...

I am wondering if there is anything that we can do in vRA8 to get this done?

Thank you!

Labels (1)
Tags (1)
Reply
0 Kudos
4 Solutions

Accepted Solutions
vmsiul
Enthusiast
Enthusiast
Jump to solution

@xian_ Thanks for the info. I've been using an action script for it, however I am a bit stuck because when I am creating the subscription with an action/workflow just have the option to use vRO Workflow. I have seen other blogs where an ABX Action was given (see below)

vmsiul_2-1646404247273.png

 

When I do it on my env:

vmsiul_1-1646404218285.png

I only see this option:

vmsiul_0-1646404093026.png

 

Also can I use the same process (out of the box rename hostname script) with Windows and Linux?

Thank you 

 

 

View solution in original post

Reply
0 Kudos
BrettK1
Enthusiast
Enthusiast
Jump to solution

As a different approach, since our projects are ONLY creating individual VMs right now, we just set the Projects Custom Naming Template to ${resource.name}
Take Hostname as string input and in the VMs resources, set the property  name: '${input.Hostname}'
Use your vSphere Customization Specs (or I assume Cloudinit if you aren't using those) to set hostname (Computer name: Use the virtual machine name).
No vRO or ABX intervention necessary.

View solution in original post

BrettK1
Enthusiast
Enthusiast
Jump to solution

Went on vacation and have been quite busy, but have a few minutes to get more specific now, not that it really IS much more specific:

Blueprint yaml:

inputs:
 Hostname:
  type: string
  title: Hostname
  minLength: 1
  maxLength: 15
  pattern: ^[A-Z0-9,-]{3,15}$

resources:
 VM:
  properties:
   name: ${input.Hostname}

 

Project - Provisioning - Custom Naming

Template: ${resource.name}

And in vCenter, VM Customization Specications, we Sysprep with the following (among other things):

Computer name: Use Virtual Machine name

 

'Pattern' is to force 3-15 character, all uppercase, number or - names.

So long as there aren't any OTHER things getting in the way, that's it.
There's no logic to check for unique names (Deploy will just fail if you put it in the same folder as another VM with the same name).
If other naming logic needs to happen in the future, a vRO object can be inserted to manipulate the user input as necessary, but that can happen when it needs to, not right away.

View solution in original post

Reply
0 Kudos
5 Replies
vmsiul
Enthusiast
Enthusiast
Jump to solution

@xian_ Thanks for the info. I've been using an action script for it, however I am a bit stuck because when I am creating the subscription with an action/workflow just have the option to use vRO Workflow. I have seen other blogs where an ABX Action was given (see below)

vmsiul_2-1646404247273.png

 

When I do it on my env:

vmsiul_1-1646404218285.png

I only see this option:

vmsiul_0-1646404093026.png

 

Also can I use the same process (out of the box rename hostname script) with Windows and Linux?

Thank you 

 

 

Reply
0 Kudos
BrettK1
Enthusiast
Enthusiast
Jump to solution

As a different approach, since our projects are ONLY creating individual VMs right now, we just set the Projects Custom Naming Template to ${resource.name}
Take Hostname as string input and in the VMs resources, set the property  name: '${input.Hostname}'
Use your vSphere Customization Specs (or I assume Cloudinit if you aren't using those) to set hostname (Computer name: Use the virtual machine name).
No vRO or ABX intervention necessary.

vmsiul
Enthusiast
Enthusiast
Jump to solution

 BrettK1, 

 

That's sounds very good. Would be able to share more details on how to implement your approach. I've tested a few things but they aren't working. 

Thanks!

Reply
0 Kudos
BrettK1
Enthusiast
Enthusiast
Jump to solution

Went on vacation and have been quite busy, but have a few minutes to get more specific now, not that it really IS much more specific:

Blueprint yaml:

inputs:
 Hostname:
  type: string
  title: Hostname
  minLength: 1
  maxLength: 15
  pattern: ^[A-Z0-9,-]{3,15}$

resources:
 VM:
  properties:
   name: ${input.Hostname}

 

Project - Provisioning - Custom Naming

Template: ${resource.name}

And in vCenter, VM Customization Specications, we Sysprep with the following (among other things):

Computer name: Use Virtual Machine name

 

'Pattern' is to force 3-15 character, all uppercase, number or - names.

So long as there aren't any OTHER things getting in the way, that's it.
There's no logic to check for unique names (Deploy will just fail if you put it in the same folder as another VM with the same name).
If other naming logic needs to happen in the future, a vRO object can be inserted to manipulate the user input as necessary, but that can happen when it needs to, not right away.

Reply
0 Kudos