SysSet – A Syslog Configuration Tool for NSX Edges

I had a colleague the other week ask about changing a few hundred NSX Edges Syslog address. There was some configuration drift in the environment where the edges fell into a few different categories. The Edges either didn’t have configuration, had incorrect configuration (such as an old syslog entry), or they needed to be changed.

SysSet – A Syslog Configuration tool for NSX Edges

The goal was instead of clickety clicking all the way through the UI to use PowerNSX. This can be done quite easily which is great. Whilst there is not explcitly a command that does Set-NsxEdgeSyslogcurrently, the XML object can be modified and placed back onto the given edge with Set-NsxEdge.

The order of operations are as follows:

  • Collect all Edges
  • For each collected Edge:
  • Check Syslog Status
  • If enabled: Configure properties
  • Publish
  • If not enabled : Enable Syslog
  • Publish
  • Update properties
  • Publish

The reason for the double Set-NsxEdge operation is the fact that Log Level and Syslog protocol cannot be set before Syslog itself is enabled. This tool can handle most changes. It can also handle the ability to change only one property if desired.

Running SysSet.

I ran SysSet against my recently blogged about ECMP topology. This is 9 different nodes. Based on the content in the paramter block my Syslog was configured.

PowerCLI C:\> C:\Users\Administrator\Desktop\sysset.ps1
Enabling Syslog for upstream-edge
Configuring Syslog values for upstream-edge
Enabling Syslog for ecmp-edge1
Configuring Syslog values for ecmp-edge1
Enabling Syslog for ecmp-edge2
Configuring Syslog values for ecmp-edge2
Enabling Syslog for ecmp-edge3
Configuring Syslog values for ecmp-edge3
Enabling Syslog for ecmp-edge4
Configuring Syslog values for ecmp-edge4
Enabling Syslog for ecmp-edge5
Configuring Syslog values for ecmp-edge5
Enabling Syslog for ecmp-edge6
Configuring Syslog values for ecmp-edge6
Enabling Syslog for ecmp-edge7
Configuring Syslog values for ecmp-edge7
Enabling Syslog for ecmp-edge8
Configuring Syslog values for ecmp-edge8

Superb! We can see that the 9 edges have had their syslog configuration create. Now to validate.

PowerCLI C:\> $edge = get-nsxedge ecmp-edge8
PowerCLI C:\> $edge.features.syslog

version enabled protocol serverAddresses
------- ------- -------- ---------------
3       true    udp      serverAddresses

Here we can see that Syslog is enabled, the protocol is udp and the serverAddresses property has content.

PowerCLI C:\> $edge.features.syslog.serverAddresses

ipAddress
---------
{192.168.100.189, 192.168.100.190}

Hopefully this helps bring your environment in line with a configuration standard. I should crack the DLR code shortly too. I think I might look at doing some DSC and remediation tests with this. Something along the lines of “if an Edge has incorrect Syslog settings, modify them”.

Grab the script

PowerNSX
SysSet Script

NSX Full Stack deployment

In our line of work we are often deployment clean NSX environments in the lab. One of our labs allows us to deploy a multi-cluster vSphere environment and configure it with storage, clusters, vCenter elements, and DVS with PowerCLI very quickly. This allows our team to quickly deploy a topology and validate a customer environment, squash a bug, or configure a new integration.

Automate all the things

With all these new environments it is pretty painful and slow to deploy NSX again and again. So here is the script we use to deploy NSX from nothing and deploy it all the way through to a working 3 Tier App.

Why now?

To be frank, we’ve been sitting on something like this since Janaury and just assume it was useful to use. Time to dust it off and share with the wide world.

Running the Script

There are a heap of parameters that you will need to adjust for your environment. Storage and Cluster names are the ones that are most likely to be different. IP addresses too. The idea of this script is that you can take the code you need and create something of your own.

By running ./NSXBuildFromScratch.ps1 the following will occur:

  • Validate and collect Virtual Infastructure
  • Deploy NSX Manager
  • Register NSX Manager
  • Deploy NSX Controller
  • Prepare vSphere clusters for DFW/VXLAN
  • Configure VNI and Transport Zone

Whilst the infrastructure is deploying there are checks to ensure if timeouts occur they are handled. This pertains mostly to the Host preparation steps.

Once completed the 3 Tier Application is deployed.

  • Logical Switches
  • Logical Router
  • Edge
  • Edge and DLR routing
  • Edge Load Balancer
  • Distributed Firewall / Rules
  • Deploy vApp

So what are you waiting for? Grab the script, download the 3 Tier App OVA and get your groove on by deploying dozens on labs per hour!

Download the Script

Download the Bookstore 3 Tier App for yourself.