VMware Cloud Community
AnkitCP
Contributor
Contributor

Publish vCO workflow to create DNS host and pointer records for Linux VMs deployed via VCAC

Hello everyone,

I am trying to create a vCO workflow so that end users can create DNS host and pointer records for Linux VMs created via VCAC.For Windows server VMs this happens automatically when they join domain but for Linux VMs it is still a manual process.

Is there any Powershell script that we can use to develop a vCO workflow for this? The expectation will be that when the workflow is initiated it asks for "hostname" and IP address" inputs from user. This workflow can be published in VCAC and tied to approval policy so that the respective admins can review before execution.

Any help/ guidance/ URL will be greatly appreciated.

Thanks,

Ankit Mehrotra

Thanks, Ankit Mehrotra
Reply
0 Kudos
5 Replies
cdecanini_
VMware Employee
VMware Employee

Please have a look at the script I have provided here : Script manager batch script samples (Local administrator and managing DNS records)

This is batch based. The script manager package available separately in the document tab allows you to use existing batch / powershell scripts and package these as workflows.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
AnkitCP
Contributor
Contributor

Thanks for the suggestion. However, I tried executing the "Add record to DNS workflow" for a test LINUX server but got error "batch script type is not valid for OS linuxGuest".

Thanks, Ankit Mehrotra
Reply
0 Kudos
Burke-
VMware Employee
VMware Employee

These Windows based DNS Guest operations workflows are intended to be run in a Windows Guest that has the RSAT (Remote Server Administration Tools) installed, NOT the deployed Windows/Linux guests... It sounds like you are trying to run this in your deployed guest instead of a Windows Utility server that has the tools installed.

For example:

Submit Request via vCAC -> vCO uses guest operations in a Windows Server that has RSAT Tools to create necessary DNS entry -> New Windows OR Linux VM gets deployed, DNS is already prepped

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Reply
0 Kudos
AnkitCP
Contributor
Contributor

Hi ,

I am trying to create a vCO workflow so that end users can create host and pointer records in a Windows DNS server (AD integrated) for Linux VMs created via VCAC.For Windows server VMs this happens automatically when they join domain but for Linux VMs it is still a manual process.

So, the expectation is to have a workflow published in vCAC which when executed by an end user, asks for "Hostname" and IP Address" of the LINUX server VM (provisioned and online by vCAC or by manual cloning in vCenter) and based on approval policy should create Host and Pointer record for that Linux Servers in the Windows DNS server. Basically, the end user interacts with the DNS server to create DNS records without being given direct access to the server.

Is there any Powershell script that we can use to develop a vCO workflow for this?

Thanks,

Ankit Mehrotra

Thanks, Ankit Mehrotra
Reply
0 Kudos
Burke-
VMware Employee
VMware Employee

Yes, I understand the use case and desired result. This is achievable using the information in my last post and the Guest Scripts that Christophe noted.

Here's a rough idea of what you need to do: (I don't have time to provide a full step-by-step tutorial)

  1. Setup your Windows Scripting host - this is the server that will run the DNS command that is in the guest scripts. (This can be a dedicated Windows Server with the RSAT tools installed or one of the DNS Servers with the RSAT tools installed - you'll just need to be sure that it is a VM, has VMware Tools running, and that you have credentials to connect to it AND run the dnscmd)
  2. Create your custom vCO workflow that will prompts the user for the DNS details.. this should take the vCAC Virtual Machine as an input, extract the DNS related properties, and pass those as inputs to the Guest Script
  3. Create/update your vCAC Blueprint to include your desired DNS related inputs - store these as properties on the request
  4. Map the vCO workflow to one of the vCAC workflow stubs that takes place after your approvals have been processed
  5. Test Deployment

End result:

  1. User requests a Linux virtual machine in vCAC, specifying desired hostname and IP Address (ideally, you should be using some sort of IPAM so that users don't try to request same IP...)
  2. vCAC processes approvals as you have specified
  3. Upon approval, vCAC provisions VM, during this process a workflow stub calls out to vCO
  4. vCO extracts the properties containing the hostname and IP Address and passes those on to the Guest Operations Script
  5. The Guest Operations script connects to your Windows Scripting host and issues the relevant dnscmd.exe with appropriate parameters to create your new DNS record
  6. vCO Workflow completes and reports success back to vCAC
If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Reply
0 Kudos