ec2-create-image
Description
Creates an AMI that uses an Amazon EBS root device from a "running" or "stopped" instance.
AMIs that use an Amazon EBS root device boot faster than AMIs that use instance stores. They can be up to 1 TiB in size, use storage that persists on instance failure, and can be stopped and started.
Syntax
ec2-create-image
instance_id
[--name name
, --description description
, --no-reboot]
Options
Name | Description | Required |
---|---|---|
|
The ID of the instance. Type: String Default: None Example: i-10a64379 |
Yes |
|
The name of the AMI that was provided during image creation. Type: String Default: None Constraints: 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_) Example: Standard Web Server |
Yes |
|
The description of the AMI that was provided during image creation. Type: String Default: None Constraints: Up to 255 characters Example: Fedora_v11 |
No |
|
By default this property is set to false, which means Amazon EC2 attempts to cleanly shut down the instance before image creation and reboots the instance afterwards. When set to true, Amazon EC2 does not shut down the instance before creating the image. When this option is used, file system integrity on the created image cannot be guaranteed. Type: Boolean Default: false Example: --no-reboot |
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 creates an AMI from the i-10a64379 instance.
PROMPT>ec2-create-image i-10a64379 --name "Standard Web Server" --description "Standard web server AMI"
IMAGE ami-4fa54026