All Products
Search
Document Center

Elastic Compute Service:deployment set

Last Updated:Jun 21, 2026

You can configure deployment sets to control the distribution of ECS instances, mitigating single points of failure on physical servers or meeting the ultra-low latency demands of applications like high-frequency trading. Choose a high availability strategy to spread instances for better fault tolerance, or a low latency strategy to co-locate them for faster network communication.

Limitations

  • You cannot create dedicated hosts in a deployment set.

  • Region and zone restrictions: An instance and its deployment set must be in the same region. For a deployment set with the low latency strategy, all instances must be in the same zone.

  • Instance family restrictions: Most instance families of generation 6 or later support deployment sets that use the high availability, high availability group, and low latency strategies.

    Different deployment strategies support specific instance families.

    For a definitive list of supported instance families, see the response returned by the DescribeDeploymentSetSupportedInstanceTypeFamily API operation.

    Deployment strategy

    Supported instance families

    high availability strategy and high availability group strategy

    • g9a, g9ae, g9i, g8a, g8i, g8ine, g8ise, g8y, g7, g7a, g7h, g7ne, g7nex, g7se, g7t, g6, g6a, g6e, g6h, g5, g5ne

    • c9a, c9ae, c9i, c8a, c8i, c8ine, c8y, c7, c7a, c7nex, c7se, c7t, c6, c6a, c6e, c5

    • r9a, r9ae, r9i, r8a, r8i, r8y, r7, r7a, r7se, r7t, r6, r6a, r6e, r5

    • hfc9i, hfg9i, hfr9i, hfc8i, hfg8i, hfr8i, hfc7, hfg7, hfr7, hfc6, hfg6, hfr6, hfc5, hfg5

    • ebmc9i, ebmg9a, ebmg9i, ebmr9i, ebmc8a, ebmc8i, ebmc8y, ebmg8a, ebmg8i, ebmg8y, ebmr8a, ebmr8y, ebmc7, ebmc7a, ebmg7, ebmg7a, ebmg7se, ebmhfc7, ebmhfg7, ebmhfr7, ebmr7, ebmr7a, ebmg5

    • i5, i5g, i5ge, ic5, i4, i4g, i4r, i3, i3g, i2, i2g, i2gne, i2ne

    • gn6i

    • d3c, d3s, d2c, d2s, d1ne

    • re6, re6p, s6, t6, e4, mn4, n4, re4, xn4, sn2ne, u2a, u2i, se1, se1ne, sn1ne, u1, e

    low latency strategy

    • g9a, g9ae, g9i, g8a, g8ae, g8i, g8ise, g8y, g7, g5ne

    • c9a, c9ae, c9i, c8a, c8ae, c8i, c8ine, c8y, c7, c7nex

    • r9a, r9ae, r9i, r8a, r8ae, r8i, r8y, r7

    • hfc9i, hfg9i, hfr9i, hfc8i, hfg8i, hfr8i

    • ebmc9i, ebmg9a, ebmg9i, ebmr9i, ebmc8a, ebmc8i, ebmc8y, ebmg8a, ebmg8i, ebmg8y, ebmgn8v, ebmr8a, ebmr8y, ebmc7, ebmc7a, ebmg7, ebmg7a, ebmg7se, ebmgn7ex, ebmhfc7, ebmhfg7, ebmhfr7, ebmr7, ebmr7a

    • i5, i5g, i5ge, i4

    • gn8v

    • hpc8ae, hpc8i, hpc7ip, hpc6id, u2a, u2i

Quick start

Step 1: Create a deployment set

Console
  1. Go to ECS console - Deployment Sets.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. On the Deployment Set page, click Create Deployment Set.

  4. In the Create Deployment Set dialog box, enter a Name and Description, and select a Strategy. If you select the high availability strategy, you can also set the deployment type (physical server, rack, or switch) and affinity (1-10). How do I choose a deployment strategy?

API

Call the CreateDeploymentSet operation to create a deployment set in a specified region and set its deployment strategy.

  • For the high availability group strategy, specify the GroupCount parameter to set the number of groups.

  • For the high availability strategy, specify the Type parameter to set the deployment type (host, rack, or sw). The default value is host.

  • For the high availability strategy, specify the Affinity parameter to set the affinity level (1-10). The default value is 1.

Step 2: Create or add instances

Console
Important

