Template name
ACS-ECS-BulkyReplaceSystemDiskInSLBVServerGroup: Replaces the system disks of multiple ECS instances in an SLB virtual service group.
Template description
Replaces the system disks of multiple ECS instances in an SLB virtual service group.
Template type
Automation
Owner
Alibaba Cloud
Input parameters
|
Parameter name |
Description |
Type |
Required |
Default value |
Constraints |
|
imageId |
The source image ID. |
String |
Yes |
||
|
VServerGroupId |
The server group ID. |
String |
Yes |
||
|
rateControl |
The concurrency ratio for task execution. |
JSON |
No |
{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 1} |
|
|
OOSAssumeRole |
The RAM role assumed by OOS. |
String |
No |
“” |
Output parameters
|
Parameter name |
Description |
Type |
|
newSystemDiskIds |
List |
Required access policy
{
"Version": "1",
"Statement": [
{
"Action": [
"slb:DescribeVServerGroupAttribute",
"slb:SetVServerGroupAttribute"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ecs:DescribeDisks",
"ecs:DescribeInstances",
"ecs:ReplaceSystemDisk",
"ecs:StartInstance",
"ecs:StopInstance"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Details
ACS-ECS-BulkyReplaceSystemDiskInSLBVServerGroup details
Template content
FormatVersion: OOS-2019-06-01
Description:
en: Bulky replaces system disk of ECS instances in Vserver group
zh-cn: Batch replaces the system disks of ECS instances in an SLB virtual service group.
name-en: ACS-ECS-BulkyReplaceSystemDiskWithSLBVServerGroup
name-zh-cn: Batch replaces the system disks of ECS instances in an SLB virtual service group.
categories:
- slb_management
Parameters:
imageId:
Label:
en: ImageId
zh-cn: Source image ID
Type: String
AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
VServerGroupId:
Label:
en: VServerGroupId
zh-cn: Server group ID
Type: String
rateControl:
Label:
en: RateControl
zh-cn: The concurrency ratio for 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: describeVServerGroupAttribute
Action: ACS::ExecuteApi
Description:
en: Views vserver group attribute
zh-cn: Gets the properties of the service group.
Properties:
Service: SLB
API: DescribeVServerGroupAttribute
Parameters:
VServerGroupId: '{{ VServerGroupId }}'
Outputs:
BackendServers:
Type: List
ValueSelector: BackendServers.BackendServer[]
- Name: replaceSystemDisk
Action: ACS::ECS::ElegantReplaceSystemDiskInSLBVServerGroup
Description:
en: Replaces the system disk of ECS instances
zh-cn: Replaces the system disk.
Properties:
VServerGroupId: '{{ vServerGroupId }}'
imageId: '{{ imageId }}'
serverId:
'Fn::Select':
- ServerId
- '{{ ACS::TaskLoopItem }}'
weight:
'Fn::Select':
- Weight
- '{{ ACS::TaskLoopItem }}'
type:
'Fn::Select':
- Type
- '{{ ACS::TaskLoopItem }}'
port:
'Fn::Select':
- Port
- '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ describeVServerGroupAttribute.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
- VServerGroupId
Label:
default:
zh-cn: Configure parameters
en: Configure Parameters
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Advanced options
en: Advanced options