All Products
Document Center

Auto Scaling:AttachVServerGroups

Last Updated:Jun 06, 2024

Attaches vServer groups to a scaling group. After a Classic Load Balancer (CLB) instance is attached to your scaling group, the instances in the scaling group are automatically added as backend servers of the CLB instance. These servers then handle requests forwarded by the CLB instance, streamlining the processing of incoming traffic. To direct varying access requests to separate backend servers or to distribute requests based on domain names or URLs, you can call the AttachVServerGroups operation. This operation enables the addition of multiple vServer groups, allowing for efficient management of various backend server configurations tailored to your routing preferences.

Operation description

  • Before you call this operation, make sure that the following requirements are met:

    • The CLB instance and the scaling group belong to the same Alibaba Cloud account.
    • The CLB instance and the scaling group reside in the same region.
    • The CLB instance is in the Running state.
    • The CLB instance is configured with at least one listener. The health check feature is enabled for the CLB instance.
    • If the network type of both the CLB instance and the scaling group is virtual private cloud (VPC), they use the same VPC.
    • If the network type of the scaling group is VPC and the network type of the CLB instance is classic network, any backend server of the CLB instance within a VPC setup shares the same VPC as the scaling group.
    • The vServer groups that you want to attach to the scaling group belong to the CLB instance.
    • The operation to attach vServer groups does not result in the total number of vServer groups exceeding the predefined quota limit. For information about the vServer group quota, see Limits .
  • When you call this operation to attach vServer groups, you must specify the following parameters:

    • LoadBalancerId: the ID of the CLB instance
    • VServerGroupId: the ID of the vServer group
    • Port: the port number of the vServer group


    Note If you attempt to attach the same vServer group to a scaling group multiple times over the identical port, the system regards each attempt as a separate vServer group attachment to the scaling group. In your request, if you include the same vServer group ID coupled with the same port number multiple times, only the first configuration of the vServer group and port number pairing is considered valid. Subsequent vServer group and port number parings are disregarded.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters


The region ID of the scaling group. Examples: cn-hangzhou and cn-shanghai. For information about regions and zones, see Regions and zones.


The ID of the scaling group.


The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see Ensure idempotence.


Specifies whether to add the existing Elastic Compute Service (ECS) instances or elastic container instances in the scaling group to the new vServer group. Valid values:

  • true
  • false

Default value: false.

VServerGroupsobject []Yes

The information about the vServer groups.

VServerGroupAttributesobject []No

The attributes of the vServer group.


The ID of the vServer group.


The weight of an ECS instance or elastic container instance as a backend server. Valid values: 0 to 100.

Default value: 50.


The port number over which Auto Scaling adds ECS instances or elastic container instances to the new vServer group. Valid values: 1 to 65535.


The ID of the CLB instance to which the new vServer group belongs.


Response parameters


The ID of the request.



Sample success responses


  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history