-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathACS-ECS-CreateImage.json
238 lines (238 loc) · 7.46 KB
/
ACS-ECS-CreateImage.json
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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"en": "Creates an ECS image, applicable to scenarios requiring the creation of a custom image from an existing ECS instance, such as for backup and system migration. During configuration, users need to provide the following required parameter information: Region ID (regionId), which specifies the region of the ECS instance for which the image will be created, ECS Instance ID (instanceId), which identifies the instance from which the image will be created, and Image Name (imageName). Users can also choose whether to create an image only from the system disk (whetherOnlySystemDisk). After the image creation, the template will return the ID of the newly created image.",
"zh-cn": "创建一个ECS镜像,适用于需要从现有ECS实例创建自定义镜像的场景,例如备份和系统迁移。在配置过程中,用户需要提供以下必填参数信息,地域ID(regionId):用于指定需要创建镜像的ECS实例所在的地域,ECS实例ID(instanceId):用于指定要创建镜像的实例,以及图片名称(imageName)。用户还可以选择是否仅创建系统盘映像(whetherOnlySystemDisk)。创建镜像后,模板会返回新创建镜像的ID。",
"name-en": "Create Image",
"name-zh-cn": "创建镜像",
"categories": [
"image_manage",
"application_manage"
]
},
"Parameters": {
"regionId": {
"Type": "String",
"Label": {
"en": "RegionId",
"zh-cn": "地域ID"
},
"AssociationProperty": "RegionId",
"Default": "{{ ACS::RegionId }}"
},
"instanceId": {
"Label": {
"en": "InstanceId",
"zh-cn": "ECS实例ID"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
"AssociationPropertyMetadata": {
"RegionId": "regionId"
}
},
"imageName": {
"Label": {
"en": "ImageName",
"zh-cn": "新镜像的名称"
},
"Type": "String",
"Description": {
"en": "<p class=\"p\">Note:</p> <ul class=\"ul\"> <li class=\"li\">Length is 2~128 English or Chinese characters</li> <li class=\"li\"><font color='red'>must start with big or small letters or Chinese, not http:// and https://. </font></li> <li class=\"li\">Can contain numbers, colons (:), underscores (_), or dashes (-). </li> </ul>",
"zh-cn": "<p class=\"p\">注意:</p> <ul class=\"ul\"> <li class=\"li\">长度为2~128个英文或中文字符</li> <li class=\"li\"><font color='red'>必须以大小字母或中文开头,不能以http://和https://开头。</font></li> <li class=\"li\">可以包含数字、半角冒号(:)、下划线(_)或者短划线(-)。</li> </ul>"
}
},
"tags": {
"Label": {
"en": "Tags",
"zh-cn": "镜像标签"
},
"Type": "Json",
"AssociationProperty": "Tags",
"AssociationPropertyMetadata": {
"ShowSystem": false
},
"Default": []
},
"imageFamily": {
"Label": {
"en": "ImageFamily",
"zh-cn": "镜像族系"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Image::ImageFamily",
"Default": ""
},
"imageDescription": {
"Label": {
"en": "ImageDescription",
"zh-cn": "镜像描述"
},
"Type": "String",
"Default": ""
},
"resourceGroupId": {
"Label": {
"en": "ResourceGroupId",
"zh-cn": "资源组ID"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::ResourceGroup::ResourceGroupId",
"Default": ""
},
"detectionStrategy": {
"Label": {
"en": "DetectionStrategy",
"zh-cn": "镜像检测策略"
},
"Type": "String",
"AllowedValues": [
"Standard",
""
],
"Default": ""
},
"whetherOnlySystemDisk": {
"Label": {
"en": "WhetherOnlySystemDisk",
"zh-cn": "是否仅选择系统盘"
},
"Type": "Boolean",
"Default": false
},
"OOSAssumeRole": {
"Label": {
"en": "OOSAssumeRole",
"zh-cn": "OOS扮演的RAM角色"
},
"Type": "String",
"Default": ""
}
},
"RamRole": "{{ OOSAssumeRole }}",
"Tasks": [
{
"Name": "createImage",
"Action": "ACS::ECS::CreateImage",
"Description": {
"en": "Create new image with the specified image name and instance ID",
"zh-cn": "通过指定实例ID和镜像名称创建新的镜像"
},
"When": {
"Fn::Equals": [
"{{ whetherOnlySystemDisk }}",
false
]
},
"Properties": {
"regionId": "{{ regionId }}",
"imageName": "{{ imageName }}__on_{{ ACS::ExecutionId }}_at_{{ Acs::CurrentDate }}",
"instanceId": "{{ instanceId }}",
"tags": "{{tags}}",
"imageFamily": "{{ imageFamily }}",
"imageDescription": "{{ imageDescription }}",
"resourceGroupId": "{{ resourceGroupId }}",
"detectionStrategy": "{{ detectionStrategy }}"
},
"Outputs": {
"imageId": {
"ValueSelector": "imageId",
"Type": "String"
}
}
},
{
"Name": "createImageOnlySystemDisk",
"Action": "ACS::ECS::CreateImageForSystemDisk",
"Description": {
"en": "Create new system disk image with the specified image name and instance ID",
"zh-cn": "通过指定实例ID和镜像名称创建新的系统盘镜像"
},
"When": {
"Fn::Equals": [
"{{ whetherOnlySystemDisk }}",
true
]
},
"Properties": {
"regionId": "{{ regionId }}",
"imageName": "{{ imageName }}__on_{{ ACS::ExecutionId }}_at_{{ Acs::CurrentDate }}",
"instanceId": "{{ instanceId }}",
"tags": "{{tags}}",
"imageFamily": "{{ imageFamily }}",
"imageDescription": "{{ imageDescription }}",
"resourceGroupId": "{{ resourceGroupId }}",
"detectionStrategy": "{{ detectionStrategy }}"
},
"Outputs": {
"imageId": {
"ValueSelector": "imageId",
"Type": "String"
}
}
}
],
"Outputs": {
"imageId": {
"Type": "String",
"Value": {
"Fn::If": [
{
"Fn::Equals": [
"{{ whetherOnlySystemDisk }}",
false
]
},
"{{ createImage.imageId }}",
"{{ createImageOnlySystemDisk.imageId }}"
]
}
}
},
"Metadata": {
"ALIYUN::OOS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"regionId",
"instanceId"
],
"Label": {
"default": {
"zh-cn": "选择实例",
"en": "Select Ecs Instances"
}
}
},
{
"Parameters": [
"imageName",
"tags",
"whetherOnlySystemDisk",
"imageFamily",
"imageDescription",
"resourceGroupId",
"detectionStrategy"
],
"Label": {
"default": {
"zh-cn": "镜像设置",
"en": "Image Configure"
}
}
},
{
"Parameters": [
"OOSAssumeRole"
],
"Label": {
"default": {
"zh-cn": "高级选项",
"en": "Control Options"
}
}
}
]
}
}
}