VMware NSX is completely software based. This means it’s flexible as heck and you can have a lot of instances running concurrently. It also means you can go crazy with your network topology designs and amount of tinkering you can do with your virtual network. I am someone who loves to tinker. Sometimes a bit too much. A consequence of this, is that I sometimes break my virtual test lab and have to re-install it and return to the starting point. This has happened a few times.

I also like to use clean labs for customer demo purposes, just to make sure everything is clean and working for the demo. I have done the base install of NSX too many times and repetitive tasks need to be automated. :-) With these reasons combined, I created a solution to deploy and configure VMware NSX in 23 minutes.

By the way, if you’re curious about the 23 minutes in the title, check the timer in the usage paragraph below.

Enter PowerNSX

PowerNSX is a pretty complete PowerShell module for VMware NSX. The current development version includes a lot more functions than version 1, including a function to deploy the NSX Manager and register it to vCenter. This gave me an idea to create a script using PowerNSX to do the complete base install of NSX and save me a hour or two each time I need a clean environment. And in the words of a famous poet, ‘Well, that idea escalated quickly’.

configure VMware NSX

Current State

The script has evolved quite a bit and I’ve used it pretty often by now. It currently can do the following for you:

  • Deploy NSX Manager Appliance;
  • Do the registration to vCenter so the NSX plugin becomes available;
  • Deploy a dynamic amount of NSX Controllers;
  • Prepare ESXi hosts for NSX (install the VIBs);
  • Configure VXLAN on the ESXi hosts and do multicast & distributed switch configuration;
  • Add VMs to the Distributed Firewall exclusion list;
  • Create Logical Switches;
  • Create Edge Services Gateways;
  • Create Distributed Logical Routers.

All of this is packed in an Excel file for configuration, a slightly modified PowerNSX module and a script with which you can choose what you want to do. Want to only use it to create a bunch of Logical Switches? Or a quick base install? It can help you with that.

Usage

Using the installation script is pretty basic, just be sure the Excel file is filled out properly. The current state of the installation script is not forgiving when it comes to the information it needs. If something is missing out or incorrect, it’ll just fail halfway the task. Can’t say I didn’t warn you. :-)

Once you’ve filled out the enter Excel file and downloaded the NSX Manager OVA, you can decide exactly what you want to do. Just a quick base install, or the whole shebang?

Only the -SettingsExcel parameter is required and you can supply all other parameters as you see fit. To execute all tasks, supply all paramaters. To only create Logical Switches, only use the -SettingsExcel and -CreateLogicalSwitches parameters.

Here’s an example to deploy and configure the whole shebang:

Download

The installation script is available on GitHub. It’ll be improved as I use it more and need more functionality.

gitHub-download-button NSX

If you end up using it, let me know! Would love to know your use-cases.