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

ModifyHosts

Modify the auto-placement setting of a Dedicated Host. When auto-placement is enabled, AWS will place instances that you launch with a tenancy of host, but without targeting a specific host ID, onto any available Dedicated Host in your account which has auto-placement enabled. When auto-placement is disabled, you need to provide a host ID if you want the instance to launch onto a specific host. If no host ID is provided, the instance will be launched onto a suitable host which has auto-placement enabled.

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

Specify whether to enable or disable auto-placement.

Type: String

Valid Values: on | off

Required: Yes

HostId.N

The host IDs of the Dedicated Hosts you want to modify.

Type: array of Strings

Required: Yes

Response Elements

The following elements are returned by the service.

requestId

The ID of the request.

Type: String

successful

The IDs of the Dedicated Hosts that were successfully modified.

Type: array of Strings

unsuccessful

The IDs of the Dedicated Hosts that could not be modified. Check whether the setting you requested can be used.

Type: array of UnsuccessfulItem objects

Errors

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

Example

Example

This example enables the auto-placement setting on a Dedicated Host.

Sample Request

Copy
https://ec2.amazonaws.com/?Action=ModifyHosts &AutoPlacement=on &HostId=h-00548908djdsgfs &AUTHPARAMS

Sample Response

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

See Also

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