If the application attempts to reach an IP/Port and is unable to then you can use the following steps below to ensure if the ASG has been properly realized and created in NSX T.
1. Retrieve the ASG GUID from Cloud Controller by searching for the ASG name
cf curl /v2/security_groups?q=name:rule-to-bind | jq .resources[].metadata.guid "12f0145e-34a6-4861-a71f-e73cc35bd527"
2. Retrieve the Space GUID from Cloud Controller by search for the Space name
cf curl /v2/spaces?q=name:rios-test-1111 | jq .resources[].metadata.guid "d99d65dc-9d6f-4eea-82c5-f87c206e0a37"
3. Identify the NCP Leader, and check if the ASG GUID is in the NCP asg-cache using nsxcli & bosh ssh. After the command executes we can identify the NCP Leader via STDOUT output, our NCP Leader will say This instance is the NCP master. Once the NCP Leader is identified we will check the asg-cache
bosh -d cf-382ebe75a0100ffa6525 ssh diego_database -c "sudo /var/vcap/jobs/ncp/bin/nsxcli -c get ncp-master status" -r Instance diego_database/0400c700-d138-4842-8dd2-e450710c4617 Stdout Mon Nov 14 2022 UTC 19:23:48.312 This instance is the NCP master Current NCP Master id is 3ddf17bd-b43d-4d13-a8ba-f3f90e6bd458 Current NCP Instance id is 3ddf17bd-b43d-4d13-a8ba-f3f90e6bd458 Last master update at Mon Nov 14 19:23:43 2022 Stderr Unauthorized use is strictly prohibited. All access and activity is subject to logging and monitoring. Connection to 172.##.#.## closed. Exit Code 0 Error - Instance diego_database/1b5944c2-2de5-426e-a72a-aa74ca5f27c6 Stdout Mon Nov 14 2022 UTC 19:23:48.170 This instance is not the NCP master Current NCP Master id is 3ddf17bd-b43d-4d13-a8ba-f3f90e6bd458 Current NCP Instance id is 455aeaf4-a59d-4411-8d3f-4ba2e3598d8b Last master update at Mon Nov 14 19:23:47 2022 Stderr Unauthorized use is strictly prohibited. All access and activity is subject to logging and monitoring. Connection to 172.##.#.## closed.
bosh -d cf-382ebe75a0100ffa6525 ssh diego_database/0400c700-d138-4842-8dd2-e450710c4617 -c "sudo /var/vcap/jobs/ncp/bin/nsxcli -c get asg-cache 12f0145e-34a6-4861-a71f-e73cc35bd527" -r Using environment '172.##.#.##' as client 'ops_manager' Using deployment 'cf-382ebe75a0100ffa6525' Task 162. Done Instance diego_database/0400c700-d138-4842-8dd2-e450710c4617 Stdout Tue Nov 15 2022 UTC 00:19:37.463 fws_id: 15a655fd-9c4d-4b03-95b7-a6003e12d026 name: rule-to-bind rules: code: 0 destinations: 0.0.0.0/0 ports: protocol: icmp type: 0 code: None destinations: 10.0.11.0/24 ports: 80 443 protocol: tcp type: None running_default: False running_spaces: d99d65dc-9d6f-4eea-82c5-f87c206e0a37 staging_default: False staging_spaces:
Note: We see that the ASG GUID exists in the cache as a result is returned and we confirmed that the ASG is binded to our space.
Suggestion: If you do not see the ASG in the cache or the Space GUID is not in running_spaces or staging_spaces field, then restart the NCP Job hosted on the Diego Database VM. Upon a restart of NCP this will clear the asg-cache and NCP we will rebuild its cache upon restart. If the asg-cache continues to not reflect the ASG or Space GUID then open a case with Tanzu Support, as this indicates ASG information is not being pulled to Workflow A or pushed to Workflow B.
4. If the ASG exists within the cache and is binded to a space and communication continues to fail then check if the ResourceType FirewallSection is created for the ASG object and is binded assigned_to spaces in NSX.
5. Search for the ASG in NSX UI using the ASG GUID
6. Search the ID created by NSX for Resource Type Firewall Section which we identified in the above step. Hover your cursor over the Applied To field and check if your Space name appears on the list
7. If you do not see the DFW Rule applied to your space, the rule exists in asg_cache, and there are no more than 128 Spaces assigned_to the DFW Rule then open a case with NSX T Support as this outside of the knowledge realm of TAS