-
Notifications
You must be signed in to change notification settings - Fork 35
/
simple-windows-instance-with-exchange.yml
520 lines (520 loc) · 24 KB
/
simple-windows-instance-with-exchange.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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建ECS实例,配置VPC与安全组,自动部署Exchange Server 2013,含预装依赖与自动化脚本。
en: Create ECS instances, configure VPC and security groups, and automatically deploy Exchange Server 2013, including pre-installed dependencies and automation scripts.
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: 'The IP address range of the VPC in the CIDR Block form; <br>you can use
the following IP address ranges: <br><font color=''green''>[10.0.0.0/8]</font><br><font
color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
zh-cn: 专有网络IP地址段范围,<br>您可以使用以下的IP地址段:<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: Subnet of the created virtual switch,must be a sub-network segment of the
proprietary network and is not occupied by other VSwitches.
zh-cn: 创建的虚拟交换机的子网,必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.0.0/16
ZoneId:
Type: String
Label:
en: VSwitch Available Zone
zh-cn: 交换机可用区
Description:
en: Availability zone ID,<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,<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
ImageId:
Type: String
Label:
en: Image ID
zh-cn: 镜像
Description:
en: 'Image ID, About exchange server 2013 system requirements, see detail: <a
href=''https://docs.microsoft.com/en-us/exchange/exchange-2013-system-requirements-exchange-2013-help''
target=''_blank''><b><font color=''blue''>Exchange server 2013 system requirements</b></font></a>'
zh-cn: 镜像ID,关于Exchange Server2013系统要求,详见: <a href='https://docs.microsoft.com/zh-cn/exchange/exchange-2013-system-requirements-exchange-2013-help'
target='_blank'><b><font color='blue'>Exchange Server2013系统要求</b></font></a>
Default: win2012r2_64_dtc_9600_en-us_40G_alibase_20190318.vhd
SystemDiskCategory:
Type: String
Label:
en: 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
SystemDiskSize:
Type: Number
Label:
en: Server System Disk Space
zh-cn: 服务器系统盘空间
Description:
en: 'System disk size, units: GB.It is recommended to install no less than 40g
in accordance with the exchange installation requirements. For details, please
refer to: <a href=''https://docs.microsoft.com/en-us/exchange/exchange-2013-system-requirements-exchange-2013-help''
target=''_blank''><b><font color=''blue''>Exchange server 2013 configuration
requirements</b></font></a>'
zh-cn: 系统盘大小, 单位:GB。建议按照exchange安装要求不少于40G,详情请参照:<a href='https://docs.microsoft.com/zh-cn/exchange/exchange-2013-system-requirements-exchange-2013-help'
target='_blank'><b><font color='blue'>Exchange Server2013配置要求</b></font></a>
Default: 80
ExchangeDownloadPath:
Type: String
Label:
en: Exchange Image Download Path
zh-cn: Exchange镜像下载路径
Description:
en: 'Exchange image download path, see detail: <a href=''https://docs.microsoft.com/en-us/Exchange/new-features/build-numbers-and-release-dates''
target=''_blank''><b><font color=''blue''>Exchange image download path</b></font></a>'
zh-cn: Exchange镜像下载路径,详见: <a href='https://docs.microsoft.com/zh-cn/Exchange/new-features/build-numbers-and-release-dates'
target='_blank'><b><font color='blue'>Exchange镜像下载路径</b></font></a>
Default: https://download.microsoft.com/download/7/9/8/7982ED00-C0F5-44BB-8B40-768951AE4CC7/Exchange2013-x64-cu22.exe
InstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch availability
zone; Hardware requirements: 8 GB of memory;</b></font><br>general specifications:<font
color=''red''><b>ecs.c5.xlarge</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可用区下可使用的规格;硬件要求:8 GB内存;<br>通用规格:<font color='red'><b>ecs.c5.xlarge</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: ZoneId
Password:
Type: String
Label:
en: Instance 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
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName: Vpc-Exchange
Metadata:
ALIYUN::ROS::Designer:
id: 8a460de9-d7de-413f-9096-a23371cfebf2
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- IpProtocol: tcp
NicType: intranet
PortRange: 3389/3389
Priority: 1
SourceCidrIp: 0.0.0.0/0
Metadata:
ALIYUN::ROS::Designer:
id: 1167e267-d560-4520-8709-5fea5024cb0e
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
Metadata:
ALIYUN::ROS::Designer:
id: a24e6126-843a-4812-9984-897d0e957bde
ExchangeServer:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: ImageId
HostName: Exchange[0,3]
InstanceName: Exchange[0,3]
InstanceType:
Ref: InstanceType
MaxAmount: 1
Password:
Ref: Password
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskSize:
Ref: SystemDiskSize
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConHandle
- PowerShellCurlCli
- Fn::Join:
- ''
- - "[powershell] \r\n"
- "New-Item -Path \"C:\\Install_dir\" -Force -type directory\r\n"
- "cd C:\\Install_dir \r\n"
- "$client = new-object System.Net.WebClient\r\n"
- "$client.DownloadFile('https://ros-template-resources.oss-cn-beijing.aliyuncs.com/Exchange/vcredist_x64_2012.exe',\
\ 'C:\\Install_dir\\vcredist_2012.exe')\r\n"
- "$client.DownloadFile('https://ros-template-resources.oss-cn-beijing.aliyuncs.com/Exchange/vcredist_x64_2013.exe',\
\ 'C:\\Install_dir\\vcredist_2013.exe')\r\n"
- "$client.DownloadFile('https://ros-template-resources.oss-cn-beijing.aliyuncs.com/Exchange/UcmaRuntimeSetup.exe',\
\ 'C:\\Install_dir\\UcmaRuntimeSetup.exe')\r\n"
- $client.DownloadFile( "
- Ref: ExchangeDownloadPath
- "\", 'C:\\Install_dir\\Exchange.exe') \r\n"
- "Start-Process C:\\Install_dir\\Exchange.exe -args \"/extract:C:\\Install_dir\\\
Exchange2013 /quiet\" -Wait \r\n"
- "cd C:\\Install_dir \r\n"
- "New-Item \"pre_install_exchange.bat\" -type File \r\n"
- "Add-Content pre_install_exchange.bat \"C:\" \r\n"
- "Add-Content pre_install_exchange.bat 'powershell.exe C:\\Install_dir\\\
Install_Exchange.ps1' \r\n"
- "New-Item \"pre_check_exchange.bat\" -type File \r\n"
- "Add-Content pre_check_exchange.bat \"C:\" \r\n"
- "Add-Content pre_check_exchange.bat \"powershell.exe C:\\Install_dir\\\
pre_create_schtasks.ps1\" \r\n"
- "New-Item \"pre_create_schtasks.ps1\" -type File \r\n"
- "Add-Content pre_create_schtasks.ps1 '$service = Get-Service | Where\
\ Status -eq \"Running\"| Where name -eq \"ADWS\"' \r\n"
- "Add-Content pre_create_schtasks.ps1 '$service_timeout = 0'\r\n"
- "Add-Content pre_create_schtasks.ps1 'while($service.Name -ne \"ADWS\"\
){'\r\n"
- "Add-Content pre_create_schtasks.ps1 'cd C:\\Install_dir'\r\n"
- "Add-Content pre_create_schtasks.ps1 'New-Item \"start_install_ad.log\"\
\ -type File'\r\n"
- "Add-Content pre_create_schtasks.ps1 'Install-WindowsFeature ad-domain-services,\
\ RSAT-ADDS' \r\n"
- "Add-Content pre_create_schtasks.ps1 'Import-Module ADDSDeployment'\
\ \r\n"
- "Add-Content pre_create_schtasks.ps1 'Install-ADDSForest `' \r\n"
- "Add-Content pre_create_schtasks.ps1 '-CreateDnsDelegation:$false `'\
\ \r\n"
- "Add-Content pre_create_schtasks.ps1 '-DatabasePath \"C:\\Windows\\\
NTDS\" `' \r\n"
- "Add-Content pre_create_schtasks.ps1 '-DomainName \"example.com\" `'\
\ \r\n"
- "Add-Content pre_create_schtasks.ps1 '-DomainNetbiosName \"example\"\
\ `' \r\n"
- "Add-Content pre_create_schtasks.ps1 '-DomainMode \"Win2012R2\" `' \r\
\n"
- "Add-Content pre_create_schtasks.ps1 '-ForestMode \"Win2012R2\" `' \r\
\n"
- "Add-Content pre_create_schtasks.ps1 '-InstallDns:$true `' \r\n"
- "Add-Content pre_create_schtasks.ps1 '-LogPath \"C:\\Windows\\NTDS\"\
\ `' \r\n"
- "Add-Content pre_create_schtasks.ps1 '-NoRebootOnCompletion:$false `'\
\ \r\n"
- "Add-Content pre_create_schtasks.ps1 '-SysvolPath \"C:\\Windows\\SYSVOL\"\
\ `' \r\n"
- Add-Content pre_create_schtasks.ps1 '-SafeModeAdministratorPassword
(convertto-securestring "
- Ref: Password
- "\" -asplaintext -force) `' \r\n"
- "Add-Content pre_create_schtasks.ps1 '-Force:$true' \r\n"
- "Add-Content pre_create_schtasks.ps1 'cd C:\\Install_dir' \r\n"
- "Add-Content pre_create_schtasks.ps1 'New-Item install_ad_finish.txt\
\ -type File ' \r\n"
- "Add-Content pre_create_schtasks.ps1 'sleep 180'\r\n"
- "Add-Content pre_create_schtasks.ps1 '$service_timeout+=120'\r\n"
- "Add-Content pre_create_schtasks.ps1 'if ($timeout -eq 1800){break}'\r\
\n"
- "Add-Content pre_create_schtasks.ps1 'else'\r\n"
- "Add-Content pre_create_schtasks.ps1 '{$service = Get-Service | Where\
\ Status -eq \"Running\"| Where name -eq \"ADWS\"}}'\r\n"
- "Add-Content pre_create_schtasks.ps1 '$service_timeout > C:\\Install_dir\\\
service_timeout.log'\r\n"
- "Add-Content pre_create_schtasks.ps1 '$service > C:\\Install_dir\\service.log'\r\
\n"
- "Add-Content pre_create_schtasks.ps1 '$ping_timeout = 0'\r\n"
- "Add-Content pre_create_schtasks.ps1 'ping exchange000.example.com'\r\
\n"
- "Add-Content pre_create_schtasks.ps1 'while($lastExitCode -ne 0){'\r\
\n"
- "Add-Content pre_create_schtasks.ps1 '$ping_timeout += 180'\r\n"
- "Add-Content pre_create_schtasks.ps1 'sleep 180'\r\n"
- "Add-Content pre_create_schtasks.ps1 'if ($ping_timeout -eq 3600){break}'\r\
\n"
- "Add-Content pre_create_schtasks.ps1 'else {ping exchange000.example.com}}'\r\
\n"
- "Add-Content pre_create_schtasks.ps1 '$ping_timeout > C:\\Install_dir\\\
ping_timoout.log'\r\n"
- Add-Content pre_create_schtasks.ps1 'schtasks /create /TN "install_exchange"
/RU administrator /RP "
- Ref: Password
- "\" /SC ONSTART /TR \"C:\\Install_dir\\pre_install_exchange.bat\"' \r\
\n"
- "Add-Content pre_create_schtasks.ps1 'schtasks /run /TN \"install_exchange\"\
' \r\n"
- "New-Item \"install_packages.ps1\" -type File \r\n"
- "Add-Content install_packages.ps1 'Import-Module ServerManager' \r\n"
- "Add-Content install_packages.ps1 'Install-WindowsFeature Server-Media-Foundation,RPC-over-HTTP-proxy,\
\ RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt,\
\ RSAT-Clustering-PowerShell, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth,\
\ Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression,\
\ Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing,\
\ Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase,\
\ Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor,\
\ Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth,\
\ Web-WMI, Windows-Identity-Foundation, RSAT-ADDS, ADLDS, AS-HTTP-Activation,\
\ Desktop-Experience' \r\n"
- "Add-Content install_packages.ps1 'Install-WindowsFeature NET-Framework-45-Features'\
\ \r\n"
- "Add-Content install_packages.ps1 'cd C:\\Install_dir' \r\n"
- "Add-Content install_packages.ps1 'Start-Process C:\\Install_dir\\vcredist_2012.exe\
\ -args \"/install /quiet\" -Wait' \r\n"
- "Add-Content install_packages.ps1 'Start-Process C:\\Install_dir\\vcredist_2013.exe\
\ -args \"/install /quiet\" -Wait' \r\n"
- "Add-Content install_packages.ps1 'schtasks /create /TN \"pre_install_exchange\"\
\ /RU SYSTEM /SC ONSTART /TR \"C:\\Install_dir\\pre_check_exchange.bat\"\
' \r\n"
- "Add-Content install_packages.ps1 'New-Item install_package_finish.txt\
\ -type File ' \r\n"
- "Add-Content install_packages.ps1 'shutdown /r /f /t 1' \r\n"
- "New-Item \"Install_Exchange.ps1\" -type File \r\n"
- "Add-Content Install_Exchange.ps1 'if((Test-Path \"C:\\Install_dir\\\
finished.txt\")){' \r\n"
- "Add-Content Install_Exchange.ps1 \"cd C:\\Install_dir \" \r\n"
- "Add-Content Install_Exchange.ps1 \"}else{ \" \r\n"
- "Add-Content Install_Exchange.ps1 'ros-notify' \r\n"
- "Add-Content Install_Exchange.ps1 '$env = ls env:*' \r\n"
- "Add-Content Install_Exchange.ps1 '$env > C:\\Install_dir\\env.log'\r\
\n"
- "Add-Content Install_Exchange.ps1 'Start-Process C:\\Install_dir\\UcmaRuntimeSetup.exe\
\ -args \"/q\"' \r\n"
- "Add-Content Install_Exchange.ps1 'sleep 60' \r\n"
- "Add-Content Install_Exchange.ps1 'Start-Process C:\\Install_dir\\Exchange2013\\\
Setup.exe -args \"/IAcceptExchangeServerLicenseTerms /Mode: Install\
\ /Roles: Mailbox /on: ROS\" -RedirectStandardOutput \"C:\\Install_dir\\\
Install_Ex.log\" -Wait' \r\n"
- "Add-Content Install_Exchange.ps1 'sleep 180' \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_time = 0' \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_content = cat C:\\ExchangeSetupLogs\\\
ExchangeSetup.log | where { $_ -match \"Beginning processing Start-PreSetup\"\
}' \r\n"
- "Add-Content Install_Exchange.ps1 'while($install_ex_content -eq $null)\
\ {' \r\n"
- "Add-Content Install_Exchange.ps1 'if ($install_ex_time -ge 3600){break}'\
\ \r\n"
- "Add-Content Install_Exchange.ps1 ' else{' \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_time+=180' \r\n"
- "Add-Content Install_Exchange.ps1 'Get-Process -Name \"ExSetup\" | Stop-Process'\
\ \r\n"
- "Add-Content Install_Exchange.ps1 'Start-Process C:\\Install_dir\\Exchange2013\\\
Setup.exe -args \"/IAcceptExchangeServerLicenseTerms /Mode: Install\
\ /Roles: Mailbox /on: ROS\" -RedirectStandardOutput \"C:\\Install_dir\\\
Install_Ex.log\" -Wait' \r\n"
- "Add-Content Install_Exchange.ps1 'sleep 180' \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_content = cat C:\\ExchangeSetupLogs\\\
ExchangeSetup.log | where { $_ -match \"Beginning processing Start-PreSetup\"\
}}}'\r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_time > C:\\Install_dir\\\
install_ex_time.log' \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_finish_time = $install_ex_time'\
\ \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_finish_content = cat\
\ C:\\ExchangeSetupLogs\\ExchangeSetup.log | where { $_ -match \"Install\
\ is complete. Server state has been set to Active.\"}' \r\n"
- "Add-Content Install_Exchange.ps1 'while($install_ex_finish_content\
\ -eq $null) {' \r\n"
- "Add-Content Install_Exchange.ps1 'if ($install_ex_finish_time -ge 5400){break}'\
\ \r\n"
- "Add-Content Install_Exchange.ps1 ' else{' \r\n"
- "Add-Content Install_Exchange.ps1 'if ($install_ex_finish_time -ge 180)'\
\ \r\n"
- "Add-Content Install_Exchange.ps1 '{sleep $install_ex_finish_time' \r\
\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_finish_content = cat\
\ C:\\ExchangeSetupLogs\\ExchangeSetup.log | where { $_ -match \"Install\
\ is complete. Server state has been set to Active.\"}' \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_finish_time+=$install_ex_finish_time}}}'\
\ \r\n"
- "Add-Content Install_Exchange.ps1 '$install_ex_finish_time > C:\\Install_dir\\\
install_ex_finish_time.log' \r\n"
- "Add-Content Install_Exchange.ps1 'cd C:\\Install_dir' \r\n"
- "Add-Content Install_Exchange.ps1 \"New-Item finished.txt -type File\
\ \" \r\n"
- "Add-Content Install_Exchange.ps1 'ros-notify' \r\n"
- "Add-Content Install_Exchange.ps1 'schtasks /delete /TN \"pre_install_exchange\"\
\ /f'\r\n"
- "Add-Content Install_Exchange.ps1 'schtasks /delete /TN \"install_exchange\"\
\ /f'\r\n"
- "Add-Content Install_Exchange.ps1 'Remove-Item \"C:\\Install_dir\\Exchange.exe\"\
' \r\n"
- "Add-Content Install_Exchange.ps1 'Remove-Item \"C:\\Install_dir\\Exchange2013\\\
*\" -recurse' \r\n"
- "Add-Content Install_Exchange.ps1 'shutdown /r /f /t 1' \r\n"
- "Add-Content Install_Exchange.ps1 \"}\" \r\n"
- "cd C:\\Install_dir \r\n"
- "start $env:windir\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\
\ C:\\Install_dir\\install_packages.ps1 \r\n"
Metadata:
ALIYUN::ROS::Designer:
id: 18dcad40-6035-4492-9508-b20d0809294e
RosWaitConHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 0d558bef-8c24-4cf6-b66b-c186c328821e
RosWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 2
Handle:
Ref: RosWaitConHandle
Timeout: 7200
Metadata:
ALIYUN::ROS::Designer:
id: 7805f564-aea3-4b4a-98b9-5e98140c76b5
Outputs:
EcsInstanceId:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- ExchangeServer
- InstanceIds
EcsPublicIp:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- ExchangeServer
- PublicIps
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitchCidrBlock
Label:
default: VPC
- Parameters:
- ZoneId
- ImageId
- SystemDiskCategory
- SystemDiskSize
- ExchangeDownloadPath
- InstanceType
- Password
Label:
default: ECS
TemplateTags:
- acs:example:Windows应用服务:创建一个ExchangeServer2013的windows实例
ALIYUN::ROS::Designer:
0d558bef-8c24-4cf6-b66b-c186c328821e:
position:
x: 544
y: 60
size:
height: 60
width: 60
z: 0
1167e267-d560-4520-8709-5fea5024cb0e:
position:
x: 370
y: 61
size:
height: 60
width: 60
z: 1
18dcad40-6035-4492-9508-b20d0809294e:
position:
x: 370
y: 213
size:
height: 60
width: 60
z: 2
7805f564-aea3-4b4a-98b9-5e98140c76b5:
position:
x: 544
y: 222
size:
height: 60
width: 60
z: 0
8a460de9-d7de-413f-9096-a23371cfebf2:
embeds:
- 1167e267-d560-4520-8709-5fea5024cb0e
- a24e6126-843a-4812-9984-897d0e957bde
position:
x: 172
y: 5
size:
height: 344
width: 341.0537109375
z: 0
a24e6126-843a-4812-9984-897d0e957bde:
embeds:
- 18dcad40-6035-4492-9508-b20d0809294e
position:
x: 313
y: 177
size:
height: 147
width: 172
z: 1
d4d1147a-6c84-49fc-a5ef-e9d60b89e64b:
source:
id: 7805f564-aea3-4b4a-98b9-5e98140c76b5
target:
id: 0d558bef-8c24-4cf6-b66b-c186c328821e
z: 1
e7877e1f-7e19-46e2-a348-e481001bd4ac:
source:
id: 18dcad40-6035-4492-9508-b20d0809294e
target:
id: 1167e267-d560-4520-8709-5fea5024cb0e
z: 1