Updated on 2023-12-13 GMT+08:00

ECS.ServerGroup

Element Description

An ECS group allows you to create ECSs on different hosts, thereby improving service reliability. This function does not apply to existing ECSs. You cannot add existing ECSs to an ECS group.

Element Properties

Table 1 Property Description

Property

Required

Descripiton

name

No

ECS group name

Type: string

Value Description: Supports customization, for example, my-group.

Suggestion: Customize the value.

policies

Yes

Policy name list associated with the ECS group

Type: string

Value Description: anti-affinity: The servers in this group must be deployed on different hosts, the server group supports up to 16 elastic cloud servers. affinity: The servers in this group must be deployed on the same host. soft-anti-affinity: If possible, the servers in this group should be deployed on different hosts. If this goal cannot be achieved, they should still be arranged instead of generating failures. soft-affinity: If possible, the servers in this group should be deployed on the same host. If this goal cannot be achieved, they should still be arranged instead of generating failures.

Default: anti-affinity

Suggestion: Set the value based on the affinity policy.

Relationships Between Elements

None.

Return Value

Property

Type

Description

refID

string

ECS group ID

refName

string

ECS group name

Blueprint Example

tosca_definitions_version: huaweicloud_tosca_version_1_0 
 node_templates: 
   ecscs513: 
     type: HuaweiCloud.ECS.CloudServer 
     properties: 
       name: 
         get_input: ecscs513_name 
       imageId: 
         get_input: ecscs513_imageId 
       instances: 2 
       availabilityZone: 
         get_input: ecscs513_availabilityZone 
       nics: 
         - subnetId: 
             get_input: ecscs513_nics_0_subnetId 
       rootVolume: 
         volumeType: SATA 
         size: 40 
       flavor: 
         get_input: ecscs513_flavor 
       serverGroupId: 
         get_reference: ecssg4rg 
       vpcId: 
         get_input: ecscs513_vpcId 
     requirements: 
       - serverGroupId: 
           node: ecssg4rg 
   ecssg4rg: 
     type: HuaweiCloud.ECS.ServerGroup 
     properties: 
       policies: anti-affinity 
 inputs: 
   ecscs513_name: 
     description: ECS name 
     label: '' 
   ecscs513_imageId: 
     description: ID of the image used by the ECS 
     default: 327946b5-e954-42c3-949a-3312688c9269 
     label: '' 
   ecscs513_availabilityZone: 
     description: AZ to which the ECS belongs 
     label: '' 
   ecscs513_nics_0_subnetId: 
     description: Information about the NIC of the to-be-created ECS 
     label: '' 
   ecscs513_flavor: 
     description: ECS specifications 
     label: '' 
   ecscs513_vpcId: 
     description: ID of the VPC to which the ECS belongs 
     label: ''