Why Can't I Delete My VPCs and Subnets?
VPCs and subnets are free of charge.
If your VPCs and subnets cannot be deleted, submit a service ticket.
Deleting Subnets
You can refer to Table 1 to delete subnets.
Prompts |
Cause |
Solution |
---|---|---|
You do not have permission to perform this operation. |
Your account does not have permissions to delete subnets. |
Contact the account administrator to grant permissions to your account and then delete the subnet. |
Delete custom routes from the associated route table of the subnet and then delete the subnet. |
The route table has custom routes with the following as the next hop type:
|
Delete the custom routes from the route table and then delete the subnet.
|
Release any virtual IP addresses configured in the subnet and then delete the subnet. |
The subnet has virtual IP addresses configured. |
Release the virtual IP addresses from the subnet and then delete the subnet. |
Release any private IP addresses configured in the subnet and then delete the subnet. |
The subnet has virtual IP addresses that are not used by any instance. |
On the IP Addresses tab, release these private IP addresses that are not required and then delete the subnet.
|
Delete the resource (ECS or load balancer) that is using the subnet and then delete the subnet. |
The subnet is being used by an ECS or a load balancer. |
Delete the ECS or load balancer and then delete the subnet. |
Delete the load balancer that is using the subnet and then delete the subnet. |
The subnet is being used by a load balancer. |
Delete the load balancer and then delete the subnet. |
Delete the NAT gateway that is using the subnet and then delete the subnet. |
The subnet is being used by a NAT gateway. |
Delete the NAT gateway and then delete the subnet. |
Delete the resource that is using the subnet and then delete the subnet. |
The subnet is being used by cloud resources. |
On the IP Addresses tab, view the usage of the IP address, find the resource that is using the IP address, delete the resource, and delete the subnet.
|
Deleting VPCs
Before deleting a VPC, ensure that all subnets in the VPC have been deleted. You can refer to Table 2 to delete VPCs.
Prompts |
Cause |
Solution |
---|---|---|
You do not have permission to perform this operation. |
Your account does not have permissions to delete VPCs. |
Contact the account administrator to grant permissions to your account and then delete the VPC. |
Delete the VPC endpoint service or the route configured for the service from the VPC route table and then delete the VPC. |
The VPC route table has custom routes. |
Delete the custom routes and then delete the VPC.
|
The VPC is being used by a VPC endpoint service. |
Search for the VPC endpoint service on the VPC endpoint service console and delete it. |
|
This VPC cannot be deleted because it has associated resources. |
The VPC is being used by the following resources:
|
Click the resource name hyperlink as prompted to delete the resource. |
Delete the virtual gateway that is using the VPC and then delete the VPC. |
The VPC is being used by a Direct Connect virtual gateway. |
On the Direct Connect console, locate the virtual gateway and delete it. |
Delete the VPN gateway that is using the VPC and then delete the VPC. |
The VPC is being used by a VPN gateway. |
On the VPN console, locate the VPN gateway and delete it. |
Remove the VPC from the cloud connection and then delete the VPC. |
The VPC is being used by a Cloud Connect connection. |
On the Cloud Connect console, locate the connection and remove the VPC from it. |
Delete all custom security groups in this region and then delete this last VPC. |
In the current region, this is the last VPC and there are custom security groups.
NOTICE:
You only need to delete the custom security groups. The default security group does not affect the deletion of VPCs. |
Delete all custom security groups and then delete the VPC. |
Release all EIPs in this region and then delete this last VPC. |
In the current region, this is the last VPC and there are EIPs. |
Release all EIPs in this region and then delete this last VPC. |
Searching for Cloud Resources
- Log in to the management console.
- In the upper right corner of the console, choose More > Resources > My Resources.
The My Resources page is displayed.
Figure 1 My Resources
- On the My Resources page, set search criteria to quickly find the resources in the subnet.
- Service: Select a service that has resources in subnets.
Table 3 lists some common resources. If you have other resources, check them.
- Resource Type: Check the types of resources.
- Region: Select the region where the VPC and subnet are located to filter resources in the same region. VPCs and subnets can be used only by resources from their same region.
Table 3 Common resources in subnets Product Category
Service
Compute
Elastic Cloud Server (ECS)
Bare Metal Server (BMS)
Cloud Container Engine (CCE)
Cloud Container Instance (CCI)
Containers
Application Service Mesh (ASM)
Networking
Elastic Load Balance (ELB)
NAT Gateway
VPC Endpoint (VPCEP)
Databases
GaussDB
Relational Database Service (RDS)
Document Database Service (DDS)
GaussDB NoSQL
Distributed Database Middleware (DDM)
Applications
Distributed Cache Service (DCS)- Redis instance
- Memcached instance
Distributed Message Service (DMS)- Kafka instance
- RabbitMQ instance
EI
MapReduce Service (MRS)
Data Warehouse Service (DWS)
Cloud Search Service (CSS)
- Service: Select a service that has resources in subnets.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.