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
-
Request the termination:
terminal origin compute terminate-instance --instance-urn <instance-urn>You can terminate an instance in any status. A
FAILEDinstance is terminated without waiting for its machine to confirm the guest is gone. -
Run
get-instanceuntilstatusreadsTERMINATED:terminal origin compute get-instance --instance-urn <instance-urn>The instance passes through
SHUTTING_DOWNwhile 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
| Resource | On termination |
|---|---|
| Root disk and other launch-created volumes | Deleted. |
| Volumes you attached yourself | Detached and AVAILABLE again. Not deleted. |
| Launch-created network interface | Deleted, with any public address the platform assigned to it automatically. |
| Floating IP you allocated yourself | Disassociated. 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
mutation {
compute {
terminateInstance(input: { instanceUrn: "<instance-urn>" }) {
accepted
message
}
}
}