Released: PowerNSX v2

VMworld 2016 has come and gone and one of the best releases of new software (I could be bias here) is PowerNSX. PowerNSX is a PowerShell module that abstracts the VMware NSX for vSphere API to a set of easily used PowerShell functions. In January 2016, PowerNSX v1 was release. At that time it included around 100 cmdlets that covered a fraction of functions but just enough to operate NSX for vSphere. After some time and maturing it is time to see version 2 in the wild.

Version 2 covers a lot more functions and inturn delivers 208 cmdlets to help provide a more well rounded tool for automation of NSX for vSphere.

New features included in version 2:

  • NSX Manager operations
  • IP Pool operations
  • Host and cluster prepartions
  • Transport Zone definition
  • Load Balancer statistics
  • Security Tags
  • Service Groups
  • BGP support on DLR/Edge

As a result the core functionality of PowerNSX covers the areas listed below:

  • NSX Manager setup
  • Host Preparation
  • Logical Switching
  • Logical Routing
  • NSX Edge Gateway
  • Dynamic Routing
  • Distributed Firewall
  • Service Composer
  • NSX Edge Load Balancer
  • NSX Edge SSL VPN

With PowerNSX being a key part to my personal day to day operations I have stopped using the GUI for operations that are included within the PowerNSX module. It has become such a part of my workflow. Some simple tasks include creating new Security Groups, populating them, and then utilising them in a Security Group.

Some of the cool things created by PowerNSX by people:

  • Guided NSX installer
  • BDD tests to assert an NSX environments health
  • Automated topology diagramming
  • SDDC lockdown
  • DFW memory heap utilisation checks
  • Application segmentation

The author of PowerNSX, Nick Bradford, and I presented at VMworld USA 2016. The session introduced PowerNSX and how to operateThe session NET7514 and NET7514R was amongst some of the top rated session of VMworld (4.73 and 5.0 ratings). If you’re interested check it out here

PowerNSX resources

Download PowerNSX over at the VMware Github repository

Learn more about PowerNSX on the official Wiki

Find out more about PowerNSX from yours truly here

VMworld 2016: NET7514: PowerNSX and PyNSXv: Using PowerShell and Python for Automation and Management of VMware NSX for vSphere session link

License NSX via automation with PowerCLI

Quick one today. As of NSX 6.2.3 and 6.2.4 onwards there are licensing tiers. Standard, Advanced, and Enterprise unlock a different set of features. Whilst I won’t hop on the soap box about that today (buy me a beer and I will) there have been lots of automation efforts using PowerNSX to deploy NSX.

With the advent of licensing, the automated installs of 6.2.0 – 6.2.2 that myself and others have been working on came to a screeching halt. All well and good but I needed a way around this. NSX needs to be licensed to prepare the cluster for NSX VIBs to be installed.

# NSX licence via PowerCLI
#a. anthony burke
#t. @pandom
#c. This script will licence NSX for vSphere via PowerCLI. It requires a connection to vCenter along with a valid licence. Kudos to Gavin for helping me find nsx-netsec via MOB.

param (

$ServiceInstance = Get-View ServiceInstance
$LicenseManager = Get-View $ServiceInstance.Content.licenseManager
$LicenseAssignmentManager = Get-View $LicenseManager.licenseAssignmentManager

# The following can be used to check an assigned licence. 
#$CheckLicense = $$LicenseAssignmentManager.QueryAssignedLicenses("nsx-netsec")

Thanks to Gavin B at VMware to directing me to the MOB to find the nsx-netsec service instance ID. Here is the simple script that will do the following:

  • Retrieve and store the licence manager and licence assignment manager objects as variables.
  • Append the value “nsx-netsec” and the value of $licence to the licence assessment manager variable.

That’s it. License is enabled. Voila!

From an automation perspective this needs to be done after the NSX Manager has been registered to vCenter but before Host Preparation is done.

Get the code here on GitHub.