Unable to remove secondary network specification from external network in VMware Cloud Director
book
Article ID: 385952
calendar_today
Updated On:
Products
VMware Cloud Director
Issue/Introduction
Deleting the secondary network specification on an external network is not removing it successfully.
The entry is re-populated in the UI after the deletion.
As per the UI, the entry is showing 0 usage.
Environment
VMware Cloud Director 10.5.x
Cause
This is due to vApp(s) networks referencing to the secondary network specification preventing a successful removal.
Resolution
To resolve the issue, vApp networks still connected to the external network needs to be identified and removed.
For tenants using the external network and with a small number of vApps, verify the vApp is not connected to the external network. If a network exists which references the external network specification, delete that network from the vApp.
To identify the vApp(s) referencing the secondary network specification, follow the steps below:
SSH to VCD cell.
To get network specification details, run the following query:
select logical_network.id, logical_network.name, logical_network.scope_type, logical_network.ip_scope_id, ip_scope.id, ip_scope.gateway, ip_scope.subnet_prefix_length from logical_network left join logical_network_ip_scope lnis on lnis.logical_network_id = logical_network.id left join ip_scope on ip_scope.id = lnis.scope_id where logical_network.id in ( select id from logical_network where scope_type='1' and name like '%name of the external network%' ) order by logical_network.scope_type;
Note the entry with the gateway value referencing the secondary network specification.
Using the ip_scope_id value noted in the entry as per Step 3, run the following query to get the vApp details:
select * from vm_container where sg_id in (select scope_id from logical_network where ip_scope_id='ip_scope_id from Step 3' and scope_type='3');