ACI Power Deployment Tool – Update!

It’s been a long time! But, I’m back with some good news — at least if you care about ACI and the power deployment tool I’ve previously written about.

The tool itself was rather crude, and really my first attempt at anything substantive with python. I think functionally its been fantastic, but was certainly lacking in finesse! Well, over the past however long since I released it into the world, I’ve got a major, major update to write about!

I’ve been basically making minor enhancement to the tool since the last update in terms of functionality, however there have also been some pretty drastic improvements to the code structure. For a time we were using this stuff internally at work and I couldn’t really share all of that, though I did try to keep at least the baseline functionality updates rolling to Github (poorly, more on that later).

Now, however, we are done with our internal stuff and I’m releasing the far, far, superior version of pdt into the wild. The primary improvement here is that instead of a gargantuan mess of multi-line strings in the main library, I’ve moved to real live json files (whoa crazy idea huh!) and jinja2 templating. This cleaned up the main code base quite a bit. I’ve also been doing my best to slowly add in error handling throughout — starting with simple stuff like validating integers are integers, and the status input is actually a valid status! I’ve also added some basic error handling to improve any re-transmission errors — particularly on the ACI simulators (which yes, I know, are not publically available unfortunately) the sims will fail — I guess running out of memory or cpu, or just some internal throttling thing… in any case, the tool now will simply pause and re-attempt if this occurs.

I’ve picked apart a fair amount of the methods and cleaned things up and made them much more granular as well — particularly for Bridge Domains… before the code was a bit of a mess… one big BD method, but now its been broken down into three smaller bits which gives us much more flexibility and granularity of config.

One important piece which I eluded to a bit earlier… I’m now attempting to get my life together and actually learn how to use Github properly! It’s a bit embarrassing that I really had never done anything but delete repos and add it back with updated files. Not exactly stellar use of the tool! But hey, never too late to learn, so I’m doing my best to use Github in a more correct way (still a long way to go!!). So for now, I’ll probably always have a master and a dev branch. I’ll be using the dev branch pretty recklessly, updating whenever I damn well please! Whenever I feel like I get things to a reasonable place — stability wise, functionally, or whatever else — i’ll merge the dev branch into the master. Then ill start the whole thing over again! I’d also love to have contributors on the project if possible. I know it’s a pretty niche thing, but that would be good fun, and would be great to learn from some other folks about how to do all this stuff correctly! So, if you’re bored, feel free to make some pull requests and we’ll get to crackin’! For now, happy ACI’ing, hope some folks get good use out of the tool!


You can find the tool here:


13 thoughts on “ACI Power Deployment Tool – Update!

  1. Hi Carl.

    Is it possible to run your tool in read-only mode, just to grab configuration data from Cisco ACI? It would be a good tool to pull data for audit or configuration assurance.


    • At the moment… no. BUT I’ve been working on “v2” on the side which does indeed do this. I don’t have a good timeframe for when it will be out though since its a pet project and its basically a total overhaul. It’ll be on my Github though as soon as I figure it all out 🙂

  2. hey Carl, thx for the blog and real good work!!
    Im struggling to get ACIPDT to work 🙂
    Followed the Github and all seem good with the installation, only missing how can we start the scripts 🙂
    File “”, line 41
    templateVars = {**required_args, **optional_args}
    SyntaxError: invalid syntax

    Can you give me some hints 🙂 (sorry for the ignorance)

  3. ok got it running was python3 command missing…
    one question..if we need only partial configuration, how are the blank fields treated?
    thanks in advance.

  4. It seem that all the fields are required:

    Enter APIC username: admin
    Enter APIC password:
    Workbook Loaded.
    Snapshot taken successfully, continuing.
    Starting work on Fabric Pod Policies section
    Deploying line 6 from section Fabric Pod Policies…
    Traceback (most recent call last):
    File “”, line 456, in
    File “”, line 441, in main
    pod_policies(apic, cookies, wb, wr_wb)
    File “”, line 161, in pod_policies
    status = eval(“podpol.%s(**var_dict[pos])” % func)
    File “”, line 1, in
    File “/Users/nuno.marques/Desktop/acipdt-master/acipdt/”, line 148, in comission_hw
    templateVars = process_kwargs(required_args, optional_args, **kwargs)
    File “/Users/nuno.marques/Desktop/acipdt-master/acipdt/”, line 30, in process_kwargs
    raise InsufficientArgs(‘Insufficient required arguments.’)
    acipdt.InsufficientArgs: Insufficient required arguments.

    • If the value is there in the A column it will require the values for the keywords (unless they are optional values, you can find that out by looking at the comments before the method in the file). It’s also super annoyingly sensitive to white space, so you can’t have blank lines within a section (keyword) or it will break. I promise v2 will be better if u ever get around to it 🙂

  5. One more question, so if i only want to make a subset of actions, can i remove the value in A column and assume it will only apply the specific subset of scripts?

    • Correct. It basically “screen scrapes” excel. So it starts at like row 6 or so and just goes down A column until it hits something… then it will go up one row, and over, and those values are the keywords required for the particular method. Finally it loads up the values below the keywords. All this is why it’s sensitive to space so much.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s