VMware NSX Setup Script


It contains Power CLI Scripts(16) to quickly setup VMware NSX Lab to perform testing for basic Testing It takes input from JSON file and performs following tasks  
  1. NSX Manager Deployment
  2. Register VC in NSX Manager
  3. Assign NSX License
  4. Prepare ESXi Host(s) in Cluster
  5. Create IP Pool for Controller & VTEP
  6. Deploy Controller ( As it is lab currently deploying only 1 , Can we use same script to deploy multiple if required)
  7. Add/Create Segment
  8. Configure VXLAN
  9. Create Transport Zone
  10. Create Transit Logical Switch to interconnect DLR and Edge
  11. Deploy DLR with uplink from Transit Logical Switch
  12. Deploy ESG with Uplink from VLAN backed PG and Internal NIC from Transit Logical Switch
  13. Configure Default Gateways on DLR and Edge
  14. Configure OSPF in DLR
  15. Configure  OSPF in Edge


It can be downloaded from GitHub

Usage Instructions

  1. Create a folder called \”Scripts\” under C:\\ for windows ( I haven\’t had chance to test it in Linux) and save all the scripts along with JSON file
  2. Modify the JSON file as per your environment
  3. Open Power CLI and navigate to the C:\\Scripts and execute \”nsxsetup.ps1\”


  1. Management VC – VC where NSX Manager will be deployed. It could be same as Compute VC
  2. Compute VC –   VC which will be integrated with NSX
  3. VDS – Distributed Switch on Compute VC along with Port Group with MTU 1600
  4. Datastore(s) – Datastores where all the VMs will be deployed i.e. NSX Manager , NSX Controller, NSX DLR & NSX Edge. Details needs to be updated in JSON file
  5. IP Details – All the IP details for all the VMs deployed. Details needs to be updated in JSON file

Demo Link

I have recorded Demo for the Script . ### No Audio. Visual Updates Only ###

0 thoughts on “VMware NSX Setup Script

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: