Problem – When attempting to delete a subnet on OCI (Oracle Cloud infrastructure) you receive an error stating – you cannot delete the subnet because the subnet contains things. You look and find no things left to delete and become angry + sad face. No matter how hard you search you cannot find the OCID (Oracle Cloud Identifier) for VNIC in the console or with an API search.
The Subnet ocid1.subnet.oc1.uk-london-1.aaaaaaaa2cnu4uzuoyo2da5rtcwzvfmq[oieqwoeriyqwepqwoiyerquwea references the VNIC ocid1.vnic.oc1.uk-london-1.abwgiljtem4ancbmasf9s8d7f7s987f9ssds. You must remove the reference to proceed with this operation.
Solution – The most common cause is an orphaned Mount target that needs to be deleted. A mount target is an NFS (Network File System) Endpoint that lives in a subnet and provides network access for the file system exports. Each mount target has a VNIC to enable network access. Mount target VNICs are not deleted when you clean up exports or mount targets and have to be manually deleted.
See the following for official Oracle directions covering the process to delete an Orphaned Mount Target – https://docs.cloud.oracle.com/iaas/Content/File/Troubleshooting/orphanedmounttarget.htm
Everything is better with a picture – Picture of me working
2 thoughts on “Cannot Delete Subnet – Oracle”
Hi
I do not have any Mount Targets but I still can’t terminate my VCN because of a reference problem to a VNIC.
Any idea what the problem is?
Henry
Another odd one I’ve seen. When you move and object to another compartment it will move the VNIC to the other compartment but the vnic will stay associated subnet. What you have to delete could be a different compartment