I had a working HCX setup in my lab, and I was making some modifications to my setup and tried chopping off my interconnect networking configuration on the HCX Cloud side. Deletion of the interconnect configuration was failing for me with the below error
Let me first explain how I landed in this situation.
I deleted the interconnect appliances from my on-prem to show a demo to my peers on how the interconnects are deployed via the HCX plugin in the vSphere webclient. During the demo, I did not notice that the site pairing between my on-prem HCX and cloud side HCX was broken (due to a vCenter upgrade on the cloud side, a cert mismatch issue occurred).
When I kicked the CGW appliance removal, the backing VM got deleted, and the appliance configuration disappeared from on-prem. But when I checked on the cloud side, the peer CGW appliance and the Mobility Agent host were still intact.
That is when I discovered that communication between the two sites was broken. Since cloud-side CGW appliances are automatically deleted when the deletion is called from on-prem, I couldn’t find any option in the HCX Cloud UI to delete the same.
Frustrated by this, I deleted the mobility agent host and CGW manually from the cloud side vCenter. However, the interconnect configuration was still intact in the HCX Cloud UI. Since this is a lab setup, I could not open SR with VMware, and hence I decided to do some R&D on this, and finally, I was able to fix the issue.
Disclaimer: The below resolution is not supported by VMware, and it is an outcome of R&D in the lab setup. Don’t perform these steps in your production without engaging VMware support.
HCX configuration data is saved in MongoDB, and since UI was not helping me, I jumped into DB and examined a few tables.
1: Connect to HCX DB: Connect to HCX appliance over putty and run command: mongo hybridity
2: List tables: To list the tables in the database, run the command: show collections
This command gives you a long list of tables. The important tables related to interconnect configuration are:
- FleetAppliance
- FleetConfigIP
- FleetConfig
- VirtualNetwork
I found details of the offending IP in the above tables. To examine the contents of a table in Mongo, you need to run the command: db.<table-name>.find().pretty()
Examples are shown below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
> db.FleetAppliance.find().pretty() { "_id" : ObjectId("5c89cb01f88682f6bdcd8925"), "applianceId" : "6f62c6f5-ef5c-4c02-b9c4-1599c4b2723e", "applianceType" : "GATEWAY", "deployConfig" : { "fleetvWireId" : "network-35b29a25-32ed-4180-8599-dbd87c43dfd0", "fleetNetworkName" : "hcx-2be6b832-15ea-4e0d-8c14-c8aac47b32fc", "fleetNetwork" : "dvportgroup-364", "cloudEndPoint" : "https://hcx-cloud.ionoinc.local", "resourceId" : "8fcba8ce-1896-448b-b52c-6d7253433613", "resourceName" : "https://comp01vc01.ionoinc.local", "siteId" : "20190314022601382-932827f8-4419-495b-84be-a4bc42cef270", "endpointId" : "20190314022601382-932827f8-4419-495b-84be-a4bc42cef270", "endpointName" : "hcx-cloud", "endpointType" : "VC", "resourceType" : "VC", "applianceName" : "CGW-OnPrem-peer", "isvMotionEnabled" : false, "allocatedIpAddresses" : { "ipampool-e8d9569c-dd68-42fa-b190-91127610ba1b" : "172.16.31.101/24", "ipampool-511e8c0f-584e-41c5-ae94-02c51ea42975" : "172.16.32.101/24", "ipampool-81c73f0b-083b-46f2-a61b-c208f834f7a2" : "172.16.31.104/24" }, "templateOvfFolder" : "/common/appliances/vcc/3.5.0", "managerCertPath" : "/common/cs/manager.pem", "vCenterInstanceUuid" : "8fcba8ce-1896-448b-b52c-6d7253433613", "datastore" : "datastore-283", "compute" : "resgroup-363", "vcUrl" : "https://comp01vc01.ionoinc.local", "computeType" : "ResourcePool", "networks" : { "mgmtNetwork" : { "network" : "dvportgroup-19", "connected" : true, "ip" : "172.16.31.101/24", "gateway" : "172.16.31.253" }, "vmotionNetwork" : { "network" : "dvportgroup-30", "connected" : true, "ip" : "172.16.32.101/24", "gateway" : "172.16.32.253" }, |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
> db.FleetConfigIP.find().pretty() { "_id" : ObjectId("5c89cae3f88682f6bdcd891f"), "ip" : "172.16.31.101", "poolId" : "ipampool-115c435a-5c24-4f65-84c2-22cfd82a138f", "resourceId" : "ipamresource-068e0fce-ec32-4917-909a-fa501071b3c3", "provider" : "HCX", "lastUpdated" : ISODate("2019-04-06T02:49:24.001Z"), "lastUpdateEnterprise" : "HybridityAdmin", "lastUpdateOrganization" : "HybridityAdmin", "lastUpdateUser" : "HybridityAdmin", "creationDate" : ISODate("2019-03-14T03:30:43.554Z"), "creationEnterprise" : "HybridityAdmin", "creationOrganization" : "HybridityAdmin", "creationUser" : "HybridityAdmin", "isDeleted" : false } { "_id" : ObjectId("5c89cae4f88682f6bdcd8921"), "ip" : "172.16.32.101", "poolId" : "ipampool-4ae82385-64da-43f4-a81a-cd87dfa70d06", "resourceId" : "ipamresource-55c00bf2-254b-4b18-8dcb-c742f7546837", "provider" : "HCX", "lastUpdated" : ISODate("2019-04-06T02:49:23.990Z"), "lastUpdateEnterprise" : "HybridityAdmin", "lastUpdateOrganization" : "HybridityAdmin", "lastUpdateUser" : "HybridityAdmin", "creationDate" : ISODate("2019-03-14T03:30:44.577Z"), "creationEnterprise" : "HybridityAdmin", "creationOrganization" : "HybridityAdmin", "creationUser" : "HybridityAdmin", "isDeleted" : false } { "_id" : ObjectId("5c89cae5f88682f6bdcd8923"), "ip" : "172.16.31.104", "poolId" : "ipampool-115c435a-5c24-4f65-84c2-22cfd82a138f", "resourceId" : "ipamresource-5b4fa5b1-aff9-428f-880a-8553311434df", "provider" : "HCX", "lastUpdated" : ISODate("2019-04-06T02:49:24.003Z"), "lastUpdateEnterprise" : "HybridityAdmin", "lastUpdateOrganization" : "HybridityAdmin", "lastUpdateUser" : "HybridityAdmin", "creationDate" : ISODate("2019-03-14T03:30:45.590Z"), "creationEnterprise" : "HybridityAdmin", "creationOrganization" : "HybridityAdmin", "creationUser" : "HybridityAdmin", "isDeleted" : false } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
> db.VirtualNetwork.find().pretty() { "_id" : ObjectId("5ca80fbae0f5831278d27159"), "nsp" : { "objectId" : "network-d0e5bb26-176d-4f25-a0d4-c163a74b1941", "state" : "ERROR", "name" : "Mgmt-NW", "description" : "", "ownedBySystem" : true, "l3TenantManaged" : true, "allowTrunkInterfaces" : false, "mtu" : 1500, "backings" : [ { "backingId" : "dvportgroup-19", "backingName" : "Mgmt-NW_VLAN1631", "type" : "DistributedVirtualPortgroup", "vCenterInstanceUuid" : "8fcba8ce-1896-448b-b52c-6d7253433613", "vCenterName" : "comp01vc01.ionoinc.local", "distributedVirtualSwitch" : { "type" : "VmwareDistributedVirtualSwitch", "serverGuid" : "8fcba8ce-1896-448b-b52c-6d7253433613", "value" : "dvs-17", "name" : "vDS-Compute" } } ], "jobDetails" : { "lastJobId" : "0028dd24-d28a-42f1-9652-6d1767b8d02a", "lastJobType" : "NETWORK_UPDATE", "error" : true, "errorMessage" : "Cannot find entity ipampool-115c435a-5c24-4f65-84c2-22cfd82a138f" }, "ipScopes" : [ { "networkIpRanges" : [ { "startAddress" : "172.16.31.101", "endAddress" : "172.16.31.106" }, { "startAddress" : "172.16.31.110", "endAddress" : "172.16.31.115" } ], "dnsSuffix" : "ionoinc.local", "gateway" : "172.16.31.253", "prefixLength" : 24, "primaryDns" : "172.16.11.5", "secondaryDns" : "172.16.11.6", "poolId" : "ipampool-115c435a-5c24-4f65-84c2-22cfd82a138f" } ], "ipScopesConfig" : [ { "source" : "LOCAL" } ] }, "lastUpdated" : ISODate("2019-04-06T04:18:06.925Z"), "enterprise" : "DEFAULT", "organization" : "DEFAULT", "lastUpdateEnterprise" : "HybridityAdmin", "lastUpdateOrganization" : "HybridityAdmin", "lastUpdateUser" : "Administrator@VSPHERE.LOCAL", "creationDate" : ISODate("2019-04-06T02:32:26.107Z"), "creationEnterprise" : "DEFAULT", "creationOrganization" : "DEFAULT", "creationUser" : "Administrator@VSPHERE.LOCAL", "isDeleted" : false } { "_id" : ObjectId("5ca811bbe0f5831278d27165"), "nsp" : { "objectId" : "network-2b6a51bc-8716-4de0-ac64-64300fe12cdc", "state" : "REALIZED", "name" : "vMotion_NW", "description" : "", "ownedBySystem" : true, "l3TenantManaged" : false, "allowTrunkInterfaces" : false, "mtu" : 1500, "backings" : [ { "backingId" : "dvportgroup-30", "backingName" : "vMotion_NW_VLAN1632", "type" : "DistributedVirtualPortgroup", "vCenterInstanceUuid" : "8fcba8ce-1896-448b-b52c-6d7253433613" } ], "jobDetails" : { "lastJobId" : "b4c7edba-2868-4bd5-8c33-cd5415c7baab", "lastJobType" : "NETWORK_UPDATE", "error" : false }, "ipScopes" : [ { "networkIpRanges" : [ { "startAddress" : "172.16.32.101", "endAddress" : "172.16.32.103" }, { "startAddress" : "172.16.32.110", "endAddress" : "172.16.32.112" } ], "gateway" : "172.16.32.253", "prefixLength" : 24, "poolId" : "ipampool-4ae82385-64da-43f4-a81a-cd87dfa70d06" } ], "ipScopesConfig" : [ { "source" : "LOCAL" } ] }, "lastUpdated" : ISODate("2019-04-06T02:49:23.570Z"), "enterprise" : "DEFAULT", "organization" : "DEFAULT", "lastUpdateEnterprise" : "HybridityAdmin", "lastUpdateOrganization" : "HybridityAdmin", "lastUpdateUser" : "HybridityAdmin", "creationDate" : ISODate("2019-04-06T02:40:59.424Z"), "creationEnterprise" : "DEFAULT", "creationOrganization" : "DEFAULT", "creationUser" : "Administrator@VSPHERE.LOCAL", "isDeleted" : false } |
Once I verified the details in the above table, I dropped them using the below commands
> db.FleetConfig.drop ()
> db.FleetConfigIP.drop ()
> db.FleetAppliance.drop()
> db.VirtualNetwork.drop()
After dropping these tables, I refreshed the HCX Cloud UI, and the stubborn interconnect configuration disappeared from there.
I hope you find this post informative. Feel free to share it on social media if it is worth sharing.