Resolving an Infoblox IP Address with vRealize Orchestrator's HTTP-REST Plug-in
Reprinted with permission by original author and Infoblox community member Chris Greene
We use Infoblox for DNS management in our private cloud environment, and as part of the provisioning process we add a new DNS entry for the VM, but before we add a new DNS entry we want to make sure one doesn’t already exist. In our dev/test environment I was using the vRealize Orchestrator (vRO) SSH plug-in to run the nslookup command on the vRO server, parse the result and determine if a DNS entry existed. In our production environment I wasn’t able to do this so I decided to look into using the vRO HTTP-REST plug-in. We are using an older version of the Infoblox plug-in so it’s possible that newer versions have this functionality built-in.
Even if you’re not using Infoblox in your environment, this example will show you how easy it is to use the vRO HTTP-REST plug-in. Using vRO context menu actions in vCenter, you could also run a workflow that extracts IPs off of VMs in vCenter and registers them with Infoblox.
The below actually looks like a lot more work than it is. Since I already knew how to get results from Infoblox using curl, it took about 10 minutes to do the same in vRO.
Performing an Infoblox REST API call with curl
In the past I found out how to use the curl command to make REST API calls to perform options on Infoblox. Looking up an IP address is straightforward:
curl -k -u user
ass -X GET https://192.168.1.10/wapi/v1.0/record:host?ipv4addr=192.168.1.20
Let’s break this down:
- -k is insecure mode. This ignores self-signed certificates.
- -u user
ass are the credentials.
- -X is the type of HTTP request.
- https://192.168.1.10 is the Infoblox host.
- record:host specifies that we are looking up a host record.
- The IP at the end is the IP was are looking up.
This command results in:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[ { "_ref" : "record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5zZWFnYXRlLm9rbGEuY2xkLmNsb3VkbGcwMTYwNTA:superserver.vmware.local/Internal%20seagate" , "ipv4addrs" : [ { "_ref" : "record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQuX2RlZmF1bHQuY29tLnNlYWdhdGUub2tsYS5jbGQuY2xvdWRsZzAxNjA1MC4xMC40OC4xNi41MC4:192.168.1.20/superserver.vmware.local/Internal%20seagate" , "configure_for_dhcp" : true, "host" : "superserver.vmware.local" , "ipv4addr" : "192.168.1.20" } ], "name" : "superserver.vmware.local" , <DIV class="line number14 index13 alt1" style="margin: 0px !important; padding: 0px 1em !important; border: 0px !important; outline: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto |
Categories
- All Categories
- 5.1K Forums
- 4.6K Critical Network Services
- 463 Security
- Visibility and Insights
- Ideas Portal
- Webinars & Events
- 266 Resources
- 266 News & Announcements
- Knowledge Base Articles
- Infoblox Documentation Portal
- Infoblox Blog
- Support Portal
- 4 Members Hub
- 4 Getting Started with Community
- Community Support