forked from aliyun/oos-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathACS-ECS-BulkyReplaceSystemDiskInSLBVServerGroup.yml
91 lines (91 loc) · 2.53 KB
/
ACS-ECS-BulkyReplaceSystemDiskInSLBVServerGroup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
FormatVersion: OOS-2019-06-01
Description:
en: Bulky replaces system disk of ECS instances in Vserver group.
zh-cn: 批量替换SLB虚拟服务组内ECS实例的系统盘。
name-en: ACS-ECS-BulkyReplaceSystemDiskWithSLBVServerGroup
name-zh-cn: 批量替换SLB虚拟服务组内ECS实例的系统盘
categories:
- slb_management
Parameters:
imageId:
Description:
en: The image ID for the ECS instance.
zh-cn: 源镜像ID。
Type: String
AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
VServerGroupId:
Description:
en: The ID of the vserver group.
zh-cn: 服务组ID。
Type: String
rateControl:
Description:
en: Concurrency ratio of task execution.
zh-cn: 任务执行的并发比率。
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 1
OOSAssumeRole:
Description:
en: The RAM role to be assumed by OOS.
zh-cn: OOS扮演的RAM角色。
Type: String
Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: describeVServerGroupAttribute
Action: ACS::ExecuteApi
Description:
en: Views vserver group attribute.
zh-cn: 获取服务组属性。
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: 更换系统盘。
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 }}'