Automate NSX-T Support Bundle Collection with Python

Ravi ShankarRavi Shankar
2 min read

๐Ÿ”ง Automate NSX-T Support Bundle Download Using Python

When managing VMware NSX-T environments, collecting support bundles from all NSX-T Managers can be a tedious but critical task, especially during troubleshooting or support cases. In this blog, Iโ€™ll walk you through a Python script I created that automates the process using NSX-T's REST APIs.

โœ… View the script on GitHub


๐Ÿ›ก๏ธ Prerequisites

  • Python 3.x

  • requests library (pip install requests)

  • NSX-T Manager credentials with appropriate access

  • Local system with network access to NSX-T Managers

๐Ÿ“Œ Why Automate Support Bundle Collection?

  • Manual bundle collection from each NSX-T manager is time-consuming.

  • Reduces human error in operations.

  • Useful during proactive health checks or SR escalations.

  • Supports secure authentication and simplifies multi-node environments.


๐Ÿ’ป Script Overview

This Python script performs the following tasks:

  1. Connects to each NSX-T Manager in a cluster.

  2. Authenticates using basic auth (username/password).

  3. Triggers support bundle collection.

  4. Downloads the generated bundles.

  5. Saves them with timestamped filenames.

๐Ÿงช How to Run It

bashCopyEditpython3 nsx_support_bundle.py --nsxip 8.8.8.8 --nsxpassword 'welcome' --downloaddir /tmp

Optional: You can run it via cron for regular proactive collections.

๐Ÿ“ˆ Benefits for VMware Admins

  • Saves time during SRs or audits.

  • Can be integrated into broader automation frameworks.

  • Good starting point for NSX-T API exploration.

๐Ÿ”— Extend It Further

You can enhance the script to:

  • Upload to a central SFTP or storage bucket.

  • Add email notifications on completion.

  • Include error handling/reporting for inaccessible nodes.

0
Subscribe to my newsletter

Read articles from Ravi Shankar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ravi Shankar
Ravi Shankar