cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Infoblox Integration. (via custom tasks).

7179
Views
12
Helpful
19
Comments
Task NameInfoblox_Host_Registration
DescriptionI’ve just finished creating custom workflow tasks for integration into Infoblox Grid Manager. The attached workflows request the next free IP address from an Infoblox network range. A host is then registered as a DNS host record for that address. Rollback is also integrated. There is also a ‘delete record’ workflow task too.
Prerequisites
  1. Tested on 5.2.0.2
CategoryWorkflow (and tasks)
ComponentsIt has a custom task and sample test workflow..
Update 23/03/2015

I've updated the 'Infoblox_Get_Next_Available_IP' workflow task so that it also retrieves the network comment field from the Infoblox Grid Manager and have named it 'Infoblox_Get_Next_Available_IP_v2'. New workflow task attached.

Update

27/11/2015

Please find attached a modified set of workflow tasks (InfoBlox_Workflows_UCSD_5_4_0_0_plus.wfdx) for use with UCS Director 5.4.0.0 and beyond. These are not compatible with UCS Director releases prior to 5.4.0.0.

Instructions for Regular Workflow Use:

  1. Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
  2. Unzip the file on your computer. Should end up with a .WFD file.
  3. Log in to UCS Director as a user that has "system-admin" privileges.
  4. Navigate to "Policies-->Orchestration" and click on "Import".
  5. Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
  6. Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
  7. Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
  8. Click "Submit".
  9. A new folder should appear in "Policies-->Orchestration" that contains the imported workflow.

This could be combined with Orf’s 'VM with IP Input' tasks to provide VM creation with IP supplied by Infoblox.

Pictures speak louder than words, so here you go:

Infoblox IPAM configured networks:

Screen Shot 2015-03-22 at 08.42.44.png

Next free address for network 192.168.55.0/24:

Screen Shot 2015-03-22 at 08.43.28.png

Workflow ‘Infoblox Register New Host’:

Screen Shot 2015-03-22 at 08.44.06.png

…in action:

Screen Shot 2015-03-22 at 08.44.37.png

Screen Shot 2015-03-22 at 08.44.49.png

Screen Shot 2015-03-22 at 08.44.55.png

…Rollback:

Screen Shot 2015-03-22 at 08.46.03.png

Screen Shot 2015-03-22 at 08.46.09.png

Screen Shot 2015-03-22 at 08.46.16.png

Addendum to this awesome work by Russ...

In case the comment field in Infoblox contains the VLAN number, the number can be pulled out as well (version 2).  This in turn could be used to assertion the vSwitch in UCSD for the VM (VM Deployment with USER IP INPUT)

Screen Shot 2015-03-22 at 1.29.06 PM.png

Screen Shot 2015-03-23 at 6.56.00 PM.png

NOTES for 5.4 Plus tasks from Russ.....

Important the comment field has to be filled out!!!!

Screen Shot 2015-12-28 at 10.23.23 AM.png

Screen Shot 2015-12-28 at 10.23.18 AM.png

Password masking Notes:

The log file before a little fix up:

Screen Shot 2015-12-28 at 10.37.19 AM.png

The log after the fix up:

Screen Shot 2015-12-28 at 10.33.35 AM.png

Here are the steps to mask the password in the log:

The custom task both columns have to have the password classification enabled:

Screen Shot 2015-12-28 at 10.35.07 AM.png

Here is the place to enable that:

Screen Shot 2015-12-28 at 10.35.16 AM.png

In the workflow properties section the password type has to be set:

Screen Shot 2015-12-28 at 10.34.12 AM.png

Comments
Contributor

it's very explicited!

Beginner

Thank you for your submission. This workflow works sometimes but not all as I am receiving an error. Here is the error from the log; "

Sep 28, 2016 16:39:02 PDT Error occured at line # 278

Sep 28, 2016 16:39:02 PDT [Line#278] var netComment = jsonResponse.get(0).get('comment').getAsString();

Sep 28, 2016 16:39:02 PDT Task: Infoblox Register New Host 5_4_0_0_plus (custom_Infoblox_Get_Next_Available_IP_v3_5.4.0.0) failed with error - TypeError: null has no such function 'getAsString' in <eval> at line number 278, selectedContext=<None>

Sep 28, 2016 16:39:02 PDT Task #2 (Infoblox Register New Host 5_4_0_0_plus (custom_Infoblox_Get_Next_Available_IP_v3_5.4.0.0)) failed after 2 seconds"

I also noticed that the password is masked only in the last part of the workflow but not when it first starts up.

Cisco Employee

What is your UCSD version?

Cisco Employee

You ran the register workflow first right? On second look it looks like it is failing on your comment field. Is your comment field empty and the code does not handle it right? Screen Shot 2016-09-29 at 6.54.57 AM.png

Cisco Employee

The password mask should be enabled in the custom task and the Variable needs to be set to password vs. text.

Beginner

These should be good with 6.0 correct? 

Cisco Employee

Yes - I just ran this in Dec with 6.0.

Beginner

I'm using UCSD 6.0 with the Infoblox-module, only the rollback functionality of the register-host task isn't working:

I get the message:

Rollback ***workflowname (SR xx)*** (custom_Infoblox_Delete_Record_v3_5.4.0.0) failed with error - Index: 0, Size: 0 in <eval> at line number 259, selectedContext=<None>

Cisco Employee

I dont have the code in front of me, but what is happening in the custom task around line 259?

Cisco Employee

Were any variables re-named?

Beginner

May 03, 2017 13:30:09 UTC Executing custom script for Infoblox_Delete_Record_v3_5.4.0.0

May 03, 2017 13:30:09 UTC Error occured at line # 259

May 03, 2017 13:30:09 UTC [Line#259] var refStr = resp.get(0).get('_ref').getAsString();

Cisco Employee

One line – hmm – looks like it cant pull in variable resp as a string because it is probably empty…

Did any of the variable names change for the custom task?

Orf Gelbrich

Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)

Beginner

no changes of the code whatsoever.

(a consolidated portion of) the script is:

function infobloxDeleteRecord(ibIP,ibUser,ibPassword,fqdn) {

    this.ibIP = ibIP;

    this.ibUser = ibUser;

    this.ibPassword = ibPassword;

    this.fqdn = fqdn;

    var request = new httpRequest();

    request.setup(this.ibIP,"https",this.ibUser,this.ibPassword);

    request.getRequest('/wapi/v1.2/record:host?name~='+fqdn);

    request.contentType("json");

    var statusCode = request.execute();

    var getResponse = new InputStreamReader(request.getResponse("asStream"));

    var resp = JSON.getJsonElement(getResponse, null);

    var refStr = resp.get(0).get("_ref").getAsString();

// more

}

Cisco Employee

Did the API on the Infoblox change?

request.getRequest('/wapi/v1.2/record:host?name~='+fqdn);

the path?

Orf Gelbrich

Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)

Beginner
CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards
This widget could not be displayed.