The instance type, region, and number of ECS instances must comply with the limitations. For more information, see Limitations.

  • Create a new instance in a deployment set:

    On the deployment set list page, find the target deployment set. In the Actions column, click Create Instance. On the Custom Launch page, complete the instance configuration.

  • Add an existing instance to a deployment set: See Change instance deployment set.

API
  • Create a new instance in a deployment set: Call the RunInstances operation and specify the DeploymentSetId parameter.

  • Add an existing instance to a deployment set: Call the ModifyInstanceDeployment operation and specify the InstanceId and DeploymentSetId parameters.

    Note

    If the specified deployment set uses the AvailabilityGroup strategy (high availability group strategy), you can use the DeploymentSetGroupNo parameter to specify the group number for the instance within the deployment set.

Deployment strategies

A deployment strategy determines how ECS instances are placed on physical servers. You can choose a strategy based on your requirements for high availability, network latency, and deployment scale.

Scenario

Recommended strategy

Key limitations

Small-scale clusters that require strict fault isolation

High availability strategy

Up to 20 instances per zone

Large-scale deployments with group-based isolation

High availability group strategy

Up to 7 groups, with up to 20 instances per group in each zone

Low network latency

Low latency strategy

All instances must be in the same zone. The maximum number of instances is 20.

High availability strategy

Spreads instances across different physical servers, racks, or switches to prevent multiple instances from becoming unavailable due to a single point of failure.

Note

The finer the granularity of distribution, such as at the switch level, the stronger the fault tolerance, but the higher the potential for creation failures. If the current zone lacks enough separate physical servers, racks, or switches to meet the spread requirement, instance creation fails. If this occurs, wait and retry, or choose a different zone.

  • Use cases: Small-scale deployments that require high service continuity and isolation, such as Hadoop distributed computing clusters and SQL database clusters.

  • Zones: Instances can be deployed across different zones.

  • Instance limit: The maximum number of instances in a single zone depends on the deployment type and affinity settings.

Deployment type

The deployment type specifies the dimension for spreading ECS instances within the deployment set. Valid values are described in the following table.

Value

Spread dimension

Description

host (default)

Physical server

Instances are spread across different physical servers to prevent a single server failure from affecting multiple instances.

rack

Rack

Instances are spread across different racks to mitigate the risk of mass instance unavailability due to rack power failures.

sw

Switch

Instances are spread across different switches to mitigate the risk of network interruptions due to switch failures.

Affinity

Affinity defines the maximum number of instances allowed per physical server. The value can be an integer from 1 to 10. The default value is 1.

  • An affinity of 1 enforces strict spreading, which means that each physical server can host a maximum of one instance.

  • An affinity greater than 1 provides best-effort spreading, which is suitable for scenarios with a large number of instances that still require a degree of fault isolation.

The following examples illustrate how affinity affects instance distribution for the host deployment type:

Scenario 1: Create instances based on a deployment set

You create a deployment set of the host type with an affinity of 2, and then create three ECS instances within this set. The system distributes the instances across different physical servers based on the affinity constraint, with each physical server hosting a maximum of 2 instances.

image

Scenario 2: Increase the affinity of a deployment set

Increasing the affinity of an existing deployment set from 1 to 2 allows a single physical server to host more instances, which provides space for future scaling. Existing instances are not migrated.

image

Instance limits

The deployment type and affinity determine the instance limit of a deployment set.

Deployment type

Affinity

Limit per zone

sw (switch)

1-10

20 instances

rack (rack)

1-10

20 instances

host (physical server)

1-10

20 instances

High availability group strategy

Assigns instances to multiple groups (up to 7). Instances in different groups are strictly spread across different physical servers, while instances within the same group can be co-located.

ECS instances in different groups are strictly placed on separate physical servers within the specified region to avoid single points of failure. Instances within the same group are not guaranteed to be spread out and may be placed on the same physical server to reduce network latency between them.

Note

You can call the DescribeInstances operation to query the group number (DeploymentSetGroupNo) of an instance in a deployment set. Distributed applications, such as HDFS and Cassandra, can use this group number to make intelligent replica placement decisions, ensuring that different replicas are placed in different groups. This maintains data availability even if a group-level failure occurs.

  • Use cases: Large-scale deployments that require high isolation, especially for services with built-in high-availability mechanisms such as Redis primary-replica replication or Nginx load balancing.

  • Zones: Instances can be deployed across different zones.

  • Instance limit: Up to 20 instances per group in a single zone, with a maximum of 7 groups per zone.

Low latency strategy

