Deleting an Organization VDC network fails with error: "Network <Network_Name> cannot be deleted, because it is used by the following vApp Networks: <vApp_Network_Name>" in VMware Cloud Director
search cancel

Deleting an Organization VDC network fails with error: "Network <Network_Name> cannot be deleted, because it is used by the following vApp Networks: <vApp_Network_Name>" in VMware Cloud Director

book

Article ID: 421888

calendar_today

Updated On:

Products

VMware Cloud Director VMware vSphere ESXi

Issue/Introduction

Organization VDC (Org VDC) network deletion fails with the error: "Network cannot be deleted, because it is in use by the following vApp Networks: ". This error occurs when stale network dependencies remain in the database, even if no deployed vApps are currently using the network.

Symptoms

  • Organization VDC network deletion fails.
  • Error message: "Network cannot be deleted, because it is in use by the following vApp Networks: "
  • Error message: "ConstraintViolationException: could not delete: [LogicalNetworkModel]"

 

Environment

VMware Cloud Director 10.x

Cause

This issue is caused by a vApp template residing in a Catalog that is still referencing the target vApp network.

Although there are no deployed vApp instances, the template retains the network configuration dependency, which blocks the deletion of the network.

Resolution

  1. UI Verification

    1. Log in to the Cloud Director UI as an Administrator.
    2. Navigate to Content Hub > Catalogs and review all vApp Templates to see if any templates reference the target network.
    3. Clear the "Expired: No" filter in the vApps view to expose any hidden, expired vApps that may still be attached to the network.
    4. Navigate to the Edge Gateway associated with the Org VDC network. Edit the network properties and ensure the "Connect to an edge gateway" toggle is deselected.
  2. API Identification If UI checks do not identify the dependency, use the Cloud Director API to identify the specific linked vApp network: GET /api/query?type=vAppNetwork&format=records&filter=linkNetworkName==<NetworkName> The vAppName field in the response identifies the template or vApp causing the dependency.

  3. Database Remediation Warning: Take a full database backup before executing any database queries. If stale database records remain, contact Broadcom Support to identify and remove entries from the logical_network, gateway_interface, and tenant_network_logical_resource tables. To speak with a customer representative, see Contact Broadcom Support.