GFW policies with duplicate sequence numbers.(This could be the result of configuration issue of using the sequence number field in the API body)
VMware NSX-T Data Center 3.X
Vmware NSX-T Data Center 4.X
This could be the result of misconfiguration of giving the sequence number field in the API body while configuring the policies.
To resequencing the policies with duplicate sequence numbers:
This API is used to revise sequence number per policy: POST /policy/api/v1/infra/domains/{domain-id}/gateway-policies/{gateway-policy-id}?action=revise
Below workarounds to consider when there are multiple policies with the duplicate sequence number:
Workaround 1:
With the UI, Move the policies up/down on the NSX ui according to your configuration and then Publish.
Then you can check the sequence number being allocated in order.(GET https://<nsx manager>/api/v1/domain/default/gateway-policies)
Workaround 2:
With the API,
Step 1: Use the below API to gather the GFW policies configuration:
GET https://<nsx manager ip>/policy/api/v1/infra?base_path=/infra/domains/default&type_filter=GatewayPolicy
++Gather the output body in a text file and then modify all the policies with the duplicate sequence number to your requirement ie., give the sequence number which is smaller or larger than the previous policy.(chosen sequence number should be unique)
Step 2: Copy the edited data into the body field of the below extended Patch and run the API call:
PATCH https://{{policy_ip}}/policy/api/v1/infra
Re-sequenced output: