Updated on 2022-02-22 GMT+08:00

ULB.Member

Element Description

For ECSs under a shared load balancer, one pool corresponds to multiple ECSs. You can add or delete ECSs as required.

Element Properties

Table 1 Property Description

Property

Mandatory

Descripiton

weight

No

Weight of an ECS, which determines the proportion of requests to be forwarded compared with other members in the same ECS group

Type: integer

Value Description: Customize the value. The value is an integer between 1 and 256, for example, 3.

Value Constraint: {u'in_range': [0, 256]}

Suggestion: Set the value based on the live environment.

address

No

Private IP address of the backend ECS added to the listener

Type: ip array

Value Description: private network IP address generated after an ECS is created, for example, 192.168.0.45

Value Constraint: The IP address must be the private network IP address of the existing ECS instance. The ECS and listener must be in the same subnet. Set either address or serverId.

Suggestion: You are advised to drag the object to the ECS.CloudServer and use {get_attribute: [ECS element, privateIps]} to automatically generate the value. Alternatively, obtain the private network IP address on the ECS console and enter it accordingly.

poolId

Yes

ID of the ECS group to which the ECS is to be added

Type: string

Value Description: ID of the ECS group to which the ECS is to be added

Suggestion: Use the get_reference function to automatically generate the value.

subnetId

Yes

ID of the subnet where the ECS and listener are located

Type: Cloud.VPC.Subnet.All.Id

Value Description: ID of the subnet of the VPC

Value Constraint: The subnet ID must be the same as that in the listener.

Suggestion: Drag the object to VPC.Subnet and use {get_attribute: [element name, neutron_subnet_id]} to automatically generate the value. Alternatively, obtain the subnet ID on the VPC details page.

serverId

No

ID of the backend ECS added to the listener

Type: string array

Value Description: ID generated after an ECS is created, for example, b7a65ad3-c031-43cc-93ac-ac6dbdbd2295.

Value Constraint: The ID must be the ID of an existing ECS instance. The ECS and listener must be in the same subnet. Set either address or serverId.

Suggestion: You are advised to drag the object into ECS.CloudServer and use {get_attribute: [ECS element, refID]} to automatically generate the value. Alternatively, search for the ID on the ECS console and enter it accordingly.

port

Yes

Backend port of the ECS

Type: integer

Value Description: Customize the value. The value is an integer between 1 and 65535, for example, 8089.

Value Constraint: {u'in_range': [1, 65535]}

Suggestion: Set the value based on the live environment.

Relationships Between Elements

Table 2 Relationship description

Description

Target

Connected

VPC.Subnet

Connected

ECS.CloudServer

Inclusion

ULB.Pool

Return Value

Property

Type

Description

refID

string

Backend ECS instance ID

poolId

string

ID of the ECS group to which the backend ECS belongs

Blueprint Example

tosca_definitions_version: cloud_tosca_version_1_0
inputs:
  pool_protocol:
     description: 'ECS group protocol, which must be consistent with the listener protocol' 
  pool_listenerId:
     description: Belonged listener ID 
  pool_lbAlgorithm:
     description: Allocation policy type 
  delay:
     description: Interval for health check (unit: s) 
  timeout:
     description: Maximum timeout duration for health check (unit: s) 
  max_retries:
    description: The number of consecutive times a cloud server fails or passes health checks, after which the health check status of the backend cloud server changes from success to fail or from fail to success, respectively.
  type:
     description: Health check protocol 
  subnetId:
     description: ID of the subnet to which the ECS and listener belong. It is the subnet ID rather than the subnet network ID.
  address:
     description: Private IP address of the backend ECS added to the listener 
  port:
     description: Backend port of the ECS 
node_templates:
  pool:
    type: Cloud.ULB.Pool
    properties:
      protocol:
        get_input: pool_protocol
      listenerId:
        get_input: pool_listenerId
      lbAlgorithm:
        get_input: pool_lbAlgorithm
  health-monitor:
    type: Cloud.ULB.Healthmonitor
    properties:
      delay:
        get_input: delay
      timeout:
        get_input: timeout
      maxRetries:
        get_input: max_retries
      type:
        get_input: type
      poolId:
        get_reference: pool
    requirements:
      - poolId:
          node: pool
  member:
    type: Cloud.ULB.Member
    properties:
      subnetId:
        get_input: subnetId
      address:
        - get_input: address
      port:
        get_input: port
      poolId:
        get_reference: pool
    requirements:
      - poolId:
          node: pool