ec2-stop-instances
Description
Stops an instance that uses an Amazon EBS volume as its root device.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.
Note | |
---|---|
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM. Performing this operation on an instance that uses an instance store as its root device returns an error. |
Syntax
ec2-stop-instances
instance_id
[instance_id...
]
Options
Name | Description | Required |
---|---|---|
|
The instance ID. Type: String Default: None Example: i-43a4412a |
Yes |
|
Forces the instance to stop. The instance will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. Type: Boolean Default: None Example: None |
No |
Output
The command returns a table that contains the following information:
-
IMAGE identifier
-
Unique ID of the newly registered machine image
Amazon EC2 displays errors on stderr.
Examples
Example Request
This example stops the i-10a64379 instance.
PROMPT>ec2-stop-instances i-10a64379
INSTANCE i-10a64379 running stopping