Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Virtual Private Cloud/ FAQs/ VPCs and Subnets/ Why Can't I Delete My VPCs and Subnets?

Why Can't I Delete My VPCs and Subnets?

Updated on 2025-01-24 GMT+08:00
If VPCs and subnets are being used by other resources, you need to delete these resources first before deleting the VPCs and subnets. This topic provides the prompts and the actions you need to take to delete the VPCs and subnets.
NOTICE:

The VPC service has multiple resources. Some are free, while some are not. For details about VPC resource pricing, see Pricing Details.

If your VPCs and subnets cannot be deleted, submit a service ticket.

Deleting Subnets

You can refer to Table 1 to delete subnets.

Table 1 Deleting a subnet

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.

Permissions Management

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:
  • Server
  • Extension NIC
  • Virtual IP address
  • NAT gateway
Delete the custom routes from the route table and then delete the subnet.
  1. View the route table associated with the subnet.
  2. Delete the routes.

Release the virtual IP addresses in the subnet and then delete the subnet.

The subnet has virtual IP addresses.

Release the virtual IP addresses from the subnet and then delete the subnet.

Releasing a Virtual IP Address

Release the private IP addresses in the subnet and then delete the subnet.

The subnet has virtual IP addresses but these IP addresses 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.

  1. View IP addresses in the subnet.
  2. In the private IP address list, locate the IP address that is not being used and click Release in the Operation column.
    NOTICE:

    If you want to release an in-use private IP address, you need to delete the resource that uses the IP address first.

Delete the compute resources that are 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.

Viewing and Deleting Resources in a 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.

Viewing and Deleting Resources in a 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.

Viewing and Deleting Resources in a 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.

  1. View IP addresses in the subnet.
  2. Locate the resources that are using the IP addresses by referring to Searching for Cloud Resources.
  3. Delete the resources and then 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.

Table 2 Deleting a VPC

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.

Permissions Management

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.

  1. In the VPC list, locate the row that contains the VPC and click the number in the Route Tables column.

    The route table list is displayed.

  2. Delete the routes.

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.

Deleting a VPC Endpoint Service

This VPC has VPC endpoint services configured. Delete the services first.

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.

Deleting a VPC Endpoint Service

This VPC cannot be deleted because it has associated resources.

The VPC is being used by the one of the following resources:

  • Subnet
  • VPC peering connection
  • Custom route table

Click the resource name and then 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.

Deleting a Virtual Gateway

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.

Deleting a VPN Gateway

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.

Removing a Network Instance

Delete all custom security groups in this region and then delete this last VPC.

This is the last VPC in this region and there are custom security groups in this VPC.

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.

Deleting a Security Group

Release all EIPs in this region and then delete this last VPC.

This is the last VPC in this region and there are EIPs in this VPC.

Release all EIPs and then delete this VPC.

Releasing an EIP

Searching for Cloud Resources

  1. Log in to the management console.
  2. In the upper right corner of the console, choose Resources > My Resources.
    The My Resources page is displayed.
    Figure 1 My Resources
  3. On the My Resources page, set search criteria to quickly find the resources in the subnet.
    • Service: Select a service that has resources in the subnet.

      Table 3 lists the common resources. If you have other resources, check if they are working in the subnet.

    • Resource Type: Check the resource type.
    • Region: Select the region where the VPC and subnet are located to filter resources. VPCs and subnets can be used only by resources in the 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)

      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)

    If you cannot delete a subnet even after deleting all the resources in it, submit a service ticket.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback