更新时间:2023-04-20 GMT+08:00
分享

ECS.ServerGroup

模型说明

通过云服务器组功能,弹性云服务器在创建时,将尽量分散地创建在不同的主机上,提高业务的可靠性。对于现有的弹性云服务器,不支持添加云服务器组操作。

模型属性

表1 模型定义属性说明

属性

是否必选

描述

name

云服务器组名称

参数类型:string

取值说明:用户自定义,如my-group

取值约束:{u'regex': u'^[-_a-zA-Z0-9]*$', u'min_length': 1, u'max_length': 255}

使用建议:自定义

policies

与云服务器组关联的策略名称列表

参数类型:string

取值说明:anti-affinity -此组中的服务器必须安排到不同的主机;affinity -此组中的服务器必须安排在同一主机上;soft-anti-affinity –如果可能, 应将此组中的服务器安排到不同的主机, 但如果无法实现, 则仍应安排它们, 而不是导致生成失败;soft-affinity -如果可能, 应将此组中的服务器安排在同一主机上, 但如果无法实现, 则仍应安排它们, 而不是导致生成失败。

默认值:anti-affinity

取值约束:{u'valid_values': [u'anti-affinity']}

使用建议:用户自行根据亲和策略选择

关联关系

输出

属性

参数类型

描述

refID

string

云服务器组的ID

refName

string

云服务器组的名称

blueprint样例

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: 云服务器名称
    label: ''
  ecscs513_imageId:
    description: 云服务器使用的镜像ID
    default: 327946b5-e954-42c3-949a-3312688c9269
    label: ''
  ecscs513_availabilityZone:
    description: 云服务器对应可用区信息
    label: ''
  ecscs513_nics_0_subnetId:
    description: 待创建云服务器的网卡信息。
    label: ''
  ecscs513_flavor:
    description: 云服务器的规格
    label: ''
  ecscs513_vpcId:
    description: 云服务器所属VPC的ID
    label: ''
分享:

    相关文档

    相关产品