"Existing subnets cannot be deleted. Subnet x.x.x.x cannot be deleted" error when creating a new VM in an existing vApp
search cancel

"Existing subnets cannot be deleted. Subnet x.x.x.x cannot be deleted" error when creating a new VM in an existing vApp

book

Article ID: 325534

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:
  • When creating a new VM in an existing vApp, we receive the following error:
Existing subnets cannot be deleted. Subnet x.x.x.x cannot be deleted
  • In the /opt/vmware/vcloud-director/logs/vcloud-container-debug.log, we see entries similar to:
com.vmware.vcloud.api.presentation.service.BadRequestException: Existing subnets cannot be deleted. Subnet x.x.x.x cannot be deleted.
        at com.vmware.vcloud.net.NetworkUtil.validateSubnetConfig(NetworkUtil.java:1206)
        at com.vmware.vcloud.dl.net.vappnetwork.impl.VAppNetworkManagerImpl.update(VAppNetworkManagerImpl.java:652)
        at com.vmware.ssdc.backend.services.impl.VAppManagerImpl.updateNetworksInt(VAppManagerImpl.java:2083)
        at com.vmware.ssdc.backend.services.impl.VAppManagerImpl.saveNetworks(VAppManagerImpl.java:2120)
        at com.vmware.ssdc.backend.services.impl.VAppManagerImpl.saveVAppSpec(VAppManagerImpl.java:968)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)


Environment

VMware Cloud Director 10.x

Cause

This is a known issue affecting some branches of Cloud Director 9.5.x, 9.7.x and 10.x.
This issue occurs when there are multiple subnets available on the network that the vApp is attached to.
Cloud Director is only accounting for a single subnet during the transaction.
There is then a validation where the gateway value is checked against that of the entry, which will always return an error.

Resolution

This issue is resolved in Cloud Director 10.1, 10.0.0.2 and 9.7.0.5, available at VMware Downloads.