dnscmd using HPOO or HPSA (285 Views)
Reply
Occasional Contributor
GaryDAtOrion
Posts: 8
Registered: ‎03-11-2014
Message 1 of 2 (285 Views)

dnscmd using HPOO or HPSA

[ Edited ]

As part of a server build I need to add the DNS entry to DNS located on a Windows box.  What is the best way to do that using HPSA/HPOO/Matrix?  One way is using dnscmd, but if that is the best way then how do I accomplish that?  Is there a flow or method already to add new servers to DNS?

 

Not a final answer, but I did find this command to list DNS from HPSA works, replace <> with the appropriate text:

rosh -n <OGFS name of DNS server in HPSA here> -l Administrator dnscmd /enumrecords <dns domain here> <some server in DNS>  /type A /detail

 

A bit less confusing looking, fake details:

rosh -n dnsserver1.hp.com -l Administrator dnscmd /enumrecords hp.com somehostname  /type A /detail

 

Given the tool set I have to work with, after more investigation into the problem, the above was just the beginning.

 

There are three possible ways to do what I need with the environment I have.  They are: 1. An HPSA script in OGFS like above, 2. An HPOO flow, and 3. Since the IP is set in an APX have that same APX also add the A record to DNS.

 

The third method above is likely the best way because it has the IP and hostname, and will sequence correctly.  Before this point the IP is a temporary IP from the PXE boot.

 

The second method is ok but the flow has to retrieve the IP and hostname.  Not impossible, and using a flow that is already there as an example, it can be done this way.  This method has a few things that make it less desirable, one being the increased code and steps compared to the APX, the other is having to add process steps to the build.

 

The first method, the one I tried first, would be ok except I don't know how to insert it into Matrix.  It has to be placed after the APX does the IP reassignment.  Likely merely a lack of understanding how to insert it rather than a limitation of the MATRIX software, but I couldn't see an easy way to put it after the APX.  I am not yet familiar enough with the places and methods to insert code.

 

This leads me to wish there was a nice, end to end, graphical or at least text flow that lets me easily see, and preferably with something describing each place, the process from start to finish, including some way to easily open an editor to each part in the build.  Right now I need enough experience to know which of several interfaces to open to change the piece I need.  It could be in one of the MATRIX interfaces, HPOO, HPSA GUI, or HPSA APX.  Even just listing the whole thing in one place would be great.

 

In some near time I hope to settle on how I'm going to get the A record into a Windows based DNS.  I may need to include a consideration to be able to deselect adding a DNS entry because we might need that option.

Occasional Contributor
GaryDAtOrion
Posts: 8
Registered: ‎03-11-2014
Message 2 of 2 (176 Views)

Re: dnscmd using HPOO or HPSA

[ Edited ]

It took me a while to get the solution, a short and sweet, "magic incantation":

 

How to create a DNS “A” record with a Windows DNS server for MATRIX using HPOO:

 

Only need five steps including success and failure:

 

  1. "hostname and IP from XML", a “Do Nothing” step to set up the variables
    1. Inputs
      1. Assign from Variable:  RequestXML      Assign to Variable: xml
    2. Results
      1. Get the IP address
        1. Name: DNSgotIPAddress  
        2. From: Input:xml  
        3. Assign To: Flow Variable 
        4. Assignment Action: OVERWRITE 
        5. Filters
          1. /*[name()='Request']/*[name()='InfrastructureService']/*[name()='LogicalSubnets']/*[name()='LogicalIPAddresses']/*[name()='Address']/text()
      2. Get the hostname
        1. Name: DNSgothostname
        2. From:  Input:xml  
        3. Assign To: Flow Variable 
        4. Assignment Action: OVERWRITE 
        5. Filters
          1. /*[name()='Request']/*[name()='InfrastructureService']/*[name()='LogicalServerGroups']/*[name()='LogicalServers']/*[name()='Hostname']/text()
  2. "Create DNS Record", a Remote Command
    1. Inputs
      1. host: Use Constant, your Windows DNS server hostname
      2. username: Use a system Account that has Administrator privileges on your Windows DNS server
      3. password: Matches the username in 2 above
      4. protocol: WMI
      5. command: 
        1. Use Constant, Constant value: dnscmd . /RecordAdd YOURDOMAIN.HERE  ${DNSgothostname} /CreatePTR A  ${DNSgotIPAddress}
  3. "Send OO Alert from HPIO"
    1. Locate one of these steps in your HPOO set up for HPIO.  It has a sub flow you need.

 

Wiring it up, just four transitions (connections from step to step):

  1. Take the success from the “hostname and IP from XML", do nothing step and send it to the regular “Create DNS Record” step.
  2. Wire the output of “Create DNS Record” and send the success to “Resolved: success”
  3. Wire the fail from “Create DNS Record” to the “Send OO Alert to HPIO"
  4. Wire the fail from “Send OO Alert to HPIO” to the regular “Error: failure
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.