ucs-mds-zoning-bridge is a tool designed to simplify and automate the process of managing zoning configurations between Cisco UCS and MDS switches. This tool bridges the gap between UCS Server Profiles vHBAs configured in Intersight and MDS zoning, ensuring seamless integration and efficient management.
Note: This project has been improved and mostly re-used in my project: ucs-san-builder.
- Automated Device Aliases: Automatically configures device-aliases from UCS Server Profiles' vHBAs defined in Intersight.
- Automated Zoning: Automatically configures zoning from UCS Server Profiles' vHBAs defined in Intersight.
- CLI interaction: CLI is automatically generated through the Google Python Fire project.
Before using this tool, ensure the following:
- Python 3.8 or later is installed.
- Access to Cisco Intersight with appropriate Intersight API keys. Refer to the Intersight API Key Generation Guide for detailed instructions.
- Access to Cisco MDS switches with appropriate credentials. NX-API feature must be turned on. Refer to the Cisco MDS 9000 Series Programmability Guide for detailed instructions.
- Required Python libraries installed (see Installation section).
- Network connectivity between the system running the tool and Intersight/MDS devices.
-
Clone the repository:
git clone https://github.com/your-repo/ucs-mds-zoning-bridge.git cd ucs-mds-zoning-bridge -
Install dependencies:
pip install -r requirements.txt
-
Set up the tool by modifying the environment variables in the
zone_bridge_fire.pyfile to give access to Intersight API keys and MDS credentials. Alternatively, you can directly define the Intersight API keys and MDS credentials as variables within the script (this approach is not recommended for many reasons).
The CLI provides the following options for configuring zoning:
python zone_bridge_fire.py configure_intersight_mds_zones [OPTIONS]--server_profile_name: (Required) Name of the UCS Server Profile to synchronize.--organization_name: (Required) Name of the organization in Intersight where the Server Profile is attached.--zone_name_a: (Required) Name of the zone for MDS A.--vsan_id_a: (Required) VSAN ID for MDS A.--zone_name_b: (Required) Name of the zone for MDS B.--vsan_id_b: (Required) VSAN ID for MDS B.--flag_configure_device_aliases: (Optional) Boolean flag to configure device aliases.--flag_add_zones_to_zonesets: (Optional) Boolean flag to add zones to zonesets.--flag_activate_zonesets: (Optional) Boolean flag to activate zonesets.--zoneset_name_a: (Required ifflag_add_zones_to_zonesetsis set toTrue) Name of the zoneset for MDS A. Default isNone.--zoneset_name_b: (Required ifflag_add_zones_to_zonesetsis set toTrue) Name of the zoneset for MDS B. Default isNone.
If flag_configure_device_aliases is set to true, device-alias is automatically created for the vHBAs WWPNs on each MDS, and has the following structure: {server_profile_name}-{fabric}-{vhba_name}
For example, if the Server Profile in Intersight is named ucs-sp-1, has two vHBAs with names vhba0 attached to Fabric A (WWPN 20:00:00:00:00:00:00:01) and vhba1 attached to Fabric B (WWPN 20:00:00:00:00:00:00:02), the device-aliases would be:
- On MDS A :
device-alias name ucs-sp-1-A-vhba0 pwwn 20:00:00:00:00:00:00:01 - On MDS B :
device-alias name ucs-sp-1-B-vhba1 pwwn 20:00:00:00:00:00:00:02
When flag_configure_device_aliases is set to true, device-aliases are used to add members in MDS zones instead of directly using the WWPNs of vHBAs. For example, if using zone zone-demo-a in vsan 100 of MDS A, following configuration would be pushed to MDS A :
zone name zone-demo-a vsan 100
member device-alias ucs-sp-1-A-vhba0When flag_configure_device_aliases is set to false, WWPNs of vHBAs are used to add members in MDS zones. For example, if using zone zone-demo-a in vsan 100 of MDS A, following configuration would be pushed to MDS A :
zone name zone-demo-a vsan 100
member pwwn 20:00:00:00:00:00:00:01Fetch UCS Server Profile and its vHBAs WWPNs, create device-aliases, add the device-aliases as member of MDS zones, add zones to zonesets and activate zonesets:
python zone_bridge_fire.py configure_intersight_mds_zones \
--server_profile_name=ucs-sp-1 \
--organization_name=demo \
--zone_name_a=zone-demo-a \
--vsan_id_a=100 \
--zone_name_b=zone-demo-b \
--vsan_id_b=200 \
--zoneset_name_a=zoneset-demo-a \
--zoneset_name_b=zoneset-demo-b \
--flag_configure_device_aliases=True \
--flag_add_zones_to_zonesets=True \
--flag_activate_zonesets=TrueFetch UCS Server Profile and its vHBAs WWPNs, skip device-aliases creation, add the vHBAs WWPNs as member of MDS zones, add zones to zonesets and activate zonesets:
python zone_bridge_fire.py configure_intersight_mds_zones \
--server_profile_name=ucs-sp-1 \
--organization_name=demo \
--zone_name_a=zone-demo-a \
--vsan_id_a=100 \
--zone_name_b=zone-demo-b \
--vsan_id_b=200 \
--zoneset_name_a=zoneset-demo-a \
--zoneset_name_b=zoneset-demo-b \
--flag_configure_device_aliases=False \
--flag_add_zones_to_zonesets=True \
--flag_activate_zonesets=TrueFetch UCS Server Profile and its vHBAs WWPNs, skip device-aliases creation, add the vHBAs WWPNs as member of MDS zones, skip adding zones to zonesets and skip zonesets activation:
python zone_bridge_fire.py configure_intersight_mds_zones \
--server_profile_name=ucs-sp-1 \
--organization_name=demo \
--zone_name_a=zone-demo-a \
--vsan_id_a=100 \
--zone_name_b=zone-demo-b \
--vsan_id_b=200 \
--zoneset_name_a=zoneset-demo-a \
--zoneset_name_b=zoneset-demo-b \
--flag_configure_device_aliases=False \
--flag_add_zones_to_zonesets=False \
--flag_activate_zonesets=FalseContributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Submit a pull request.