Terminating Instances

You can terminate an instance that you no longer need. Terminating an instance releases its corresponding physical resources, therefore the instance cannot be recovered. You can also specify that the instance terminates when shutting it down with the operating system command by enabling the InstanceInitiatedShutDownBehavior attribute.

Terminating an Instance Using Cockpit v1

  1. Click Compute > Instances.

  2. Click the running or stopped instance you want to terminate.

    Multiselection is available.

    The instance is selected.

    If the DisableApiTermination attribute is enabled, you need to disable it before you can terminate the instance. For more information, see Modifying an Instance Attribute.

  3. Click Terminate .
    The TERMINATE INSTANCE(S) confirmation dialog box appears.

  4. Click Terminate to confirm the operation.
    The state of the selected instance changes to shutting-down, and then to terminated once the operation is completed.

    Terminated instances remain visible for approximately 1 hour after termination.

Deleting a VM Using Cockpit v2-beta

  1. Click inside the VMs dashboard to make checkboxes appear.

  2. Check the box of the running or stopped VM you want to delete.

    Multiselection is available.

    The VM is selected and an action menu appears.

    If the DisableApiTermination attribute is enabled, you need to disable it before you can terminate the VM. For more information, see Modifying an Instance Attribute.

  3. Click IconTerminate Delete.
    The DELETE VMs confirmation dialog box appears.

  4. Click Delete VM(s) to confirm the operation.
    The state of the selected VM changes to IconStatePending shutting-down, and then to IconStateTerminated terminated once the operation is completed.

    Deleted VMs remain visible for approximately 1 hour after deletion.

Deleting VMs Using OSC CLI

See the DeleteVms command sample in the documentation of the OUTSCALE API.

Terminating Instances Using AWS CLI

To terminate one or more instances, use the terminate-instances command following this syntax:

Request sample
$ aws ec2 terminate-instances \
    --profile YOUR_PROFILE \
    --instance-ids i-12345678 \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • instance-ids: One or more instance IDs.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The terminate-instances command returns the following elements:

  • TerminatingInstances: Information about one or more terminating instances. This element contains the following information:

    • InstanceId: The ID of the instance.

    • CurrentState: The current state of the instance, with the code and the name of the state.

    • PreviousState: The state of the instance before the action, with the code and the name of the state.

Result sample
{
    "TerminatingInstances": [
        {
            "InstanceId": "i-12345678",
            "CurrentState": {
                "Code": 32,
                "Name": "shutting-down"
            },
            "PreviousState": {
                "Code": 80,
                "Name": "stopped"
            }
        }
    ]
}

The state of the specified instances changes to shutting-down, and then to terminated once the operation is completed.

Terminated instances remain visible for approximately 1 hour after termination.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.