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, any instances that you launch with a tenancy of host but without a specific host ID are placed onto any available Dedicated Host in your account that has auto-placement enabled. When auto-placement is disabled, you need to provide a host ID to have the instance launch onto a specific host. If no host ID is provided, the instance is launched onto a suitable host with 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 IDs of the Dedicated Hosts 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 Client Errors.

Example

Example

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

Sample Request

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

Sample Response

<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: