Skip to content

Compute / Task

Terminate an instance

Updated · 3 min read

Terminate an instance permanently, and learn which of its volumes, network interfaces and addresses are deleted and which stay with you.

On this page5 sections

Terminate an instance when you no longer need it. Termination is permanent and stops billing for the instance. The volumes its launch created are deleted with it, unless a volume has a snapshot: then it stays, and it’s still billed. See What happens to the instance’s resources.

Before you begin

Terminate the instance

  1. Request the termination:

    terminal
    origin compute terminate-instance --instance-urn <instance-urn>

    You can terminate an instance in any status. A FAILED instance is terminated without waiting for its machine to confirm the guest is gone.

  2. Run get-instance until status reads TERMINATED:

    terminal
    origin compute get-instance --instance-urn <instance-urn>

    The instance passes through SHUTTING_DOWN while its resources are released, normally for a few seconds.

Terminating is safe to repeat. If you aren’t sure an earlier attempt went through, call it again. Terminating an instance that is already TERMINATED reports success and changes nothing.

What happens to the instance’s resources

ResourceOn termination
Root disk and other launch-created volumesDeleted.
Volumes you attached yourselfDetached and AVAILABLE again. Not deleted.
Launch-created network interfaceDeleted, with any public address the platform assigned to it automatically.
Floating IP you allocated yourselfDisassociated. It stays allocated to you until you release it. See Floating IPs.

A launch-created volume that has a snapshot can’t be deleted, so it stays AVAILABLE and billed after the instance terminates. Its retentionNote says why. Delete the snapshots, then the volume. See Delete a volume.

If something else can’t be released, the instance still reaches TERMINATED and stops costing you anything. The attachment for that resource keeps naming it and says it could not be released.

A terminated instance stays in list-instances for 2 hours, then drops out of the default list. You can still read it with get-instance at any time.

Using the API

GraphQL
mutation {
  compute {
    terminateInstance(input: { instanceUrn: "<instance-urn>" }) {
      accepted
      message
    }
  }
}