-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathACS::ECS::ElegantReplaceSystemDiskInSLBVServerGroup.yml
104 lines (104 loc) · 2.77 KB
/
ACS::ECS::ElegantReplaceSystemDiskInSLBVServerGroup.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
92
93
94
95
96
97
98
99
100
101
102
103
104
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS::ECS::ElegantReplaceSystemDiskInSLBVServerGroup
name-zh-cn: 更换SLB虚拟服务器组中实例的系统盘
en: Replaces the system disk in the instance of the SLB default Vserver group
zh-cn: 更换SLB虚拟服务器组中实例的系统盘
Parameters:
regionId:
Description:
en: The ID of region
zh-cn: 地域ID
Type: String
Default: '{{ ACS::RegionId }}'
imageId:
Description:
en: The ID of image
zh-cn: 镜像ID
Type: String
VServerGroupId:
Description:
en: The ID of SLB vserver group
zh-cn: SLB虚拟服务器组ID
Type: String
serverId:
Description:
en: The ID of ECS instance
zh-cn: ECS实例ID
Type: String
weight:
Description:
en: The weight of server
zh-cn: 后端服务器的权重
Type: Number
type:
Description:
en: The type of server
zh-cn: 后端服务器类型
Type: String
port:
Description:
en: The port of server
zh-cn: 后端服务器端口
Type: Number
Tasks:
- Name: setServerWeightToZero
Action: 'ACS::ExecuteApi'
Description:
en: Sets server weight to zero
zh-cn: 设置服务器权重为0
OnError: recoverServerWeight
Properties:
Service: SLB
API: SetVServerGroupAttribute
Parameters:
RegionId: '{{ regionId }}'
BackendServers:
'Fn::MergeMapToList':
- ServerId:
- '{{ serverId }}'
- Weight:
- 0
- Type:
- '{{ type }}'
- Port:
- '{{ port }}'
VServerGroupId: '{{ VServerGroupId }}'
- Name: replaceSystemDisk
Action: 'ACS::ECS::ReplaceSystemDisk'
Description:
en: Replaces the system disk of ECS instances
zh-cn: 替换ECS实例的系统盘
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ serverId }}'
imageId: '{{ imageId }}'
Outputs:
newSystemDiskId:
Type: String
ValueSelector: newSystemDiskId
- Name: recoverServerWeight
Action: 'ACS::ExecuteApi'
Description:
en: Sets the server weight to the original value
zh-cn: 将服务器权重设置为原始值
Properties:
Service: SLB
API: SetVServerGroupAttribute
Parameters:
RegionId: '{{ regionId }}'
BackendServers:
'Fn::MergeMapToList':
- ServerId:
- '{{ serverId }}'
- Weight:
- '{{ weight }}'
- Type:
- '{{ type }}'
- Port:
- '{{ port }}'
VServerGroupId: '{{ VServerGroupId }}'
Outputs:
newSystemDiskId:
Type: String
Value: '{{ replaceSystemDisk.newSystemDiskId }}'