The "IPs used by VPC" count under "Applied IP Quota Usage" differs from the actual number of IPs consumed by the VPC.
search cancel

The "IPs used by VPC" count under "Applied IP Quota Usage" differs from the actual number of IPs consumed by the VPC.

book

Article ID: 445249

calendar_today

Updated On:

Products

VMware NSX VCF Automation

Issue/Introduction

In the organizational portal, when navigating to Manage & Govern > Networking > Virtual Private Clouds, you can view the "IPs used by VPC" under the "Applied IP Quota Usage" section for a specific VPC.

 

However, this "IPs used by VPC" count differs from the actual number of IPs consumed by the VPC, as verified by the API outputs:

1. "/policy/api/v1/orgs/default/projects/<project-id>/vpcs/vpc-1/limits/state" endpoint reflects the "IPs used by VPC" value displayed in the VCFA UI.

{
  "results" : [ {
    "intent_path" : "/orgs/default/projects/<project-id>/infra/limits/vpc-1",
...
        "single_ips_consumed" : 5,
...

 

2. "/policy/api/v1/orgs/default/projects/<project-id>/limit/state" API endpoint represents the actual number of IPs consumed by the VPC.

{
    "vpc_path" : "/orgs/default/projects/<project-id>/vpcs/vpc-1",
    "vpc_limit_state" : {
      "results" : [ {
        "intent_path" : "/orgs/default/projects/<project-id>/infra/limits/vpc-1",
...
            "single_ips_consumed" : 2,
...

 

Environment

VMware NSX 9.1

VCF Automation 9.1

Cause

In situations where there are VPCs with same prefix in their IDs, the VPC limit state API api/v1/orgs/default/projects/<project-id>/vpcs/<vpc-id>/limits/state is returning a summation of IPs count for all such VPCs which is incorrect. This is because the subnet count logic is matching for the VPC intent path without a "/" at the end, as a result of which all VPCs with the same prefix is matched and an incorrect count of number of IPs is returned.

For instance, if there are two distinct VPCs named vpc-1 and vpc-12, a system query for vpc-1 mistakenly matches both vpc-1 and vpc-12 due to the same prefix. Consequently, the API incorrectly aggregates the IP counts from both VPCs.

Resolution

As a workaround: To avoid this issue, prevent creating VPCs with the same prefix in the VPC IDs.(e.g., avoid naming VPCs vpc-1 and vpc-12)

This issue will be addressed in a future release.