forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
application-business-migration.yml
323 lines (323 loc) · 10.4 KB
/
application-business-migration.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: This template shows the migration and switchover of a service from a single
zone to multiple zones. The template uses a simulated WordPress application service
to provide you with a clear view of the solution architecture. You must manually
perform the disaster recovery drill in the service console. This template can
be used with the single-zone application building template to complete application
business migration.
zh-cn: 同地域跨可用区容灾的解决方案2.0,介绍单可用区到跨可用区的迁移及切换演练,以模拟wordpress应用服务为例,帮助客户更清晰地了解方案架构;切换演练需要手动到对应产品的控制台操作,此模版配合单可用区应用搭建完成应用业务迁移。
Parameters:
VpcId:
Type: String
Label:
en: VPC ID
zh-cn: 虚拟专有网络ID
Description:
en: The VSwitch needs to join the VPC ID
zh-cn: 交换机需要加入的虚拟专有网络ID
AssociationProperty: ALIYUN::ECS::VPC::VPCId
MinLength: '5'
LoadBalancerId:
Type: String
Label:
en: SLB ID
zh-cn: 负载均衡ID
Description:
en: Need to add ECS for load balancing ID for back-end servers
zh-cn: ECS需要添加为后端服务器的负载均衡ID
MinLength: '5'
InstanceId:
Type: String
Label:
en: ECS Instance ID
zh-cn: 指定ECS的实例ID
Description:
en: Instance ID of ECS that requires custom mirroring
zh-cn: 需要自定义镜像的ECS的实例ID
MinLength: '5'
SecurityGroupId:
Type: String
Label:
en: Security Group ID
zh-cn: 安全组ID
Description:
en: The ECS needs to join the security group ID
zh-cn: ECS需要加入的安全组ID
MinLength: '5'
VSw2Zone:
Type: String
Label:
en: VSwitch 2 Available Zone
zh-cn: 交换机2可用区
Description:
en: Availability Zone ID, <font color='red'><b>need to maintain a different
available area from VSwitch under the existing VPC</b></font><br><b>note:
<font color='blue'>Before selecting, please confirm that the Availability
Zone supports the specification of creating ECS resources</font></b>
zh-cn: 可用区ID,<font color='red'><b>需要与现有VPC下的VSwitch保持不同的可用区域</b></font><br><b>注:
<font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSw2CidrBlock:
Type: String
Label:
en: VSwitch 2 CIDR Block
zh-cn: 交换机2网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.10.0/24
ImageName:
Type: String
Label:
en: Custom Mirror Name Prefix
zh-cn: 自定义镜像名称前缀
Description:
en: 'Custom image name prefix, final: Prefix +StackId.'
zh-cn: 自定义镜像名称前缀,最终为:前缀+StackId。
Default: WPImage
Ecs2GroupInstanceType:
Type: String
Label:
en: Specifications
zh-cn: 规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch availability
zone;</b></font><br>general specifications:<font color=''red''><b>ecs.c5.large</b></font><br>note:
a few zones do not support general specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写VSwitch可用区下可使用的规格;<br>通用规格:<font color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a
href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font
color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSw2Zone
Ecs2GroupSystemDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系统盘类型
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency:
<font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD
Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud:
<font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local
SSD Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>可选值:</b></font><br>[cloud_efficiency: <font
color=''green''>高效云盘</font>]<br>[cloud_ssd: <font color=''green''>SSD云盘</font>]<br>[cloud_essd:
<font color=''green''>ESSD云盘</font>]<br>[cloud: <font color=''green''>普通云盘</font>]<br>[ephemeral_ssd:
<font color=''green''>本地SSD盘</font>]'
Default: cloud_efficiency
AllowedValues:
- cloud_efficiency
- cloud_ssd
- cloud
- cloud_essd
- ephemeral_ssd
Ecs2GroupPassword:
Type: String
Label:
en: Login Password
zh-cn: 登录密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol
in).
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers,
()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: '8'
MaxLength: '30'
NoEcho: true
Ecs2GroupName:
Type: String
Label:
en: Instance/Host Name
zh-cn: 实例名/主机名
Description:
en: 'Instance name/Host name, Default: WP2, display created successfully [wp2-000,
wp2-001...]. '
zh-cn: 实例名/主机名,默认:WP2,创建成功显示[WP2-000, WP2-001....]。
Default: WP2
Ecs2GroupSystemDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系统盘空间
Description:
en: 'ECS system disk size, range of values: 40-500, units: GB.'
zh-cn: ECS系统盘大小,单位为GiB。取值范围:40~500。
Default: 40
MinValue: 40
MaxValue: 500
Ecs2GroupMaxAmount:
Type: Number
Label:
en: Amount
zh-cn: 实例数量
Description:
en: 'Number of instances, value range: 1~100.'
zh-cn: 实例数量, 取值范围:1~100。
Default: 1
MinValue: 1
MaxValue: 100
Resources:
CustomImage:
Type: ALIYUN::ECS::CustomImage
Properties:
InstanceId:
Ref: InstanceId
ImageName:
Fn::Join:
- '-'
- - Ref: ImageName
- Ref: ALIYUN::StackId
Tag:
- Key: best_practice
Value: '057'
VSw2:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSw2Zone
VpcId:
Ref: VpcId
CidrBlock:
Ref: VSw2CidrBlock
VSwitchName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Ecs2Group:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSw2
SecurityGroupId:
Ref: SecurityGroupId
ImageId:
Ref: CustomImage
AllocatePublicIP: false
HostName:
Fn::Join:
- ''
- - Ref: Ecs2GroupName
- -[0,3]
InstanceChargeType: PostPaid
InstanceName:
Fn::Join:
- ''
- - Ref: Ecs2GroupName
- -[0,3]
InstanceType:
Ref: Ecs2GroupInstanceType
IoOptimized: optimized
MaxAmount:
Ref: Ecs2GroupMaxAmount
Password:
Ref: Ecs2GroupPassword
SystemDiskCategory:
Ref: Ecs2GroupSystemDiskCategory
SystemDiskSize:
Ref: Ecs2GroupSystemDiskSize
Tags:
- Key: best_practice
Value: '057'
UserData:
Fn::Join:
- ''
- - "#!/bin/sh \n"
- "service httpd stop \n"
- "sleep 5 \n"
- "service httpd start \n"
DependsOn: CustomImage
SlbBackendServerAttachment:
Type: ALIYUN::SLB::BackendServerAttachment
Properties:
BackendServerList:
Fn::GetAtt:
- Ecs2Group
- InstanceIds
BackendServerWeightList:
- 100
LoadBalancerId:
Ref: LoadBalancerId
DependsOn:
- Ecs2Group
Outputs:
CustomImageId:
Description:
en: Custom Image ID
zh-cn: 自定义镜像ID
Value:
Fn::GetAtt:
- CustomImage
- ImageId
Ecs2HostNames:
Description:
en: List of host names for cloud server instances
zh-cn: 云服务器实例的主机名称列表
Value:
Fn::GetAtt:
- Ecs2Group
- HostNames
Ecs2InstanceIds:
Description:
en: List of cloud server instance IDs
zh-cn: 云服务器实例ID列表
Value:
Fn::GetAtt:
- Ecs2Group
- InstanceIds
Ecs2PrivateIps:
Description:
en: Private network Ip list of cloud server instances
zh-cn: 云服务器实例的私网Ip列表
Value:
Fn::GetAtt:
- Ecs2Group
- PrivateIps
VSwId:
Description:
en: VSwitch ID
zh-cn: 交换机ID
Value:
Fn::GetAtt:
- VSw2
- VSwitchId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcId
- LoadBalancerId
- InstanceId
- SecurityGroupId
Label:
default:
en: Existing Resource Information
zh-cn: 已存在资源信息
- Parameters:
- VSw2Zone
- VSw2CidrBlock
Label:
default: VPC
- Parameters:
- ImageName
- Ecs2GroupInstanceType
- Ecs2GroupSystemDiskCategory
- Ecs2GroupPassword
- Ecs2GroupName
- Ecs2GroupSystemDiskSize
- Ecs2GroupMaxAmount
Label:
default: ECS
TemplateTags:
- acs:solution:备份&容灾:同地域跨可用区容灾方案2.0-应用业务迁移