Automate NSX-T Support Bundle Collection with Python


๐ง 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.
๐ก๏ธ 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:
Connects to each NSX-T Manager in a cluster.
Authenticates using basic auth (username/password).
Triggers support bundle collection.
Downloads the generated bundles.
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.
Subscribe to my newsletter
Read articles from Ravi Shankar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
