...
Attempting to add an Edge Gateway to a Data Center Group in the Cloud Director Tenant UI fails with an error: could not initialize proxy - no Session The /opt/vmware/vcloud-director/logs/vcloud-container-debug.log on the Cloud Director Cells shows errors of the form: | ERROR | pool-jetty-56 | LazyInitializationException | could not initialize proxy - no Session | requestId=<REQUEST_UUID>,request=PUT https://vcloud.example.com/cloudapi/1.0.0/edgeGateways/urn:vcloud:gateway:<GATEWAY_UUID>,requestTime=1661940488690,remoteAddress=10.10.10.10:51655,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/json;version 38.0.0-alphaorg.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:86) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190) at com.vmware.vcloud.common.model.net.LogicalNetworkModel_$$_jvst457_8f.setScopeType(LogicalNetworkModel_$$_jvst457_8f.java) at com.vmware.vcloud.networking.dao.VdcGroupNetworkDao.lambda$updateOwnerOfRoutedNetworksForEdge$0(VdcGroupNetworkDao.java:473) at com.vmware.vcloud.networking.dao.VdcGroupNetworkDao.updateOwnerOfRoutedNetworksInBatch(VdcGroupNetworkDao.java:504) at com.vmware.vcloud.networking.dao.VdcGroupNetworkDao.updateOwnerOfRoutedNetworksForEdge(VdcGroupNetworkDao.java:470) at com.vmware.vcloud.networking.dao.VdcGroupNetworkDao$$FastClassBySpringCGLIB$$6009dc42.invoke(<generated>) The Edge Gateway that cannot be added has 31 or more Organization VDC Networks attached to it.Edge Gateways with 30 or less Organization VDC Networks attached can be added without issue.
This issue occurs when the Edge Gateway has 31 or more Organization VDC Networks attached.
This is a known issue affecting VMware Cloud Director.
To workaround the issue limit the number of Organization VDC Networks attached to the Edge Gateway to 30 or less when adding it to a Data Center Group. Alternatively if the Edge Gateway must have 31 or more networks when adding it to a Data Center Group, a configuration value in the Cloud Director database can be temporarily increased using the steps below.Before making changes take a backup of the Cloud Director database. For Appliance Cells the steps are outlined in the documentation here, Backup and Restore of VMware Cloud Director Appliance. SSH to the Primary Node in an Appliance Cell cluster or to the external PostgreSQL server in a Linux Cell setup.Log into the Cloud Director database using PSQL, for a Primary Appliance Cell use the following command: sudo -u postgres psql vcloud Confirm that no hibernate.jdbc.batch_size value is currently set by checking that 0 rows are returned by the following queries: select * from config where name='hibernate.jdbc.batch_size';select * from config where config_id = '8123789'; Temporarily increase the hibernate.jdbc.batch_size to 500 to allow the Edge Gateway to be added successfully: insert into config (config_id, cat, name, value) values ('8123789','vcloud', 'hibernate.jdbc.batch_size', '500'); Verify it is inserted successfully: select * from config where name='hibernate.jdbc.batch_size'; Logout from the Cloud Director UI and wait 10 mins for the configuration change to apply.Login to the Cloud Director UI and perform the operation of adding the Edge Gateway to the Data Center Group.After completing the task of adding the Edge Gateway remove the configuration change to revert Cloud Director to the default value: delete from config where config_id='8123789'; Verify it has been deleted from the database by checking that 0 rows are returned by the following queries: select * from config where name='hibernate.jdbc.batch_size';select * from config where config_id = '8123789';