Exploring PowerNSX in Lab

By | 29/06/2017

These days I am busy exploring NSX Rest API in my lab and during the process I came to know about a cool tool named PowerNSX and decided to dedicate a blog on this to give respect to creator of this tool.

What is PowerNSX

PowerNSX is a PowerShell module that abstracts the NSX API to a set of easily used PowerShell functions. PowerNSX enables NSX administrators to drive their infrastructure programmatically.

PowerNSX add additional functionality to extend the capabilities of NSX along with exposing the existing Update, Remove and Get operations for all key NSX functions beyond the native UI or API.

PowerNSX have been developed by Nick Bradford. PowerNSX is available for download on GitHub and can be downloaded as the branch or zipfile.

Note: VMware does not support this module, and PowerNSX comes with no warranties express or implied. It is advisable to test this in Lab before using in a production environment.

Installation Prerequisites:

To install PowerNSX on your system, make sure following software’s are already installed 

  • Dotnet framework 4.5
  • Powershell v3
  • PowerCli v6

PowerNSX provides an installer script that you can use to use to install all of those at once. This script will go and download Power-shell and other correct versions including pointing you to the right PowerCli installer required for installation of PowerNSX.

Steps for manual installation can be read from this wiki page.

Automated installation using the script looks like below

Now you can launch another instance of power-shell and import the PowerNSX module by running command: Import-Module PowerNSX.

View available NSX PowerShell commands

All commands that can be used with PowerNSX can be listed by typing command: get-command -module PowerNSX

It will return a long list of available commands and the list is damn large.

Testing connection to PowerNSX

You can test the connection to PowerNSX to see if it is working fine or not by firing simple get commands as shown below:

Now you can play around various options to automate things in your lab/prod environment. I think its a great tool and I am looking forward to use it more on day to day basis.

Additional reading

Anthony Burke’s blog

blogs.vmware.com

Tracking Change in PowerNSX

VMworld 2016 Session NET7514: Using PowerShell and Python for Automation and Management of VMware NSX for vSphere

I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing. Be sociable :)

Category: NSX

About Alex Hunt

Hi All I am Manish Jha. I am currently working in OVH US as Operations Support Engineer (vCloud Air Operations). I have around 7 Years of IT experience and have exposure on VMware vSphere, vCloud Director,vSphere Replication, vRealize Automation, NSX and RHEL. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.