Scripting: NSX-v – Bulk DFW Rule Creation

Recently when doing some performance testing with a customer, we wanted to have the ability to bulk create a number of DFW rules. By leveraging some python scripting and the NSX-v API, I came up with a flexible and re-useable script which can be used to create a new section and populate it with up to 997 DFW rules. The reason for creating a new section is so that when it comes time to delete the test rules, its as simple as just deleting the section, which will delete all rules within the section. ...

August 26, 2015 · 6 min

Scripting - Resetting NSX-v objects

On various engagements I am involved with, I often need to produce some code to add or delete objects from NSX-v. These objects in general are things like IP Sets, MAC Sets, Security Groups, Security Tags, Services, Service Groups, Security Policies and even deleting the FW rulebase itself. Until recently I was doing this manually as I was dealing with relatively small numbers of objects, however on a previous engagement I was working on a script to import up to 33,000 objects and when testing the script in a dev environment, we needed a way to go through and delete everything we had just imported and set it back to “defaults”. ...

June 14, 2015 · 6 min

Scripting syslog server configurations on NSX-v Controllers

Its well documented that the only way to configure syslog settings on NSX-v controllers is via the REST API. One of the things I find myself constantly doing over and over again on customer engagements is configuring syslog servers details on the NSX-v controllers, whether its because I am at a new client, or someone decides to change the destination for their syslog and we need to update them all. ...

May 28, 2015 · 6 min

Scripting: NSX-v – Displaying Security Group Members

Often when working in customer environments, there is a requirement to define security group members which are not virtual machines within the visualised environment. To achieve this, these security group members must be defined as an IP Set. The IP Set can then be included as an object in a security group. However, within the UI, it doesn’t show you all the non-vm members of a security group. ...

April 24, 2015 · 2 min

Scripting: NSX-v - Security Groups with Dynamic membership

NSX-v allows the creation of Security Groups to group objects to be used in DFW rules and security policies. Each security group can have a mix of static and dynamic membership (If you want to get picky, you can also statically exclude objects). One of the possible ways to dynamically include members into the security group is to match on a security tag. This allows a VM to have security tags assigned to them, and based on the security tag, a VM can be dynamically added as a security group member. ...

February 19, 2015 · 10 min

Scripting: NSX-v - Importing Checkpoint Objects

When faced with migrating from a Checkpoint installation to a VMware NSX-v installation, at some point someone is going to need to get all the objects across to the new firewall platform. I was recently asked to help add some functionality to a script to take some data from an odumper csv output and pump it into NSX-v. The following script is a bit of a hack I put together. The script is based off one written by Brett Drayton (www.brettdrayton.com) in this post. ...

February 6, 2015 · 5 min

Scripting: Querying NSX-v service objects by port

When using the NSX-v distributed firewall (DFW) have you ever need to find out if a service has already been configured in the system for a particular port number? Recently I was given a sample ruleset from a client to re-create in the DFW, and one thing that stood out was that when creating NSX firewall rules and faced with a random port number that needed to be configured for a rule, there is no easy way to find out if a service has already been configured using that port. ...

February 5, 2015 · 9 min

Scripting, Scripting and more Scripting

Over my years as a network engineer there has always been some element of scripting required. Whether it was formally required by a project, a particular situation or whether it was because i was sick of doing the same thing over and over again and wanted to make my life easier. As part of my new role at VMware, I get to play with NSX for vSphere or NSX-v, and one thing that becomes apparent, is that if you don’t learn how to use the REST API, there will be certain situations where you will not be able to achieve your desired outcome. The NSX REST API, can be used to configure items which are not exposed in the UI, or you can use your favourite scripting language and script repetitive tasks. ...

February 3, 2015 · 1 min