"pks create-cluster" command to build the TKGI Cluster failed with the error below:
Error: error processing provision parameters: Error creating NSX-T cluster network `pks-########-####-####-####-########`: create network: Resources for instance ########-####-####-####-######## exist, must specify different instanceID. Collected resources:{Cidr: Gateway: ExternalIP: LbServiceID: LbName: LbSize: Status:6 SwitchName: T0RouterID:t0-router TopTierRouterID:pks-########-####-####-####-########-cluster-router EdgeClusterID:########-####-####-####-######## OverlayTransportZoneID:########-####-####-####-######## MasterVMsNSGroupName: IPBlockID:nodes-block SubnetPrefix:0 NatMode:false SpoofGuardProfileID: SingleTierTopology:false MasterVMsNSGroupID: CreatedByAPI:}
NSX manager /var/log/proton/nsxapi.log reported the following:
INFO http-nio-127.0.0.1-7440-exec-40 NsxBaseRestController 88510 SYSTEM [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] Error in API /nsxapi/api/v1/infra/realized-state/realized-entities?intent_path=%2Finfra%2Fip-pools%2Fpks-########-####-####-####-########%2Fip-subnets%2Fpks-########-####-####-####-######## caused by exception com.vmware.nsx.management.policy.policyframework.exceptions.InvalidParameterException: {"moduleName":"Policy","errorCode":500090,"errorMessage":"Policy object path=[/infra/ip-pools/pks-########-####-####-####-########/ip-subnets/pks-########-####-####-####-########] does not exist."}VMware NSX
Tanzu Kubernetes Grid Integrated Edition
The issue was caused by an automation API script. The script used both Policy and Manager APIs to manage IP blocks, which were initially created in the Policy API but deleted in the Manager API.
The IP block ended with only a Policy object without a realized MP object.
1. Delete the questioned IP-Block in NSX Policy UI.
2. Recreate the same IP-Block in NSX Policy UI.
This will trigger NSX to realize the missing MP object for the IP block.