Hello!
Our team encountered these errors while deleting our old networks.
1. The network resource 'projects/XXXX/global/networks/redis-vpc' is already being used by 'projects/XXXX/global/networkInstances/v1374312030-930de956-74a7-4c70-86c6-5571b4f7a7e2'
2. The network resource 'projects/YYYY/global/networks/redis-vpc' is already being used by 'projects/YYYY/global/networkInstances/v-490031166-74127914-382f-4f3f-bb1f-be1bb1f1572c
3. The network resource 'projects/ZZZZ/global/networks/redis-vpc' is already being used by 'projects/ZZZZ/global/networkInstances/v-545024341-abb83a47-73cf-4eae-9166-c7e181216d64'
On three different projects.
These networks are empty; they don't have subnetworks, VPC connectors, routes, IP addresses, routers, or firewall rules.
We also deleted all the App Engine instances, Cloud Run revisions, Cloud functions, and Compute Engine VMs that used resources from these networks.
But we're still getting these errors. And we don't have any idea about what that might be using these networks.
Could you please help with advice on how we can find and remove these mystical "network interfaces"?
Thanks!
Hi @Alexander_V
I would recommend the following action plan:
(1) List the compute instances
gcloud compute instances list --filter="networkInterfaces.network:projects/XXXX/global/networks/redis-vpc"
(2) List GKE Clusters
gcloud compute instances list --filter="networkInterfaces.network:projects/XXXX/global/networks/redis-vpc"
(3) List VPC Peering Connections
gcloud compute networks peerings list --network=redis-vpc
(4) List Internal Load Balancers
gcloud compute forwarding-rules list --filter="network:projects/XXXX/global/networks/redis-vpc"
(5) Delete the GKE Cluster
First, identify your cluster name and location, then delete it:
gcloud container clusters delete [CLUSTER_NAME] --zone [ZONE]
(6) Delete Load Balancer Backend Services:
If you've identified backend services through forwarding rules, delete them as follows:
gcloud compute backend-services delete [BACKEND_SERVICE_NAME] --global
(7) Delete VPC Peering
If peering connections were found, delete them:
gcloud compute networks peerings delete [PEERING_NAME] --network=redis-vpc
(8) Delete the network
After ensuring all dependencies are removed, you can attempt to delete the network again:
gcloud compute networks delete redis-vpc --project=XXXX
(9) Check Cloud Logging Activities
gcloud logging read "resource.type=gce_network AND logName=projects/XXXX/logs/cloudaudit.googleapis.com%2Factivity AND protoPayload.methodName=compute.networks.delete AND protoPayload.resourceName:projects/XXXX/global/networks/redis-vpc" --limit 10 --format "table(timestamp, protoPayload.methodName, protoPayload.resourceName, protoPayload.status)"
I hope that helps
Regards
Mahmoud
Thanks for your comment! I appreciate it.
Unfortunately, the provided plan didn't help.
There are no compute instances with this network (got "Listed 0 items" response from your command);
There have never been and are no GKE clusters in this project;
There is also no Load Balancers and backends for them here;
There is no VPC peering either;
And deleting the network still fails with the same error.