Stopping and Starting VMs
You can stop a running virtual machine (VM) at any time, and then start it again. Stopping a VM enables you, for example, to service the VM or to treat its root volume.
Stopping and Starting VMs Using Cockpit v2
Stopping a VM
-
In the VMs dashboard, check the box of the running VM you want to stop.
Multiselection is available.
The VM is selected.
-
Click Stop.
The STOP VMs confirmation dialog box appears. -
Click Stop.
The state of the selected VM changes tostopping
, and then tostopped
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 VM Lifecycle > Force Stop.
To force a VM to stop, click Force Stop.
Stopping and Starting VMs Using OSC CLI
Stopping VMs
The StopVms command stops one or more running virtual machines (VMs).
You can stop only VMs that are valid and that belong to you. Data stored in the VM RAM is lost.
$ osc-cli api StopVms --profile "default" \
--VmIds '["i-12345678"]'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
ForceStop
: (optional) Forces the VM to stop. -
VmIds
: One or more IDs of VMs.
The StopVms command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
-
Vms
: Information about one or more stopped VMs.-
CurrentState
: The current state of the VM (InService
|OutOfService
|Unknown
). -
PreviousState
: The previous state of the VM (InService
|OutOfService
|Unknown
). -
VmId
: The ID of the VM.
-
{
"Vms": [
{
"VmId": "i-12345678",
"PreviousState": "running",
"CurrentState": "stopping"
}
],
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Starting VMs
The StartVms command start one or more virtual machines (VMs).
You can start only VMs that are valid and that belong to you.
$ osc-cli api StartVms --profile "default" \
--VmIds '["i-12345678"]'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
VmIds
: One or more IDs of VMs.
The StartVms command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
-
Vms
: Information about one or more started VMs.-
CurrentState
: The current state of the VM (InService
|OutOfService
|Unknown
). -
PreviousState
: The previous state of the VM (InService
|OutOfService
|Unknown
). -
VmId
: The ID of the VM.
-
{
"Vms": [
{
"VmId": "i-12345678",
"PreviousState": "stopped",
"CurrentState": "pending"
}
],
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Stopping and Starting VMs Using oapi-cli
Stopping VMs
The StopVms command stops one or more running virtual machines (VMs).
You can stop only VMs that are valid and that belong to you. Data stored in the VM RAM is lost.
$ oapi-cli --profile "default" StopVms \
--VmIds '["i-12345678"]'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
ForceStop
: (optional) Forces the VM to stop. -
VmIds
: One or more IDs of VMs.
The StopVms command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
-
Vms
: Information about one or more stopped VMs.-
CurrentState
: The current state of the VM (InService
|OutOfService
|Unknown
). -
PreviousState
: The previous state of the VM (InService
|OutOfService
|Unknown
). -
VmId
: The ID of the VM.
-
{
"Vms": [
{
"VmId": "i-12345678",
"PreviousState": "running",
"CurrentState": "stopping"
}
],
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Starting VMs
The StartVms command start one or more virtual machines (VMs).
You can start only VMs that are valid and that belong to you.
$ oapi-cli --profile "default" StartVms \
--VmIds '["i-12345678"]'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
VmIds
: One or more IDs of VMs.
The StartVms command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
-
Vms
: Information about one or more started VMs.-
CurrentState
: The current state of the VM (InService
|OutOfService
|Unknown
). -
PreviousState
: The previous state of the VM (InService
|OutOfService
|Unknown
). -
VmId
: The ID of the VM.
-
{
"Vms": [
{
"VmId": "i-12345678",
"PreviousState": "stopped",
"CurrentState": "pending"
}
],
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Stopping and Starting Instances Using AWS CLI
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
Stopping Instances
To stop one or more instances, use the stop-instances command following this syntax:
$ 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 totrue
, 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 VM Lifecycle > Force Stop.
-
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
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.
-
{
"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:
$ 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. For more information, see Installing and Configuring AWS CLI.
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.
-
{
"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.