ReleaseHosts - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


When you no longer want to use an On-Demand Dedicated Host it can be released. On-Demand billing is stopped and the host goes into released state. The host ID of Dedicated Hosts that have been released can no longer be specified in another request, for example, to modify the host. You must stop or terminate all instances on a host before it can be released.

When Dedicated Hosts are released, it may take some time for them to stop counting toward your limit and you may receive capacity errors when trying to allocate new Dedicated Hosts. Wait a few minutes and then try again.

Released hosts still appear in a DescribeHosts response.

Request Parameters

For more information about required and optional parameters that are common to all actions, see Common Query Parameters.


The IDs of the Dedicated Hosts to release.

Type: Array of strings

Required: Yes

Response Elements

The following elements are returned by the service.


The ID of the request.

Type: String


The IDs of the Dedicated Hosts that were successfully released.

Type: Array of strings


The IDs of the Dedicated Hosts that could not be released, including an error message.

Type: Array of UnsuccessfulItem objects


For information about the errors that are common to all actions, see Common client error codes.



This releases a Dedicated Host successfully.

Sample Request &HostId=h-00548908djdsgfs &AUTHPARAMS

Sample Response

<ReleaseHostsResponse xmlns=""> <requestId>d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE</requestId> <unsuccessful/> <successful> <item>h-00548908djdsgfs</item> </successful> </ReleaseHostsResponse>


This request is unsuccessful.

Sample Request &HostId=h-00548908djdsgfs &AUTHPARAMS

Sample Response

<ReleaseHostsResponse xmlns=""> <requestId>d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE</requestId> <unsuccessful> <item> <error> <message>Dedicated host 'h-00548908djdsgfs' cannot be released as it is occupied</message> <code>Client.InvalidHost.Occupied</code< </error> <resourceId>h-00548908djdsgfs</resourceId> </item> </unsuccessful> <successful/> </ReleaseHostsResponse>

See Also

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