Error: "Could not connect to vSphere for Kubernetes infrastructure" when creating an Edge Gateway
search cancel

Error: "Could not connect to vSphere for Kubernetes infrastructure" when creating an Edge Gateway

book

Article ID: 389932

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • The Edge Gateway creation fails with the error below:

    Could not connect to vSphere for Kubernetes infrastructure
  • vSphere with Tanzu in VMware Cloud Director, is not used anymore and there is no provider VDC backed by a Supervisor Cluster.
  • In /opt/vmware/vcloud*director/logs/vcloud-container-debug.log the entry below can be seen:

    2025-02-11 11:31:51,611 | ERROR    | Backend-activity-pool-373479 | FutureUtil                     | Provision of WCP firewall policy failed for VDC  | requestId=########-####-####-########80e7,request=POST https://vcloud.example.com/cloudapi/1.0.0/edgeGateways/,requestTime=1739273505195,remoteAddress=##.##.##.##:13804,userAgent=PostmanRuntime/7.29.2,accept=application/json;version 39.0.0-alpha;multisite ########-####-####-########3162aa@3e7########-####-####-########1c53 vcd=########-####-####-########1382,task=########-####-####-########833d activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:########-####-####-########833d) activity=(com.vmware.vcloud.networking.services.handlerproxy.activity.edges.EdgeGatewayActivity,urn:uuid:########-####-####-########11bf) activity=(com.vmware.ssdc.backend.wcp.RefreshTkgClustersNetworkIsolation,urn:uuid:########-####-####-########11bf) activity=(com.vmware.ssdc.backend.wcp.RefreshTkgClustersNetworkIsolationForVdcs,urn:uuid:########-####-####-########a2ed)com.vmware.ssdc.backend.wcp.WcpConnectionPoolException: Cloud Director cannot reach vSphere for Kubernetes, reason message: Could not connect to vSphere for Kubernetes infrastructure.

Environment

VMware Cloud Director 10.5.x

Cause

One of the Organization VDC is still using the Kubernetes policy

Resolution

Remove the Kubernetes policy on the Org VDC to ensure that the operation to refresh the TKG clusters is not triggered. 

  1. SSH the VMware Cloud Director (VCD) primary cell
  2. Connect to the database running the command below:

    sudo -i -u postgres psql vcloud

  3. Execute the below SQL query and check if there are VDCs with Kubernetes policy:

    select * from org_prov_vdc where id in (select vdc_id from vdc_logical_resource where fo_id in (select id from vdc_compute_policy where policy_type='VdcKubernetesPolicy'));

  4. Remove the Kubernetes policy on the Org VDC , returned in the step 3.