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 conceptual information about Spot Instances, refer to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.
ec2-request-spot-instances
--price
price [--instance-count
count] [--type type]
[--valid-from timestamp] [--valid-until
timestamp] [--launch-group
group] [--availability-zone-group group]
group] [--user-data data]
[--user-data-file data-file] [--group
group] [--key key-pair]
[--monitor] [--instance-type type] [--availability-zone
zone] [--kernel kernel]
[--ramdisk ramdisk] [--block-device-mapping
mapping]
| Name | Description | Required |
|---|---|---|
|
|
Specifies the maximum hourly price for any Spot Instance launched to fulfill the request. Type: String Default: None Example: --price .15 |
Yes |
|
|
The maximum number of Spot Instances to launch. Type: xs:integer Default: 1 Example: --count 10 |
No |
|
|
Specifies the Spot Instance type. Type: String Valid Values: Default: one-time Example: --type persistent |
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 independently Example: --valid-from 2009-12-01T11:51:50.000Z |
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.000Z |
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 AMI ID. Type: String Default: None Example: ami-2bb65342 |
Yes |
|
|
The name of the key pair. Type: String Default: None Example: MyKeyPair |
No |
|
|
Name of the security group. Type: String Default: None Example: websrv |
No |
|
|
MIME, Base64-encoded user data. Type: String Default: None Example: my user data |
No |
|
|
Specifies the instance type. Type: String Valid Values: Default: m1.small Example: m1.large |
No |
|
|
The ID of the kernel to select. Type: String Default: None Example: 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: ari-badbad00 |
No |
|
|
Specifies the Amazon VPC subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud. Type: String Default: None Example: --subnet MyPrivateSubnet |
No |
|
|
Specifies the placement constraints (Availability Zones) for launching the instances. Type: String Default: Amazon EC2 selects an Availability Zone. Example: us-east-1b |
No |
|
|
Describes the mapping that defines native device names to use when exposing virtual devices. Type: String Default: None Example: -b |
No |
|
|
Enables monitoring for the instance. Type: String Default: Disabled Example: --monitored |
No |
The command returns a table that contains the following information:
Instance ID
Price
Type
Valid Until
Hold Until
Launch Group
Availability Zone Group
Create Time
Description
State
Fault
Amazon EC2 displays errors on stderr.
This example creates a Spot Instances request for ten m1.small instances.
PROMPT>ec2-request-spot-instances --price 0.50 --image-id i-43a4412a --keyname MyKeypair --group websrv --instance-type m1.small --instance-count 10 --request-type one-timeSPOTINSTANCEREQUEST sir-f102a405 0.1 one-time Linux/UNIX active 2009-12-12T22:58:47+0200 i-3597b470 ami-7d3b6a38 m1.small default monitoring-enabled