AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Modifies the status of an Amazon ECS container instance.
You can change the status of a container instance to
DRAINING to manually
remove an instance from a cluster, for example to perform system updates, update the
Docker daemon, or scale down the cluster size.
When you set a container instance to
DRAINING, Amazon ECS prevents new
tasks from being scheduled for placement on the container instance and replacement
service tasks are started on other container instances in the cluster if the resources
are available. Service tasks on the container instance that are in the
state are stopped immediately.
Service tasks on the container instance that are in the
are stopped and replaced according to the service's deployment configuration parameters,
maximumPercent. You can change
the deployment configuration of your service using UpdateService.
minimumHealthyPercent is below 100%, the scheduler can ignore
temporarily during task replacement. For example,
desiredCount is four
tasks, a minimum of 50% allows the scheduler to stop two existing tasks before starting
two new tasks. If the minimum is 100%, the service scheduler can't remove existing
tasks until the replacement tasks are considered healthy. Tasks for services that
do not use a load balancer are considered healthy if they are in the
state. Tasks for services that use a load balancer are considered healthy if they
are in the
RUNNING state and the container instance they are hosted on
is reported as healthy by the load balancer.
maximumPercent parameter represents an upper limit on the number
of running tasks during task replacement, which enables you to define the replacement
batch size. For example, if
desiredCount of four tasks, a maximum of
200% starts four new tasks before stopping the four tasks to be drained (provided
that the cluster resources required to do this are available). If the maximum is 100%,
then replacement tasks can't start until the draining tasks have stopped.
RUNNING tasks that do not belong to a service
are not affected; you must wait for them to finish or stop them manually.
A container instance has completed draining when it has no more
tasks. You can verify this using ListTasks.
When you set a container instance to
ACTIVE, the Amazon ECS scheduler
can begin scheduling tasks on the instance again.
For .NET Core and PCL this operation is only available in asynchronous form. Please refer to UpdateContainerInstancesStateAsync.
public virtual UpdateContainerInstancesStateResponse UpdateContainerInstancesState( UpdateContainerInstancesStateRequest request )
Container for the necessary parameters to execute the UpdateContainerInstancesState service method.
|ClientException||These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid.|
|ClusterNotFoundException||The specified cluster could not be found. You can view your available clusters with ListClusters. Amazon ECS clusters are region-specific.|
|InvalidParameterException||The specified parameter is invalid. Review the available parameters for the API request.|
|ServerException||These errors are usually caused by a server issue.|
Supported in: 4.5, 4.0, 3.5
Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms