全部产品
Search
文档中心

CloudOps Orchestration Service:ACS-ECS-CloneInstancesAcrossAZ

更新时间:Dec 21, 2025

Nama Template

ACS-ECS-CloneInstancesAcrossAZ mengkloning beberapa instans ECS lintas zona.

Eksekusi Sekarang

Deskripsi Template

Mengkloning beberapa instance Elastic Compute Service (ECS) sekaligus di berbagai zona.

Tipe Template

Otomatis

Pemilik

Alibaba Cloud

Parameter Masukan

Parameter

Deskripsi

Tipe

Diperlukan

Nilai Default

Batasan

targets

Instans target

Json

Ya

targetSecurityGroupId

ID grup keamanan dari instance ECS yang dikloning.

String

Ya

targetVSwitchId

ID vSwitch dari instance ECS yang dikloning. Jika Anda menentukan parameter ini, zona tempat instance ECS dikloning akan ditentukan.

String

Ya

targetTags

Tag dari instance ECS yang dikloning.

Json

Ya

regionId

ID wilayah.

String

Tidak

{{ ACS::RegionId }}

targetResourceGroupId

ID grup sumber daya tempat instance ECS yang dikloning ditambahkan.

String

Tidak

targetInstanceType

Tipe instance dari instance ECS yang dikloning.

String

Tidak

targetInstanceChargeType

Metode penagihan dari instance ECS yang dikloning. Secara default, parameter ini disetel ke PostPaid.

String

Tidak

PostPaid

targetPeriodUnit

Satuan durasi langganan yang tersedia jika metode penagihan instance ECS yang dikloning disetel ke langganan. Secara default, parameter ini disetel ke Bulan.

String

Tidak

targetPeriod

Durasi langganan yang tersedia jika metode penagihan instance ECS yang dikloning disetel ke langganan. Secara default, parameter ini disetel ke 1.

Number

Tidak

1

targetDeploymentSetId

ID set penyebaran tempat instance ECS yang dikloning termasuk.

String

Tidak

targetInstanceName

Nama instans

String

Tidak

targetHostName

Nama host dari instance ECS yang dikloning.

String

Tidak

rateControl

Laju konkurensi dan jumlah toleransi kesalahan untuk eksekusi tugas dalam loop

Json

Tidak

{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}

OOSAssumeRole

Peran Resource Access Management (RAM) yang diasumsikan oleh CloudOps Orchestration Service (OOS).

String

Tidak

""

Parameter Keluaran

Parameter

Deskripsi

Tipe

instanceIds

List

Kebijakan Izin yang Diperlukan untuk Menjalankan Template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:CreateImage",
                "ecs:DeleteImage",
                "ecs:DescribeAvailableResource",
                "ecs:DescribeDisks",
                "ecs:DescribeImages",
                "ecs:DescribeInstances",
                "ecs:DescribeVSwitches",
                "ecs:RunInstances"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Detail

Detail ACS-ECS-CloneInstancesAcrossAZ

Konten Template

FormatVersion: OOS-2019-06-01
Description:
  en: Clones ECS instances in batches across availability zones.
  zh-cn: 跨可用区批量克隆ECS实例
  name-en: ACS-ECS-CloneInstancesAcrossAZ
  name-zh-cn: 跨可用区批量克隆ECS实例
  categories:
    - cross_region
