VMware Cloud Community
carl1
Expert
Expert
Jump to solution

Setting vRA VM name from Orchestrator

Does anyone know how I can set the name of the vRA VM from vRO?  I thought that setting the Hostname property in the Building VM workflow would do the job but it appears that the VM name has already been decided.  I want to do this entirely from Orchestrator but am having no luck.

Thanks,
Carl L.

1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

So are you trying to use the VirtualMachine.Admin.Name custom property to set the name during the build step?

I haven't tried yet but fundamentally you could try to use the Update Entity workflow to assign the name to VirtualMachine.Admin.Name.

View solution in original post

0 Kudos
7 Replies
admin
Immortal
Immortal
Jump to solution

Hostname is only determined through vRA but you can use properties and vRO to create more dynamic ones. Take a look at this plugin for custom host naming tasks. http://dailyhypervisor.com/vcloud-automation-center-vcac-5-2-custom-hostnaming-extension/

carl1
Expert
Expert
Jump to solution

I saw that one and, yes, it would solve the problem if I just want a pattern (as opposed to accessing external data to determine the VM name).  The vRA Hostname property is supposed to set the name of the VM but setting it in the building sequence from Orchestrator does not do the job.

This link

https://brianragazzi.wordpress.com/2014/03/17/setting-the-machine-name-of-a-vcac-provisioned-vm-to-c...

shows how to do it via vRA Designer.  I just want to do it via Orchestrator.  If I can do it in designer, it seems I should be able to do it from vRO.  I just don't like Designer and definitely don't want to learn VB.

Thanks,
Carl L.

0 Kudos
admin
Immortal
Immortal
Jump to solution

So are you trying to use the VirtualMachine.Admin.Name custom property to set the name during the build step?

I haven't tried yet but fundamentally you could try to use the Update Entity workflow to assign the name to VirtualMachine.Admin.Name.

0 Kudos
carl1
Expert
Expert
Jump to solution

Ahhh, that was the correct property.  I was setting the Hostname property instead.  VirtualMachine.Admin.Name was the one that needed to be changed instead.

Thanks so much!

Carl L.

0 Kudos
carl1
Expert
Expert
Jump to solution

Just for posterity, if anyone wants to see the code, find it below.  It is only one WF.

Carl L.

0 Kudos
carl1
Expert
Expert
Jump to solution

OK, It was going so well Smiley Happy.  vCAC provisions the VM with the correct name in vCenter.  However, the name is still the VM Prefix name in the vCAC item list.  Also, after the next data collection, vCAC shows the VM as missing.  So, what else do I need to set to make things right?

Thanks,
Carl L.

0 Kudos
ChristianWehner
VMware Employee
VMware Employee
Jump to solution

Hi,

I used the Hostname property during the Building stub to modify it via vRO and this done the job to me. Cause I currently have no working environment, I have only a untested sample but this could do the job for you:

// Set hostname

var propertyName = "Hostname";

var propertyValue = <newHostname>;

System.debug( "Set VM property " + propertyName + " to '" + propertyValue + "'" );

System.getModule("com.vmware.library.vcac").addUpdatePropertyFromVirtualMachineEntity(<vCACHost>,<virtualMachineEntity>,propertyName,propertyValue,false,false,false,true) ;

Cheers,

Chris

0 Kudos