Error: "Network ... cannot be deleted, because it is in use..." when deleting Organization VDC networks
search cancel

Error: "Network ... cannot be deleted, because it is in use..." when deleting Organization VDC networks

book

Article ID: 310900

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • You are unable to remove Organization VDC networks from an Organization VDC (Org VDC/OVDC).
  • Attempting to delete Organization VDC networks from the VMware Cloud Director (VCD) UI fails, and you see a message similar to:

    Error: [ ########-####-####-####-############ ] Network <Org VDC network name> cannot be deleted, because it is in use by the following vApp Networks: <vApp network name>.

  • The connected vApp Network belongs to a deleted vApp that is blocking the deletion of the Organization VDC network.

Environment

VMware Cloud Director 10.x

Cause

This Issue may occur if the vAPP is deleted without removing the vAPP networks first and the Organization VDC Network has still references to the attached vAPP networks.

Resolution

Ensure all vApp Networks are disconnected from the Organization VDC network before attempting a delete.
Both vApps and vApp Template networks can be connected to the Organization VDC network and block the deletion.

NOTE: The IP Usage tab of the Org VDC network may not show any vApp VMs if DHCP is select for their IP assignment.
Please also Clear the "Expired: No" filter when viewing the vApps and vApp Templates in the Cloud Director UI as the connected vApps or vApp Templates may not be visible if they have expired their Storage Lease.

If the vApps or vApp Templates cannot be identified, the Cloud Director API can be used to retrieve a list of the Org VDC network's connected vApp networks.
From the list of returned vApp networks the names of the vApps and vApp Templates can be found.
Example steps would be as follows:

  1. Log into the Cloud Director API as a System Administrator to retrieve an Authorization token as per the KB here:

    How to establish an API connection VMware Cloud Director

  2. Construct the API call to query the transfer folder metrics:

    Request
    GET https://<VCD_URL>/api/query?type=vAppNetwork&type=vAppNetwork&format=records&filter=linkNetworkName==<ORGVDC_NETWORK_NAME>

    Request Headers
    "Authorization: Bearer ####"
    "Accept: application/*+json;version=<VCD_API_VERSION>"
    "X-VMWARE-VCLOUD-AUTH-CONTEXT: <ORG_NAME>"
    "X-VMWARE-VCLOUD-TENANT-CONTEXT: <ORG_UUID>"

  3. Make the API request using an API client, for example with Curl:

    curl -k -X GET "https://<VCD_URL>/api/query?type=vAppNetwork&type=vAppNetwork&format=records&filter=linkNetworkName==<ORGVDC_NETWORK_NAME>" -H "Authorization: Bearer ####" -H "Accept: application/*+json;version=<VCD_API_VERSION>" -H "X-VMWARE-VCLOUD-AUTH-CONTEXT: <ORG_NAME>" -H "X-VMWARE-VCLOUD-TENANT-CONTEXT: <ORG_UUID>"

  4. The expected response is 200 OK and a list of "QueryResultVAppNetworkRecordType" should be returned. The "vAppName" values in these returned records correspond to the names of the connected vApps and vApp Templates:

"vAppName": "<VAPP_NAME>"

If you have removed all vApp Networks and still encounter this issue contact Broadcom Support and note this Article ID (310900) in the problem description. For more information, see Creating and managing Broadcom support cases.