keepcalculator

06 Numbers and Powers

Verify Oracle Cloud Sandbox Is Gone: Steps

Card No. 06·48776 · Updated · Standard formula, shown below

To verify an Oracle Cloud sandbox is gone, sign in to the Oracle Cloud Infrastructure (OCI) console, navigate to the compartment where the sandbox was created, and confirm that all associated resources (compute instances, VCNs, block volumes, object storage buckets, etc.) are terminated and no longer appear in the resource lists. Additionally, check the OCI Audit log for termination events and, if you used a free trial or Always Free tier, confirm that no active resources remain that would incur charges.

Background: Why Sandbox Cleanup Matters

Oracle Cloud sandboxes are typically temporary environments used for testing, development, or learning. They may include virtual machines, databases, networking components, and storage. When you delete a sandbox, you expect all its resources to be removed. However, due to dependencies or manual creation of resources outside a defined stack, some components can linger. Failing to verify complete removal can lead to unexpected costs, security risks, or quota consumption, especially on Always Free tier accounts where certain resources are limited.

How to Verify in the OCI Console

The most direct method is to use the OCI Console web interface. Follow these steps:

  1. Sign in to the OCI Console at cloud.oracle.com with your account credentials.
  2. Use the compartment dropdown in the top-left corner to select the compartment where your sandbox was located. If you used the root compartment, select that.
  3. Go through each service menu (Compute, Networking, Storage, Database, etc.) and ensure no active resources exist. For each service, check the list and confirm it is empty or shows only resources you intentionally keep.
  4. Pay special attention to:
    • Compute > Instances: Ensure no instances are in “Running” or “Stopped” state. Terminated instances may appear for a short time, but they should disappear after a few minutes.
    • Networking > Virtual Cloud Networks: Check for VCNs, subnets, route tables, security lists, and gateways. A VCN cannot be deleted if it has dependent resources, so its absence indicates cleanup.
    • Storage > Block Storage: Look for boot volumes and block volumes. These can exist independently of instances.
    • Storage > Object Storage: Check buckets and objects. Even if the instance is gone, a bucket may remain.
    • Database: If you created Autonomous Database or DB Systems, ensure they are terminated.
  5. If you used Resource Manager or a stack (e.g., from a Terraform template), go to Resource Manager > Stacks and check the stack’s status. A successful “Destroy” job should show no resources in the state file.

Using the OCI CLI for Verification

For a more thorough check, you can use the OCI Command Line Interface (CLI). This is especially useful if you have many resources or want to script the verification. First, ensure you have the CLI installed and configured with your credentials. Then run commands to list resources in the compartment. For example:

  • oci compute instance list --compartment-id <compartment_ocid> – lists all instances.
  • oci network vcn list --compartment-id <compartment_ocid> – lists VCNs.
  • oci bv volume list --compartment-id <compartment_ocid> – lists block volumes.
  • oci os bucket list --compartment-id <compartment_ocid> – lists object storage buckets.

If any command returns a non-empty list, those resources still exist. You can also use oci search resource type to search across all resource types in a compartment. A clean sandbox should return an empty list for all relevant services.

Checking Audit Logs and Activity

OCI Audit logs record all API calls and console actions. To verify that deletion events occurred, navigate to Audit in the console (under Governance and Administration). Filter by the compartment and time range. Look for events with event type TerminateInstance, DeleteVcn, DeleteVolume, etc. The presence of these events confirms that deletion was attempted. However, absence of an event does not guarantee the resource is gone—it may have never existed or may have been created outside the sandbox. For a definitive answer, rely on resource listings.

Common Pitfalls and Misconceptions

One common mistake is assuming that deleting a “sandbox” via a single button (like in OCI Resource Manager) removes every resource. In reality, if you manually created resources outside the stack, they will not be deleted. Another pitfall is forgetting about resources in different regions. OCI resources are region-specific; you may have created a sandbox in one region, but a bucket or instance in another. Check all regions you used. Also, note that some resources, such as Object Storage buckets, can be “archived” or “soft-deleted” and may not appear in the active list but still exist. Use the “List” API with the appropriate lifecycle state to see all resources, not just active ones.

Cost and Security Implications

If a sandbox is not fully removed, you may continue to incur costs for resources like block volumes, reserved public IPs, or Object Storage. On the Always Free tier, you have limited resources (e.g., 2 AMD-based VMs, 4 ARM-based OCPUs, 200 GB block storage). Lingering resources consume that quota, preventing you from creating new free resources. Additionally, leftover resources with public IPs could be a security risk if they run vulnerable software. Therefore, verification is not just about tidiness—it protects your account.

Frequently Asked Questions

How long does it take for terminated resources to disappear from the console?

Most terminated resources (instances, volumes) disappear from the console within a few minutes. However, some resources like Object Storage buckets may take up to an hour to be fully removed. If you still see them after that, it may indicate a deletion failure.

Can I verify sandbox removal using the OCI Mobile App?

The OCI Mobile App allows you to view resources, but it is not as comprehensive as the console. You can check instances and some other resources, but for a full audit, use the web console or CLI.

What if I deleted the sandbox but still see a VCN in the list?

A VCN cannot be deleted if it has dependent resources like subnets, route tables, or security lists. You must delete those first. Check the VCN’s details to see if it has any associated resources, and remove them before deleting the VCN.

Does terminating an instance also delete its boot volume?

By default, when you terminate an instance, you have the option to delete the boot volume. If you did not select that option, the boot volume remains and will incur costs. Check the Block Storage list to ensure no boot volumes are left.

How can I check if a stack destroy job actually removed everything?

In Resource Manager, go to the stack’s job history and view the last destroy job. The job logs will show the resources that were destroyed. If the job completed successfully, the state file should be empty. You can also run oci resource-manager job get-stack-tf-state to see the current state.

Is there a way to automatically verify sandbox deletion?

Yes, you can write a script using the OCI CLI that lists all resources in a compartment and checks if any exist. This can be run as a cron job or after a destroy operation. The script can exit with a non-zero status if resources remain, alerting you to a problem.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →