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