| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more information about Spot Instances, see Spot Instances in the Amazon Elastic Compute Cloud User Guide.
The short version of this command is ec2rsi.
ec2-request-spot-instances ami_id
--addressing
addressing_type --price
price [--instance-count
count] [--type type]
[--valid-from timestamp] [--valid-until
timestamp] [--launch-group
group] [--availability-zone-group
group] [--user-data
data | --user-data-file
data-file] [--group
group [--group group
...]] [--key key-pair] [--instance-type
type] [--subnet
subnet_id] [--availability-zone
zone] [--kernel
kernel] [--ramdisk
ramdisk] [--block-device-mapping
mapping] [--monitor] [--iam-profile
arn | name]
[--network-interface NETWORKINTERFACE] [[--secondary-private-ip-address
IP_ADDRESS] | [--secondary-private-ip-address-count COUNT]] [--ebs-optimized
Boolean]
| Name | Description |
|---|---|
|
|
The ID of the AMI. Type: String Default: None Required: Yes Example: |
|
|
The maximum hourly price for any Spot Instance launched to fulfill the request. Type: String Default: None Required: Yes Example: |
|
|
The maximum number of Spot Instances to launch. Type: xs:integer Default: 1 Required: No Example: |
|
|
The Spot Instance request type. Type: String Valid values: Default: Required: No Example: |
|
|
The ID of the subnet in which to launch the Spot Instance. Type: String Default: None Required: No Example: |
|
|
The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled. Type: DateTime Default: Request is effective indefinitely. Required: No Example: |
|
|
The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. Type: DateTime Default: Request is effective indefinitely. Required: No Example: |
|
|
The instance launch group. Launch groups are Spot Instances that launch together and terminate together. Type: String Default: Instances are launched and terminated individually. Required: No Example: |
|
|
The user-specified name for a logical grouping of bids. When you specify If there is no active instance running in the Availability Zone group that you
specify for a new Spot Instance request (for example, all instances are
terminated, the bid is expired, or the bid falls below current
market), then Amazon EC2 will launch the instance in any
Availability Zone where the constraint can be met. Consequently,
the subsequent set of Spot Instances could be placed in a
different zone from the original request, even if the same
To ensure that all Spot Instances across all bids are launched into a particular
Availability Zone, specify
Type: String Default: Instances are launched in any available Availability Zone. Required: No Example: |
|
|
The name of an existing placement group you want to launch the instance into (for cluster instances). Type: String Default: Instances are launched in the default placement group. Required: No Example: |
|
|
The user data to make available to the instances. Type: String Default: None Required: No Example: |
|
|
The ID of the security group. Type: String Default: User's default group. Required: No Example: |
|
|
The name of the key pair. Type: String Default: None Required: No Example: |
|
|
The instance type. Type: String Valid values: Default: Required: No Example: |
|
|
The placement constraint (for example, a specific Availability Zone) for launching the instances. Specify whether you want all of the Spot Instances in all of your bids to be launched in a particular Availability Zone. Specifying this option requires Amazon EC2 to find capacity in the specified Availability Zone instead of letting Amazon EC2 pick the best Availability Zone available; this can potentially delay the fulfillment of your bid, and/or require a higher bid price. Type: String Default: Amazon EC2 selects an Availability Zone in the current region. Required: No Example: |
|
|
The ID of the kernel to select. Type: String Default: None Required: No Example: |
|
|
The ID of the RAM disk to select. Important We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB: A New Amazon Kernel Image in the Amazon Elastic Compute Cloud User Guide. Type: String Default: None Required: No Example: |
|
|
The block device mapping for the instance. This argument is
passed in the form of
You can specify multiple
For more detailed information about block device mapping, see Block Device Mapping in the Amazon Elastic Compute Cloud User Guide. Type: String Default: None Required: No Example: Note On Windows, the |
|
|
Enables monitoring for the instance. Type: String Default: Disabled Required: No Example: |
|
|
The IAM instance profile to associate with the launched instances. IAM instance profiles enable you to manage permissions for applications running on EC2. This is either the Amazon Resource Name (ARN) of the instance profile (for example, arn:aws:iam::111111111111:instance-profile/s3access) or the name of the role (for example, s3access). Type: String Default: None Required: No Example: |
|
|
[EC2-VPC] The network attachment for the launched instance. The format of the NETWORKINTERFACE definition is as follows: For an existing NETWORKINTERFACE - eni :dev index For a new NETWORKINTERFACE - dev index : subnet [: description [":<priv IP>"[:<SGs>[:<DOT> [:SIP count[:"<SIPs>"]]]]]]], where SGs is a comma separated list of security group IDs, DOT is either true or false, denoting whether to delete the interface on terminate, SIP count is the number of secondary IP addresses to assign, SIPs is a list of secondary IP addresses. You cannot specify both SIP count and SIPs. Type: String Default: None Required: No |
|
|
Assigns the specified IP address as a secondary private IP
address to the network interface or instance. This option can be
used multiple times to assign multiple secondary IP addresses.
This option is only available for instances running in a VPC.
You cannot specify this parameter when also specifying
You can do one of the following:
Note On Windows clients, you must enclose IP addresses in quotes. Type: String Default: None Required: No Example: |
|
|
The number of secondary IP addresses to assign to the
network interface or instance. You cannot specify this parameter
when also specifying
Type: Integer Default: None Required: No Example: |
|
|
Whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This option isn't available on all instance types. Additional usage charge apply when using this option. Type: Boolean Default: Required: No Example: |
| Option | Description |
|---|---|
|
|
Overrides the region specified by the Default: The value of the Example: |
|
|
The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the Example: |
|
|
The access key ID associated with your AWS account. For more information, see Tell the Tools Who You Are. Default: The value of the Example: Note For more information, see the following section, Deprecated Options. |
|
|
The secret access key associated with your AWS account. Default: The value of the Example: Note For more information, see the following section, Deprecated Options. |
|
|
The AWS delegation token. Default: The value of the environment variable (if set). |
|
|
The connection timeout, in seconds. Example: |
|
|
The request timeout, in seconds. Example: |
|
|
Displays verbose output, including the API request and response on the command line. This is useful if you are building tools to talk directly to our Query API. |
|
|
Includes column headers in the command output. |
|
|
Shows empty columns as |
|
|
Omits tags for tagged resources. |
|
|
Displays internal debugging information. This can assist us when helping you troubleshooting problems. |
|
|
Displays usage information for the command. |
|
|
Reads arguments from standard input. This is useful when piping the output from one command to the input of another. Example: |
For a limited time, you can still use the private key and X.509 certificate instead of your access key ID and secret access key. However, we recommend that you start using your access key ID (-O, --aws-access-key) and secret access key (-W, --aws-secret-key) now, as the private key (-K, --private-key) and X.509 certificate (-C, --cert) won't be supported after the transition period elapses. For more information, see Tell the Tools Who You Are.
| Option | Description |
|---|---|
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
This command returns a table that contains the following information for each Spot Instance request:
The Spot Instance request information
The SPOTINSTANCEREQUEST identifier
The ID of the Spot Instance request
The Spot Instance bid price
The Spot Instance type (one-time or persistent)
The product description (Linux/UNIX or Windows)
The state of the Spot Instance request (active, open, closed,
cancelled, failed)
The date and time the request was created
The date and time that the request is valid until
The date and time the request will be held until
The launch group
The Availability Zone group
The instance ID
The image ID
The instance type
The key pair name
Any security groups the request belongs to
The Availability Zone the instance belongs to
The kernel ID of the instance
The RAM disk ID of the instance
The monitoring status
The subnet ID
The Availability Zone the instance was launched to
The IAM profile
Any Spot Instance faults
The SPOTINSTANCEFAULT identifier
The Spot Instance fault code
The Spot Instance fault message
The Spot Instance status information
The SPOTINSTANCESTATUS identifier
The Spot Instance status
The date and time of the last update
The Spot Instance status message
Amazon EC2 command line tools display errors on stderr.
This example creates a Spot Instances request for three m1.small
instances.
PROMPT>ec2-request-spot-instances ami-1a2b3c4d -p 0.04 --key gsg-keypair --group default --instance-type m1.small -n 3 --type one-timeSPOTINSTANCEREQUEST sir-1a2b3c4d 0.040000 one-time Linux/UNIX open YYYY-MM-DDTHH:MM:SS-0800 ami-1a2b3c4d m1.small gsg-keypair sg-1a2b3c4d monitoring-disabled SPOTINSTANCESTATUS pending-evaluation YYYY-MM-DDTHH:MM:SS-0800 Your Spot request has been submitted for review, and is pending evaluation. SPOTINSTANCEREQUEST sir-2a2b3c4d 0.040000 one-time Linux/UNIX open YYYY-MM-DDTHH:MM:SS-0800 ami-1a2b3c4d m1.small gsg-keypair sg-1a2b3c4d monitoring-disabled SPOTINSTANCESTATUS pending-evaluation YYYY-MM-DDTHH:MM:SS-0800 Your Spot request has been submitted for review, and is pending evaluation. SPOTINSTANCEREQUEST sir-3a2b3c4d 0.040000 one-time Linux/UNIX open YYYY-MM-DDTHH:MM:SS-0800 ami-1a2b3c4d m1.small gsg-keypair sg-1a2b3c4d monitoring-disabled SPOTINSTANCESTATUS pending-evaluation YYYY-MM-DDTHH:MM:SS-0800 Your Spot request has been submitted for review, and is pending evaluation.