This guide will show you how to setup vRealize Automation 7.x to automatically create a static host A record and a reverse look up pointer in your Windows based DNS. This is most often needed to be able to automate deployments of Linux machines as Linux does not play well with Windows Based DNS when you are using static IP address assignment. However, you can also use this with Windows machines if you don’t allow self registration of Windows on your network.
- vRA 7 installed and configured with at least one blueprint that has static IP address network profile assigned
- vRA Plugin for vRO configured see my guide here
- vCenter Plugin for vRO configured
- At least one Windows Server with DNS Server tools installed (DNSCMD.exe) Pro TIP: This could be one of your vRA IaaS or DEM servers as long as they are visible from the vCenter Plugin.
- vRO workflow package downloaded from here
- a quiet place where you will not be interrupted see my guide here
First, make sure you can use the dnscmd from the Windows server and have the account rights to create A records.
Now open the vRealize Orchestrator (vRO) client
- Click drop down to Administer
- Click the Package Tab
- Click Import Package
Verify the workflow was properly installed
- Click the drop down to change to run
- Click the Workflows tab
- Drill down to the workflow
Update the workflow with the Windows Server and the username and login
- Select the workflow
- Click edit
Update the attributes
- Select the Windows server that has DNSCMD installed
- Enter a user with rights to login to that server and rights to administer the DNS server
- Enter the password for that user
- Click Save and Close
Enter the following custom properties
- Click Properties
- Click Custom Properties
- Enter the new properties as shown
- Click Finish
Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned * dnsserver mydns.corp.local
Create and publish a new event subscription
- Click Administration Tab
- Click Events, Subscriptions
- Click +New
On the next screen click Run Based on conditions the choose All of the following
Want to remove the record on Deporivisoning? See Part II – Delete DNS Record
Pingback: How to integrate Windows DNS with vRA 7.x Part II – Delete DNS Record – VMtoCloud.com
Pingback: Automated DNS registration with vRA | viktorious.nl – Virtualization & Cloud Management
Thank You So much for this. I am able to get DNS entry added using the workflow package you provided. I would like to through a question back to you, my customer has a requirement to add Linux server to be part of 2 different domain, but same DNS server. Can you please help me ?
Hi Nithin, So, do they just need a computer account created in both domain’s or for the machine to join the domain? For computer account creation see this guide https://www.vmtocloud.com/how-to-configure-active-directory-ou-placement-policies-in-vra-7-2/
Is there a way to add a secondary, and tertiary, DNSCMD provider?
I’m getting an “IO Exception. Not a valid package file, dunes-meta-inf is missing!” error while trying to import the package. Is there a newer version of this package for vRO 7.3?
Disregard, I made a rookie mistake and didn’t unzip the file before importing into vRO.
When I select the Window VM attribute, I could not see any VM listed. I saw this error . Why is that ?
I already added the vCenter server instance . How come I cannot see any VMs displayed ?
https://10.139.53.68:443/sdk (unusable: java.lang.ClassCastException: com.vmware.vcac.authentication.http.spring.oauth2.OAuthToken cannot be cast to com.vmware.vim.sso.client.SamlToken)
Hi Ryan ,
I’ve implemented you solution, but the EB-MachineProvisioned-DNSADD workflow terminate with the following Error:
2017-11-29 12:49:37.446] [E] Error in (Workflow:Create temporary directory in guest / Scriptable task (item1)#8) Permission to perform this operation was denied.
[2017-11-29 12:49:37.464] [E] Workflow execution stack:
item: ‘Run Script In Guest/item33’, state: ‘failed’, business state: ‘null’, exception: ‘Exception binding empty’
Can you please give me an Idea or a suggestion?
Thank you very much for your help
I am having an issue where the “dnsdomain” is not selecting the full name ex. .om instead of .com. Any ideas?
Figured it out.
How can I add to a custom suffix? For example if my domain is “lab.local” and want the script to add the VMs in “cloud.lab.local”.
The subdomain already exists.
Thanks in advance.
I’m trying to run the script and it’s showing this error:
“””bat’ is not recognized as an internal or external command,
operable program or batch file.”””
I’m still trying to pass a different “dnsdomain” string. By default without any modifications it runs on the default domain where the DNS is running. But I have a group of blueprints that should be in another DNS domain. I’ve added the Custom Property “dnsdomain” but it just ignores it.
I’ve found it!
var dnsdomain = vCACVmProperties.get(“VirtualMachine.Network0.DnsSuffix”) ;
I now have another issue. It’s working fine unless the blueprint consists of more than 1 VM. If i launch a blueprint with, for example, 5 VMs, sometimes 2 o 3 don’t get registered. If I manually re-launch the job from the orchestrator it works fine.
There is a timing issue, somewhere. The workflow fails in “isToolsOk?”, but tools seems to be ok:
[2018-07-07 10:26:54.144] [I] Getting the custom properties needed
[2018-07-07 10:26:54.171] [I] toolsOK
[2018-07-07 10:26:54.173] [I] VMware tools on VM WADSRV05 are in state: toolsOk and guest is running
[2018-07-07 10:26:54.319] [E] Error in (Workflow:Create temporary directory in guest / Scriptable task (item1)#8) The operation is not allowed in the current state.
I’m having the same issue, could you please update if you handle to figure it out ?
Nope. Did you? Upgraded to VRA 7.5, and the issue is still there.
I’ve got this same problem. Seems like the requests from the workflow are getting jammed up on the vm to execute the script. I have several blueprints that build up to 10 vms at a time. Only maybe 3 or 4 dns adds are successful if all 10 are submitted. I would like to see some ‘wait’ function added here so the workflow will pause until “Command completed successfully.” is returned from the server executing the script. The same would need to be done for the DNSREMOVE workflow.
Hey, did anyone manage to solve this? :S
Has anyone figured out how submit a request for blueprint with more than one server and not have the server that’s executing the dnscmd commands return with error:
“Error in (Workflow:Create temporary directory in guest / Scriptable task (item1)#8) The operation is not allowed in the current state.”
Is there some way to stack the vRA requests to vRO and execute one through completion before trying to send another one? It’s as if the target vm dnscmd is being run isn’t ready regardless if the vmtools says it is.
Thanks a lot for the article. it helped a lot. Could you please help for the deletion at the the time of Vm decomission.
And how can we add it day 2 operation.
I need to add an exception in this. It should check if A recor already exist on that IP, if yes it should trigger on mail else should create the record.