Last week, I had spent some time exploring and getting myself more familiar with NSX-T, which is the next generation release of the NSX platform from VMware. One of the first thing I do when learning about a new product is to setup a lab environment that I can using. Having gone through the deployment once by hand, I realized it would be quite painful if I needed to do this again, which I know I will and I did 🙂 I wanted to have a simliar experience to my vGhetto Automated vSphere Lab deployment script which also including setting up the entire vSphere infrastructure along with deploying and configuring NSX-V and extending it to support NSX-T.

Since my original script leverages PowerCLI to access both the vSphere and NSX APIs, I wanted to do the same with NSX-T. Funny enough, the PowerCLI team had just published an update release (6.5.3) which also added support for NSX-T and I thought this was perfect timing to try out the NSX-T APIs, which I had never used before.

I have created a new Github repository called vghetto-nsxt-automated-lab-deployment which contains detailed instructions along with the PowerCLI script.

Here is what the script is currently performing:

  1. Deploy and configure vCenter Server Appliance 6.5u1
  2. Deploy and configure 3 x Nested ESXi 6.5u1 Virtual Appliance VMs and attaching it to vCenter Server
  3. Deploy NSX-T Manager, 3 x Controllers & 1 x Edge and setup both the Management and Control Cluster Plane
  4. Configure NSX-T with IP Pool, Transport Zone, Add vCenter Server as Compute Manager, Create Logical Switch, Prepare ESXi hosts, Create Uplink Profile & Add configure ESXi hosts as a Transport Node

Similiar to the vSphere version of this script, all deployed VMs will be placed inside of a vCenter vApp construct as shown in the example screenshot below:


Here is an example output of a succesful deployment and you go from nothing to a fully functional NSX-T environment in just 50 minutes, which is pretty awesome if you ask me!?


Here are a few additional screenshot of NSX-T UI after deployment and you should the NSX Manager and Controller Nodes registered.

If you go into Fabric->Nodes->Hosts, you should see all the ESXi hosts that was deployed, prepared and associated with NSX-T

Obviously, I have only scratched the surface of NSX-T and its automation capabilities and while the deployment is fairly basic, it does enable customers to quickly spin up an NSX-T environment without any prior knowledge. Hopefully I will be able to expand on this script in the future and if folks would like to contribute back, feel free to submit a pull request to the Github repository. It was definitely a learning experience using the new NSX-T APIs and for areas where there were Automation gaps, I was able to take advantage of a recently published article I had on sending keyboard keystrokes to a VM using the vSphere API which was quite handy for places where I did not want to rely on SSH. I definitely have some feedback to share with the NSX team and hopefully we can improve NSX-T in future releases so both initial setup and day operations can be even easier!

4 thoughts on “vGhetto Automated NSX-T 2.0 Lab Deployment

  1. I’m still struggling with the automatic customizing of the nested esxi hosts: one half of the esxi have hostnames and ips configured, the other half of the nested esxi is coming up with “localhost” and an ip address assigned by DHCP. Any ideas?

  2. Hi, is the $VirtualSwitchType = “VSS” # VSS or VDS working well?

    Its giving me problems.

    [10-31-2017_09:39:59] Adding vmnic2/vmnic3 to VSS00-VLAN310-VTEP …
    New-NetworkAdapter : 31/10/2017 9:39:59 PM New-NetworkAdapter Could not find VirtualPortGroupBase with name
    ‘VSS00-VLAN310-VTEP’.

Thanks for the comment!