Skip to content

rpletka/vrni-apps-to-nsgroups

Repository files navigation

Sync vRNI Applications to NSX Security Groups

This scrpt will read applications from vRealize Network Insight to:

  • Create or update a group for each application with membership criteria of scope vrniApplication and tag equal to the vRNI Applciation name.
  • Tag the VMs in NSX with a scope of vrniApplication and tag equal to the vRNI Applciation name
  • Note the script does not currently remove deleted application groups or tags from VMs that are removed from applications

Installation Steps

  1. Run the SetupModules.ps1 one time to install PowerVRNI and PowerNSX
  2. Run the SetupCredentialVault one time on your target powershell host to store your credentials for vRNI and NSX-T
  3. Update the nsx and vrni server variables at the top of vrni-apps-to-nsgroups.ps1.

This was developed against the following versions:

  • Powershell 7.2.2
  • PowerNSX 3.0.119
  • PowervRNI 6.51.185
  • Microsoft.Powershell.SecretStore 1.0.6
  • Microsoft.Powershell.SecretManagement 1.1.2
  • NSX-T 3.2.0.1.0.19232396
  • vRNI 6.5.1.1645037705

Usage

Run vrni-apps-to-nsgroups.ps1 and/or schedule regular syncronization with the task scheduler of choice. Progress will be reported to the console. Groups will be added/updated to NSX and NSX VM tags will be updated.

./vrni-apps-to-nsgroups.ps1

Example

Example 2 vRNI Saved Applications

image

Example Initial Sync

Here is an example syncing 2 apps with 11 vms total. Note the first run takes significantly longer than additional executions within the session time out. This is because PowerNSX takes a few minutes to connect but the script reuses the connection if the token hasn't expired.

image

Find Managed Groups in NSX

Easily find the groups that were created / updated by searching for "vrn-apps-to-nsgroups" to find all the groups with a description of "This group is managed by vrni-apps-to-nsgroups.ps1"

image

Example Group Definition

image

Example Group Membership

image

Additional Syncs Are Faster

Subsequent runs are faster because they reuse the existing connections to vRNI and NSX

image

License

Network Insight Python SDK is licensed under GPL v2

Copyright © 2019 VMware, Inc. All Rights Reserved.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details.

You should have received a copy of the General Public License version 2 along with this program. If not, see https://www.gnu.org/licenses/gpl-2.0.html.

The full text of the General Public License 2.0 is provided in the COPYING file. Some files may be comprised of various open source software components, each of which has its own license that is located in the source code of the respective component.”

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages