All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyReplaceSystemDiskInSLBDefaultServerGroup

Last Updated:Jun 03, 2026

Template name

ACS-ECS-BulkyReplaceSystemDiskInSLBDefaultServerGroup: Batch-replaces system disks of ECS instances in an SLB default server group.

Execute now

Description

Batch-replaces system disks of ECS instances in an SLB default server group.

Template type

Automation

Owner

Alibaba Cloud

Input parameters

Parameter name

Description

Type

Required

Default value

Constraints

imageId

Source image ID.

String

Yes

loadBalancerId

SLB instance ID.

String

Yes

rateControl

Task execution concurrency rate.

Json

No

{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 1}

OOSAssumeRole

RAM role assumed by OOS.

String

No

“”

Output parameters

Parameter name

Description

Type

newSystemDiskIds

List

Required access policy

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "slb:DescribeLoadBalancerAttribute",
                "slb:SetBackendServers"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ecs:DescribeDisks",
                "ecs:DescribeInstances",
                "ecs:ReplaceSystemDisk",
                "ecs:StartInstance",
                "ecs:StopInstance"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Details

ACS-ECS-BulkyReplaceSystemDiskInSLBDefaultServerGroup details

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky replaces system disk of ECS instances in default server group
  zh-cn: Replaces the system disks of ECS instances in the default server group of an SLB instance in batches.
  name-en: ACS-ECS-BulkyReplaceSystemDiskInSLBDefaultServerGroup
  name-zh-cn: Replaces the system disks of ECS instances in the default server group of an SLB instance in batches.
  categories:
    - slb_management
Parameters:
  imageId:
    Label:
      en: The image ID for the ECS instance
      zh-cn: The ID of the source image.
    Type: String
    AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
  loadBalancerId:
    Label:
      en: LoadBalancerId
      zh-cn: The ID of the SLB instance.
    Type: String
  rateControl:
    Label:
      en: RateControl
      zh-cn: The concurrency rate for the task execution.
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 1
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: The RAM role that OOS assumes.
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: describeLoadBalancerAttribute
    Action: ACS::ExecuteApi
    Description:
      en: Views loadbalancer attribute
      zh-cn: Gets the attributes of the default server group of the SLB instance.
    Properties:
      Service: SLB
      API: DescribeLoadBalancerAttribute
      Parameters:
        LoadBalancerId: '{{ loadBalancerId }}'
    Outputs:
      BackendServers:
        Type: List
        ValueSelector: BackendServers.BackendServer[]
      port:
        Type: Number
        ValueSelector: ListenerPorts.ListenerPort[]
  - Name: replaceSystemDisk
    Action: ACS::ECS::ElegantReplaceSystemDiskInSLBDefaultServerGroup
    Description:
      en: Replaces the system disk of ECS instances
      zh-cn: Replaces the system disk.
    Properties:
      loadBalancerId: '{{ LoadBalancerId }}'
      imageId: '{{ imageId }}'
      serverId:
        'Fn::Select':
          - ServerId
          - '{{ ACS::TaskLoopItem }}'
      weight:
        'Fn::Select':
          - Weight
          - '{{ ACS::TaskLoopItem }}'
      type:
        'Fn::Select':
          - Type
          - '{{ ACS::TaskLoopItem }}'
      port: '{{ describeLoadBalancerAttribute.port }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ describeLoadBalancerAttribute.BackendServers }}'
      Outputs:
        newSystemDiskIds:
          AggregateType: Fn::ListJoin
          AggregateField: newSystemDiskId
    Outputs:
      newSystemDiskId:
        Type: String
        ValueSelector: newSystemDiskId
Outputs:
  newSystemDiskIds:
    Type: List
    Value: '{{ replaceSystemDisk.newSystemDiskIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - imageId
          - loadBalancerId
        Label:
          default:
            zh-cn: Configure parameters.
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced options.
            en: Control Options