| 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, go to 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]
| Name | Description | Required | |||
|---|---|---|---|---|---|
|
|
The AMI ID. Type: String Default: None Example: ami-2bb65342 |
Yes | |||
|
|
Specifies the maximum hourly price for any Spot Instance launched to fulfill the request. Type: String Default: None Example: -p .15 |
Yes | |||
|
|
The maximum number of Spot Instances to launch. Type: xs:integer Default: 1 Example: -n 10 |
No | |||
|
|
Specifies the Spot Instance request type. Type: String Valid Values: Default: one-time Example: -r persistent |
No | |||
|
|
Specifies the ID of the Amazon VPC subnet in which to launch the Spot Instance. Type: String Default: None Example: -s subnet-baab943d3 |
No | |||
|
|
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. Example: --valid-from 2009-12-31T11:51:50 |
No | |||
|
|
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. Example: --valid-until 2009-12-31T11:51:50 |
No | |||
|
|
Specifies the instance launch group. Launch groups are Spot Instances that launch together and terminate together. Type: String Default: Instances are launched and terminated individually. Example: --launch-group Skynet |
No | |||
|
|
Specifies the Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone. Type: String Default: Instances are launched in any available Availability Zone. Example: --availability-zone-group batchGroup01 |
No | |||
|
|
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. Example: --placement-group default |
No | |||
|
|
Specifies the user data that will be made available to the instances. Type: String Default: None Example: -d "My user data" |
No | |||
|
|
Name of the security group. Type: String Default: User's default group. Example: -g websrv |
No | |||
|
|
The name of the key pair. Type: String Default: None Example: -k MyKeyPair |
No | |||
|
|
Specifies the instance type. Type: String Valid Values: Default: m1.small Example: -t m1.large |
No | |||
|
|
Specifies the placement constraints (Availability Zone) for launching the instances. Type: String Default: Amazon EC2 selects an Availability Zone in the current Region. Example: -z us-east-1b |
No | |||
|
|
The ID of the kernel to select. Type: String Default: None Example: --kernel aki-ba3adfd3 |
No | |||
|
|
The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk and search for the kernel ID. Type: String Default: None Example: --ramdisk ari-badbad00 |
No | |||
|
|
Defines a block device mapping for the instance. This argument is passed in the form of
You may specify multiple For more detailed information on block device mapping, go to Block Device Mapping in the Amazon Elastic Compute Cloud User Guide. Type: String Default: None Example: -b "/dev/sdb=snap-92d333fb::false" |
No | |||
|
|
Enables monitoring for the instance. Type: String Default: Disabled Example: --monitor |
No |
| Option | Description |
|---|---|
|
|
Overrides the Region specified in the Default: The Example: |
|
|
Default: The Example: |
|
|
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: |
|
|
Specifies a connection timeout (in seconds). Example: --connection-timeout 30 |
|
|
Specifies a request timeout (in seconds). Example: --request-timeout 45 |
|
|
Displays verbose output by showing the SOAP request and response on the command line. This is particularly useful if you are building tools to talk directly to our SOAP API. |
|
|
Displays column headers in the output. |
|
|
Shows empty columns as |
|
|
Do not display tags for tagged resources. |
|
|
Prints internal debugging information. This is useful to assist us when troubleshooting problems. |
|
|
Displays Help. |
|
|
If Example: |
The command returns a table that contains the following information:
Output type identifier ("SPOTINSTANCEREQUEST")
ID of the Spot Instance request
Price
Type (one-time or persistent)
Product description (Linux/UNIX, Windows)
State (active, open, closed, cancelled, failed)
Create time
Valid from
Valid until
Launch group
Availability Zone group
Image ID
Instance type
Key pair name
Security group
Monitoring status
Amazon EC2 command line tools display errors on stderr.
This example creates a Spot Instances request for ten m1.small instances.
PROMPT>ec2-request-spot-instances ami-b232d0db -p 0.04 --key gsg-keypair --group default --instance-type m1.small -n 3 --type one-timeSPOTINSTANCEREQUEST sir-7545a802 0.04 one-time Linux/UNIX open 2010-04-07T16:57:04+0200 ami-b232d0db m1.small gsg-keypair default monitoring-disabled SPOTINSTANCEREQUEST sir-26d36202 0.04 one-time Linux/UNIX open 2010-04-07T16:57:04+0200 ami-b232d0db m1.small gsg-keypair default monitoring-disabled SPOTINSTANCEREQUEST sir-63fb5402 0.04 one-time Linux/UNIX open 2010-04-07T16:57:04+0200 ami-b232d0db m1.small gsg-keypair default monitoring-disabled