VMware Cloud Community
GBrown1983
Enthusiast
Enthusiast

Custom Hostname - Multiple Instances

I have created a workflow that changes the machine name to a custom name.

The workflow creates a machine name by using custom properties from vRA and then verify that the name is not used in vSphere (using getAllVMsMatchingRegexp action) The result is a new, unused Custom name.

It works perfectly for a single VM.

When I deploy multiply VMs the workflow run in parallel and the output for all instances is the same hostname… (the VM have not been created yet)

Any idea how to solve this?

What are my options?

I am using subscription and extensibility, so the output is –

virtualMachineAddOrUpdateProperties.put(‘Name’, machineName);


Thanks!

5 Replies
Sasidhar1234
Enthusiast
Enthusiast

Hi Gilad,

Please let me know if you got a solution for this requirement, Share me the details if you are able to meet.

Regards,

Sasidhar

0 Kudos
daphnissov
Immortal
Immortal

The best thing I can possibly recommend is the SovLabs solution which is both simple to configure and extremely robust.

SovLabs Docs - Custom Naming

0 Kudos
Sasidhar1234
Enthusiast
Enthusiast

Thanks for your quick reply, it is certainly helpful to use SovLabs extension,

But, my requirement is little different, the DNS records are created in IPAM and I need a way to request the same hostnames in multi-machine blueprint or while using component profiles with multiple instances.

Please guide me to meet my requirement.

0 Kudos
daphnissov
Immortal
Immortal

That's not a problem. When using SovLabs stuff, there's DNS and IPAM integration and they work together. So when custom hostnaming generates a new name, that name can get registered with DNS/IPAM. Regardless of how many machines in a given multi-machine blueprint, the process works the same way and it gets invoked for every machine.

0 Kudos
npadmani
Virtuoso
Virtuoso

When I deploy multiply VMs the workflow run in parallel and the output for all instances is the same hostname… (the VM have not been created yet)

Well, if it's only about generating unique Custom Hostname, the possible solution is to maintain list of Hostnames which are already generated at a common place (some DB), and introduce a locking mechanism in such a way that when you are running workflow to generate hostname, it always uses this DB as reference to generate next name and enters name in that list before proceeding to unlock.

that way, if the parallel execution happens, the workflow instance which is locking the list executes first while others are waiting.

I am sure sovlabs plugin uses something similar to give us this functionality, just that in that case you won't have to write the solution and test it. Smiley Happy

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified