Add your custom hostname input as a custom property to the VM, on the cloud template:
inputs:
hostname:
type: string
resources:
vm:
type: Cloud.vSphere.Machine
properties:
hostname: ${input.hostname}
Create a vRO workflow with:
inputs:
inputProperties (Properties)
outputs:
resourceNames (Array/string)
Assign the hostname in the workflow to the output variable:
resourceNames = [inputProperties.customProperties.hostname];
Create an EBS at event topic "Compute allocation" (compute.allocation.pre), assign the workflow to it, and make it blocking.