Co-locates instances within the same network topology to minimize network communication latency between them.

Important

This strategy trades high availability for low latency. Multiple instances may be placed on the same physical server. Ensure your application has its own built-in high availability mechanism, such as multi-copy replication or primary-secondary failover.

  • Use cases: Applications that are highly sensitive to network latency, such as high-performance computing (HPC), real-time data analytics, and AI inference.

  • Zone: All instances must be deployed in the same zone.

  • Instance limit: The maximum number of instances is 20.

  • Insufficient capacity: If sufficient resources are not available within the same network topology, instance creation fails. We recommend that you wait and retry, or contact support to confirm resource availability.

Other operations

Change instance deployment set

You can change the deployment set of an ECS instance to move it to another set or add an unassigned instance to a set.

Console
  1. Go to ECS console - Instances.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Click the ID of the target instance to go to the instance details page. Click All Operations to expand all operations, and then search for and click Change Deployment Set.

  4. In the Change Deployment Set dialog box, select the target deployment set and configure the Force Change setting.

    • Yes: Allows changing the instance's physical server. This operation might restart the instance and affect service continuity. Use this option with caution.

    • No: Does not change the instance's physical server. This option attempts to add the instance to the specified deployment set. This avoids the risk of a restart, but the change fails if the instance does not meet the requirements of the new deployment set.

API

Call the ModifyInstanceDeployment operation and specify the following parameters to change the deployment set of an instance:

  • RegionId: The region where the instance resides. For example, cn-hangzhou for China (Hangzhou).

  • InstanceId: The ID of the instance. For example, i-bp67acfmxazb4ph***.

  • DeploymentSetId: The ID of the target deployment set. For example, ds-bp67acfmxazb4ph****.

  • Force: Specifies whether to force a change of the physical server when you change the deployment set. Valid values:

    • true: Allows changing the instance's physical server. This action might restart the instance and affect service continuity. Use this option with caution.

    • false (default): Does not change the instance's physical server. This option attempts to add the instance to the specified deployment set. This avoids the risk of a restart, but the change fails if the instance does not meet the requirements of the new deployment set.

Remove instance from a deployment set

To keep instances when deleting a deployment set, you must first remove them. The instances retain their original state after removal.

Important

The target instance must be in the Running or Stopped state. For more information, see Start an instance and Stop an instance.

  • Call the ModifyInstanceDeployment operation and specify the following parameters to remove an instance from a deployment set:

    • RegionId: The region where the instance resides. For example, cn-hangzhou for China (Hangzhou).

    • InstanceId: The ID of the instance. For example, i-bp67acfmxazb4ph***.

    • DeploymentSetId: The ID of the deployment set. For example, ds-bp67acfmxazb4ph****.

    • RemoveFromDeploymentSet: Specifies whether to remove the selected instance from the deployment set. Set the value to true.

  • Verify that the instance is removed: If the API call is successful and returns a status code of 200, the removal is successful.

Modify or delete a deployment set

Go to the ECS console - Deployment Sets page, find the target deployment set, and then click Modify Information or Delete in the Actions column. Follow the on-screen instructions to complete the operation.

  • Modify a deployment set: You can change the name and description of the deployment set.

  • Delete a deployment set: If a deployment set is no longer needed, you can delete it to prevent it from occupying resources.

    Important

    Before you delete a deployment set, ensure that it contains no instances. If instances exist, you must remove them from the deployment set before you can delete it. For more information, see Change instance deployment set or Remove instance from a deployment set.

Limitations

Important

During periods of high demand in a region, creating ECS instances or restarting pay-as-you-go ECS instances in Economical Mode may fail. In most cases, you can resolve this by retrying after a short wait. For more information, see Economical Mode.

  • Deployment set quota: Each Alibaba Cloud account has a limit on the number of deployment sets that it can own. You can view your quota in Quota Center.

  • Deployment type (Type) cannot be changed: After a deployment set is created, its deployment type cannot be modified. To change the deployment type, you must create a new deployment set and migrate the instances.

  • Rules for changing affinity:

    • Increase affinity: You can modify this setting directly without any restrictions. When the deployment type is host, increasing the affinity may also increase the maximum number of instances.

    • To decrease affinity: You must first remove all instances from the deployment set before you modify the affinity.

  • Deployment sets cannot be merged.

Billing

The deployment set feature is free of charge. You are billed only for the resources you use, such as ECS instances, disks, snapshots, images, and public bandwidth. For more information, see Billing overview.