For a freshly deployed NSX-T environment, you will find 2 default transport zones created:
- nsx-overlay-transportzone
- nsx-vlan-transportzone
These are system created TZ’s and thus they are marked as default.
You can consume these TZ’s or can create a new one as per your infrastructure. Default TZ’s can’t be deleted.
Any newly created transport zone doesn’t shows up as default. Also when creating a new TZ via UI, we don’t get any option to enable this flag. As of now this is possible only via API.
Creating a new Transport Zone with the “is_default” flag to true will work as intended, and the “is_default” flag will be removed from the system created TZ and the newly created TZ will be marked as the default one.
Note: We can modify a TZ and mark it as default post creation as well.
Let’s have a look at properties of system created transport zone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Method: GET URL: https://{{nsxmgr}}/api/v1/transport-zones Authorization: Basic admin/<NSX-T Password> Content-Type: application/json Response Output: { "transport_type":"OVERLAY", "host_switch_name":"nsxHostSwitch", "host_switch_id":"bf441324-356a-4d5c-9740-cd1baefced05", "host_switch_mode":"STANDARD", "nested_nsx":false, "is_default":true, "resource_type":"TransportZone", "id":"1b3a2f36-bfd1-443e-a0f6-4de01abc963e", "display_name":"nsx-overlay-transportzone" } |
To set a manually created TZ as default, we have to remove “is_default” flag from the system created TZ and then create a new TZ or modify existing TZ with this flag.
1: Remove “is_default” flag from system created TZ: In the payload json supplied with PUT request, change value of “is_default” from true to false.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
Method: PUT URL: https://{{nsxmgr}}/api/v1/transport-zones/<TZ-Id> Authorization: Basic admin/<NSX-T Password> Content-Type: application/json Payload: { "transport_type":"OVERLAY", "host_switch_name":"nsxHostSwitch", "host_switch_id":"bf441324-356a-4d5c-9740-cd1baefced05", "transport_zone_profile_ids":[ { "resource_type":"BfdHealthMonitoringProfile", "profile_id":"52035bb3-ab02-4a08-9884-18631312e50a" } ], "host_switch_mode":"STANDARD", "nested_nsx":false, "is_default":false, "resource_type":"TransportZone", "id":"1b3a2f36-bfd1-443e-a0f6-4de01abc963e", "display_name":"nsx-overlay-transportzone", "_create_user":"system", "_create_time":1596435619104, "_last_modified_user":"system", "_last_modified_time":1596435619104, "_system_owned":false, "_protection":"NOT_PROTECTED", "_revision":0, "_schema":"/v1/schema/TransportZone" } |
2: Modify existing TZ and set flag: In the payload json supplied with PUT request, change value of “is_default” from false to true.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
Method: PUT URL: https://{{nsxmgr}}/api/v1/transport-zones/71942282-0b43-4144-90e5-da9837528cb6 Authorization: Basic admin/<NSX-T Password> Content-Type: application/json Payload: { "transport_type":"OVERLAY", "host_switch_name":"SDDC-NVDS", "host_switch_id":"a04e205e-e00d-4120-9ead-75fd28fbb8c7", "transport_zone_profile_ids":[ { "resource_type":"BfdHealthMonitoringProfile", "profile_id":"52035bb3-ab02-4a08-9884-18631312e50a" } ], "host_switch_mode":"STANDARD", "nested_nsx":false, "is_default":true, "resource_type":"TransportZone", "id":"71942282-0b43-4144-90e5-da9837528cb6", "display_name":"SDDC-Overlay-TZ", "_create_user":"admin", "_create_time":1596473680099, "_last_modified_user":"admin", "_last_modified_time":1596473680099, "_system_owned":false, "_protection":"NOT_PROTECTED", "_revision":0, "_schema":"/v1/schema/TransportZone" } |
Now if we look at the transport zones, we can see user created TZ is now marked as default and tags have been removed from both system created TZ.
Note: If there is an existing transport zone that is marked as default, and you try to update the “is_default” on a separate transport zone without removing the flag from the existing default transport zone, the following error will be returned, and it provides the ID of the current Default transport zone.
1 2 3 4 5 6 |
{ "httpStatus":"BAD_REQUEST", "error_code":8109, "module_name":"NsxSwitching service", "error_message":"OVERLAY default TransportZone 71942282-0b43-4144-90e5-da9837528cb6 already exists." } |
And that’s it for this post.
I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing 🙂