All Products
Search
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.

Debugging

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

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
ScalingGroupIdstringYes

The ID of the scaling group.

asg-bp18p2yfxow2dloq****
ClientTokenstringNo

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.

123e4567-e89b-12d3-a456-42665544****
ForceAttachbooleanNo

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.

false
VServerGroupsobject []Yes

The information about the vServer groups.

VServerGroupAttributesobject []No

The attributes of the vServer group.

VServerGroupIdstringNo

The ID of the vServer group.

lb-bp1u7etiogg38yvwz****
WeightintegerNo

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

Default value: 50.

100
PortintegerNo

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

22
LoadBalancerIdstringNo

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

rsp-bp1jp1rge****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Sample success responses

JSONformat

{
  "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