Menu
Amazon Elastic Compute Cloud
API Reference (API Version 2016-11-15)

AllocateHosts

Allocates a Dedicated Host to your account. At minimum you need to specify the instance size type, Availability Zone, and quantity of hosts you want to allocate.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

AutoPlacement

This is enabled by default. This property allows instances to be automatically placed onto available Dedicated Hosts, when you are launching instances without specifying a host ID.

Default: Enabled

Type: String

Valid Values: on | off

Required: No

AvailabilityZone

The Availability Zone for the Dedicated Hosts.

Type: String

Required: Yes

ClientToken

Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

Type: String

Required: No

InstanceType

Specify the instance type that you want your Dedicated Hosts to be configured for. When you specify the instance type, that is the only instance type that you can launch onto that host.

Type: String

Required: Yes

Quantity

The number of Dedicated Hosts you want to allocate to your account with these parameters.

Type: Integer

Required: Yes

Response Elements

The following elements are returned by the service.

hostIdSet

The ID of the allocated Dedicated Host. This is used when you want to launch an instance onto a specific host.

Type: array of Strings

requestId

The ID of the request.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

Examples

Example

This example allocates a Dedicated Host to your account, on to which you can launch m3.medium instances.

Sample Request

Copy to clipboard
https://ec2.amazonaws.com/?Action=AllocateHosts &AvailabilityZone=us-east-1b &InstanceType=m3.medium &Quantity=1 &AUTHPARAMS

Sample Response

Copy to clipboard
<AllocateHostsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE</requestId> <hostIdSet> <item>h-00548908djdsgfs</item> </hostIdSet> </AllocateHostsResponse>

Example

This example allocates a Dedicated Host to your account with auto-placement off.

Sample Request

Copy to clipboard
https://ec2.amazonaws.com/?Action=AllocateHosts &AvailabilityZone=us-east-1b &InstanceType=m3.medium &Quantity=1 &AutoPlacement=off &AUTHPARAMS

Sample Response

Copy to clipboard
<AllocateHostsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE</requestId> <hostIdSet> <item>h-00548908djdsgfs</item> </hostIdSet> </AllocateHostsResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: