Create a VServer group and add backend servers to the VServer group.

Request parameters

Name Parameters Required Description
Action String  Yes The action to perform. Valid value:

CreateVServerGroup

RegionId String  Yes The region ID of the SLB instance.

You can obtain the region ID by calling the DescribeRegions API.

LoadBalancerId String  Yes The ID of the Server Load Balancer instance.
VServerGroupName String  No The name of the VServer group.
BackendServers List No The list of backend servers added to the VServer group.

A VServer group can contain up to 20 backend servers.

If you do not specify this parameter, an empty VServer group is created.

Table 1. BackendServer
Name Parameters Required Description
ServerId String  Yes The ID of the ECS instance to add.
Port Integer Yes The port used by the backend server.

Valid value: 1-65535

Weight Integer Yes

The weight of the backend server. Valid value: [0,100]

The default value is 100. If the value is 0, no requests will be forwarded to the backend server.

Type String  Yes The type of the backend server. Valid value:
  • ecs: ECS instance (Default)
  • eni: Elastic Network Interface (ENI)

Response parameters

Name Type Required
RequestId String The ID of the request.
VServerGroupId String The ID of the VServer group.
Backendservers List The list of backend servers.

Examples

Request example

https://slb.aliyuncs.com/?Action=CreateVServerGroup
&RegionId=cn-hangzhou
&LoadBalancerId=lb-t4nj5vuz8ish9emfk1f20
&VServerGroupName=Group1
&BackendServers=[
    {"ServerId":"vm-233","Port":"80","Weight":"100"},
    {"ServerId":"vm-232","Port":"90","Weight":"100"},
    {"ServerId":"vm-232","Port":"90","Weight":"100"},
]
&CommonParameters

Response example

  • XML format
    <? xml version="1.0" encoding="utf-8"? >
    <CreateVServerGroupResponse>
    	<RequestId>9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C</RequestId>
    	<VServerGroupId>rsp-cige6j5e7p</VServerGroupId>
    	<BackendServers>
    		<BackendServer>
    			<ServerId>vm-233</ServerId>
    			<Port>80</Port>
    			<Weight>100</Weight>
    		</BackendServer>
    		<BackendServer>
    			<ServerId>vm-232</ServerId>
    			<Port>90</Port>
    			<Weight>100</Weight>
    		</BackendServer>
    		<BackendServer>
    			<ServerId>vm-231</ServerId>
    			<Port>70</Port>
    			<Weight>100</Weight>
    		</BackendServer>
    	</BackendServers>
    </CreateVServerGroupResponse>
  • JSON format
    {
      "RequestId":"9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
      "VServerGroupId":"rsp-cige6j5e7p",
      "BackendServers":{
      "BackendServer":[
        {"ServerId":"vm-233","Port":"80","Weight":"100"},
        {"ServerId":"vm-232","Port":"90","Weight":"100"},
        {"ServerId":"vm-232","Port":"90","Weight":"100"},
        ]
      }
    }