lamw / vsphere-with-tanzu-nsxt-automated-lab-deployment

vSphere with Tanzu using NSX-T Automated Lab Deployment
212 stars 79 forks source link

additional code that is required to make use of the 2nd edge #30

Open abbedsedk opened 1 year ago

abbedsedk commented 1 year ago

Hi William @lamw ,

Thank you so much for all the good work,

(Update) Just to document the error when adding a 2nd edge:

get log-file syslog

2022-08-23T10:24:40.373Z tanzu-nsx-3.my.domain NSX 15593 POLICY [nsx@6876 comp="nsx-manager" errorCode="MP503065" level="ERROR" reqId="bbbc5ee1-aed1-4794-88e5-e2b3b5ff8f3b" subcomp="policy" username="admin"] Invalid edge path /infra/sites/default/enforcement-points/default/edge-clusters/71d58294-c8d8-45a6-aabc-87b384fcfcda/edge-nodes/0 1 specified.
2022-08-23T10:24:40.466Z tanzu-nsx-3.my.domain NSX 15593 - [nsx@6876 audit="true" comp="nsx-manager" level="INFO" reqId="bbbc5ee1-aed1-4794-88e5-e2b3b5ff8f3b" subcomp="policy" update="true" username="admin"] UserName="admin", ModuleName="PolicyConnectivity", Operation="CreateOrReplaceTier0Interface", Operation status="failure", New value=["Tanzu-T0-Gateway" "default" "c35c8524-7767-4a18-bdb8-0ed75425e921" {"override":false} {"urpf_mode":"STRICT","edge_path":"/infra/sites/default/enforcement-points/default/edge-clusters/71d58294-c8d8-45a6-aabc-87b384fcfcda/edge-nodes/0 1","segment_path":"/infra/segments/Tanzu-Segment","type":"EXTERNAL","resource_type":"Tier0Interface","marked_for_delete":false,"overridden":false,"subnets":[{"ip_addresses":["192.168.1.119"],"prefix_len":24}],"_protection":"UNKNOWN"}]
2022-08-23T10:24:40.523Z tanzu-nsx-3.my.domain NSX 15593 SYSTEM [nsx@6876 audit="true" comp="nsx-manager" level="INFO" subcomp="policy"] UserName:'admin' ModuleName:'Policy' Operation:'PUT@/api/v1/infra
/tier-0s/Tanzu-T0-Gateway/locale-services/default/interfaces/c35c8524-7767-4a18-bdb8-0ed75425e921' Operation status: 'failure' Error: Invalid edge path=[/infra/sites/default/enforcement-points/default/edge-clusters/71d58294-c8d8-45a6-aabc-87b384fcfcda/edge-nodes/0 1] specified.

The API GET Error listing all member giving "Invalid edge path /infra/sites/.../edge-nodes/0 1 specified.": https://vdc-repo.vmware.com/vmwb-repository/dcr-public/f024be51-bdd3-4869-81fc-f2f2854b68e0/aba6aa9c-9e41-4950-b959-aaa7a0df387f/api_includes/method_ListEdgeNodesUnderEdgeClusterForEnforcementPoint.html

The API PUT Error creating an interface on T0 Gateway expecting only one edge node member_index / id: https://vdc-repo.vmware.com/vmwb-repository/dcr-public/f024be51-bdd3-4869-81fc-f2f2854b68e0/aba6aa9c-9e41-4950-b959-aaa7a0df387f/api_includes/policy_networking_connectivity_tier-0_gateways_interfaces_interfaces.html

The solution as the PUT is seeing the 2 edge member_index is to redefine it as member_index[0].

at end of line 1450 after member_index

add [0]

member_index[0]

that's it

just to mention that it works with 2 edge but it can scale to the max of 10 edge nodes per cluster as configmax says or more since it's not a hard limit :)

everything is good code is rock solid :muscle:, adding VRF in mix would be great to test out dedicated network per Tanzu use case :grinning:

Cheers

Abbed strivevirtually.net