Stopping and Starting Instances

You can stop a running instance at any time, and then start it again. Stopping an instance enables you, for example, to service the instance or to treat its root volume.

Stopping and Starting Instances Using Cockpit v1

Stopping an Instance

  1. Click Compute > Instances.

  2. Click the running instance you want to stop.

    Multiselection is available.

    The instance is selected.

  3. Click Stop .
    The STOP INSTANCE(S) confirmation dialog box appears.

  4. Click Stop to confirm the operation.
    The state of the selected instance changes to stopping, and then to stopped once the operation is completed.

    If the instance does not stop, you can force it to stop. Beware that forcing an instance to stop may damage your instance system and lose data. Therefore, it is recommended to avoid using force stop. For more information about it and why the instance does not stop properly, see About Instance Lifecycle > Force Stop.

    To force an instance to stop, click Stop , and then Force Stop.

Starting an Instance

  1. Click Compute > Instances.

  2. Click the stopped instance you want to start.

    Multiselection is available.

    The instance is selected.

  3. Click Start .
    The state of the selected instance changes to pending, and then to running once the operation is completed.

Stopping and Starting VMs Using Cockpit v2-beta

Stopping a VM

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

  2. Check the box of the running VM you want to stop.

    Multiselection is available.

    The VM is selected and an action menu appears.

  3. Click IconStop Stop.
    The STOP VMs confirmation dialog box appears.

  4. Click Submit to confirm the operation.
    The state of the selected VM changes to IconStatePending stopping, and then to IconStateStopped stopped once the operation is completed.

    If the VM does not stop, you can force it to stop. Beware that forcing a VM to stop may damage your VM system and lose data. Therefore, it is recommended to avoid using force stop. For more information about it and why the VM does not stop properly, see About Instance Lifecycle > Force Stop.

    To force a VM to stop, click IconForceStop Force Stop.

Starting a VM

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

  2. Check the box of the stopped VM you want to start.

    Multiselection is available.

    The VM is selected and an action menu appears.

  3. Click IconStart Start.
    The state of the selected VM changes to IconStatePending pending, and then to IconStateRunning running once the operation is completed.

Stopping and Starting Instances Using AWS CLI

Stopping Instances

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

Request sample
$ aws ec2 stop-instances \
    --profile YOUR_PROFILE \
    --instance-ids i-12345678 \
    --force \
    --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.

  • (optional) force: If set to true, forces the instance to stop without properly exiting running applications.

    Beware that forcing an instance to stop may damage your instance system and data. Therefore, it is recommended to avoid using force stop. For more information about it and why the instance does not stop properly, see About Instance Lifecycle > Force Stop.

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

The stop-instances command returns the following elements:

  • StoppingInstances: Information about one or more stopping instances. This element contains the following information for each instance:

    • 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
{
    "StoppingInstances": [
        {
            "InstanceId": "i-12345678",
            "CurrentState": {
                "Code": 64,
                "Name": "stopping"
            },
            "PreviousState": {
                "Code": 16,
                "Name": "running"
            }
        }
    ]
}

The state of the specified instances changes to stopping, and then to stopped once the operation is completed.

Starting Instances

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

Request sample
$ aws ec2 start-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 start-instances command returns the following elements:

  • StartingInstances: Information about one or more starting instances. This element contains the following information for each instance:

    • 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
{
    "StartingInstances": [
        {
            "InstanceId": "i-12345678",
            "CurrentState": {
                "Code": 0,
                "Name": "pending"
            },
            "PreviousState": {
                "Code": 80,
                "Name": "stopped"
            }
        }
    ]
}

The state of the specified instances changes to pending, and then to running once the operation is completed.

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.