Parameters:
  regionId:
    Type: String
    Label:
      en: Region ID
      zh-cn: 地域ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Label:
      en: Target Instances
      zh-cn: 目标实例
    Type: Json
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  targetSecurityGroupId:
    Label:
      en: The security group ID for the new instances.
      zh-cn: 新实例的安全组ID
    Type: String
    AssociationProperty: 'ALIYUN::ECS::SecurityGroup::SecurityGroupId'
    AssociationPropertyMetadata:
      RegionId: regionId
  targetVSwitchId:
    Label:
      en: The vSwitch ID for the new instances. This parameter determines the destination zone.
      zh-cn: 新实例的交换机ID,填写本参数时将会决定目的可用区
    Type: String
    AssociationProperty: 'ALIYUN::VPC::VSwitch::VSwitchId'
    AssociationPropertyMetadata:
      RegionId: regionId
      Filters:
        - SecurityGroupId: targetSecurityGroupId
  targetResourceGroupId:
    Label:
      en: The ID of the resource group to which the new instances will be added.
      zh-cn: 新实例将加入的目的资源组ID
    Type: String
    Default: ' '
  targetInstanceType:
    Label:
      en: The instance type for the new instances.
      zh-cn: 新实例的规格
    Type: String
    AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
    AssociationPropertyMetadata:
      RegionId: regionId
    Default: ' '
  targetTags:
    Label:
      en: The tags for the new instances.
      zh-cn: 新实例的标签
    Type: Json
    AssociationProperty: Tags
    AssociationPropertyMetadata:
      ShowSystem: false
  targetInstanceChargeType:
    Label:
      en: The billing method for the new instances. The default is pay-as-you-go.
      zh-cn: 新实例的付费模式,默认按量付费
    Type: String
    AllowedValues:
      - PrePaid
      - PostPaid
    Default: PostPaid
  targetPeriodUnit:
    Label:
      en: The unit of the subscription duration. This parameter is required only when the billing method is subscription (PrePaid). The default is Month.
      zh-cn: 当新实例的付费方式选择包年包月时,请在此处选择时长单位,默认单位是月
    Type: String
    AllowedValues:
      - Week
      - Month
      - ' '
    Default: ' '
  targetPeriod:
    Label:
      en: The subscription duration. This parameter is required only when the billing method is subscription (PrePaid). The default is 1.
      zh-cn: 当新实例的付费方式选择包年包月时,请在此处填写时长数,默认值为1
    Type: Number
    Default: 1
  targetDeploymentSetId:
    Label:
      en: The deployment set ID for the new instances.
      zh-cn: 新实例的部署集ID
    Type: String
    Default: ' '
  targetInstanceName:
    Label:
      en: The name of the new instances.
      zh-cn: 新实例的名称
    Type: String
    Default: ' '
  targetHostName:
    Label:
      en: The hostname of the new instances.
      zh-cn: 新实例的主机名称
    Type: String
    Default: ' '
  rateControl:
    Label:
      en: The concurrency rate and error tolerance for the loop task.
      zh-cn: 循环任务执行的并发率及容错数
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: The RAM role that OOS assumes.
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Gets the specified ECS instances.
      zh-cn: 获取ECS实例
    Action: 'ACS::SelectTargets'
    Properties:
      RegionId: '{{regionId}}'
      ResourceType: 'ALIYUN::ECS::Instance'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'

  - Name: cloneInstancesAcrossAZ
    Action: 'ACS::Template'
    Description:
      en: Clone instances
      zh-cn: 克隆实例
    Properties:
      TemplateName: 'ACS::ECS::CloneInstanceAcrossAZ'
      Parameters:
        imageName: 'img-{{ ACS::TaskLoopItem }}-{{ACS::ExecutionId}}'
        instanceId: '{{ ACS::TaskLoopItem }}'
        targetSecurityGroupId: '{{ targetSecurityGroupId }}'
        targetResourceGroupId: '{{ targetResourceGroupId }}'
        targetVSwitchId: '{{ targetVSwitchId }}'
        regionId: '{{ regionId }}'
        targetInstanceName: '{{ targetInstanceName }}'
        targetInstanceChargeType: '{{ targetInstanceChargeType }}'
        targetPeriodUnit: '{{ targetPeriodUnit }}'
        targetPeriod: '{{ targetPeriod }}'
        targetInstanceType: '{{ targetInstanceType }}'
        targetHostName: '{{ targetHostName }}'
        targetDeploymentSetId: '{{ targetDeploymentSetId }}'
        tags: '{{ targetTags }}'
        OOSAssumeRole: '{{OOSAssumeRole}}'
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        instanceIds:
          AggregateType: 'Fn::ListJoin'
          AggregateField: instanceId
    Outputs:
      instanceId:
        ValueSelector: instanceId
        Type: String
Outputs:
  instanceIds:
    Value: '{{ cloneInstancesAcrossAZ.instanceIds }}'
    Type: List
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - targetSecurityGroupId
          - targetVSwitchId
          - targetInstanceType
          - targetTags
          - targetInstanceChargeType
          - targetPeriodUnit
          - targetPeriod
          - targetResourceGroupId
          - targetDeploymentSetId
          - targetInstanceName
          - targetHostName
        Label:
          default:
            zh-cn: 设置参数
            en: Configure Parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: 选择实例
            en: Select Instances
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 高级选项
            en: Advanced Options