Nom du modèle
ACS-ECS-CreateImage
Description du modèle
Ce modèle crée une image personnalisée à partir d'une instance Elastic Compute Service (ECS) existante, afin de sauvegarder l'instance ou de migrer le système. Spécifiez l'ID de région, l'ID d'instance et le nom de l'image. Vous pouvez définir le paramètre `whetherOnlySystemDisk` pour créer une image à partir du seul disque système. Une fois l'image créée, le modèle renvoie son ID.
Type de modèle
Automatisé
Propriétaire
Alibaba Cloud
Paramètres d'entrée
|
Paramètre |
Description |
Type |
Obligatoire |
Valeur par défaut |
Limite |
|
instanceId |
ID de l'instance ECS. |
String |
Oui |
||
|
imageName |
Nom de la nouvelle image. |
String |
Oui |
||
|
regionId |
ID de la région. |
String |
Non |
{{ ACS::RegionId }} |
|
|
tags |
Tags de l'image. |
Json |
Non |
[] |
|
|
imageFamily |
Famille d'images. |
String |
Non |
False |
|
|
imageDescription |
Description de l'image. |
String |
Non |
"" |
|
|
resourceGroupId |
ID du groupe de ressources. |
String |
Non |
"" |
|
|
detectionStrategy |
Stratégie de détection des images. |
String |
Non |
"" |
|
|
whetherOnlySystemDisk |
Indique si l'image doit être créée à partir du seul disque système. |
Boolean |
Non |
False |
|
|
OOSAssumeRole |
Rôle RAM assumé par OOS. |
String |
Non |
"" |
Paramètres de sortie
|
Paramètre |
Description |
Type |
|
imageId |
String |
Politique d'autorisation requise pour exécuter le modèle
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateImage",
"ecs:CreateSnapshot",
"ecs:DescribeDisks",
"ecs:DescribeImages",
"ecs:DescribeInstances",
"ecs:DescribeSnapshots"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Détails
Pour plus d'informations, consultez le fichier ACS-ECS-CreateImage.yml sur GitHub.
Contenu du modèle
Note:
Description:
en: 'Creates an ECS image from an existing ECS instance. Use this for tasks such as system backup and migration. You must provide the region ID, instance ID, and image name. You can also choose to create an image from only the system disk. The template returns the new image ID after creation.'
zh-cn: 'Creates an ECS image from an existing ECS instance. Use this for tasks such as system backup and migration. You must provide the region ID, instance ID, and image name. You can also choose to create an image from only the system disk. The template returns the new image ID after creation.'
name-en: Create Image
name-zh-cn: Create Image
categories:
- image_manage
- application_manage
Parameters:
regionId:
Type: String
Label:
en: Region ID
zh-cn: Region ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
instanceId:
Label:
en: Instance ID
zh-cn: ECS Instance ID
Type: String
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
AssociationPropertyMetadata:
RegionId: regionId
imageName:
Label:
en: Image Name
zh-cn: New Image Name
Type: String
Description:
en: <p>Note:</p> <ul> <li>The name must be 2 to 128 characters in length.</li> <li><font>It must start with a letter or a Chinese character. It cannot start with http:// or https://.</font></li> <li>It can contain numbers, colons (:), underscores (_), and hyphens (-).</li> </ul>
zh-cn: <p>Note:</p> <ul> <li>The name must be 2 to 128 characters in length.</li> <li><font>It must start with a letter or a Chinese character. It cannot start with http:// or https://.</font></li> <li>It can contain numbers, colons (:), underscores (_), and hyphens (-).</li> </ul>
tags:
Label:
en: Tags
zh-cn: Image Tags
Type: Json
AssociationProperty: Tags
AssociationPropertyMetadata:
ShowSystem: false
Default: []
imageFamily:
Label:
en: Image Family
zh-cn: Image Family
Type: String
AssociationProperty: ALIYUN::ECS::Image::ImageFamily
Default: ''
imageDescription:
Label:
en: Image Description
zh-cn: Image Description
Type: String
Default: ''
resourceGroupId:
Label:
en: Resource Group ID
zh-cn: Resource Group ID
Type: String
AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId
Default: ''
detectionStrategy:
Label:
en: Detection Strategy
zh-cn: Image Detection Strategy
Type: String
AllowedValues:
- Standard
- ''
Default: ''
whetherOnlySystemDisk:
Label:
en: Create from System Disk Only
zh-cn: Create from System Disk Only
Type: Boolean
Default: false
OOSAssumeRole:
Label:
en: OOS Assume Role
zh-cn: The RAM role for OOS to assume
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Conditions:
NotOnlySystemDisk:
Fn::Equals:
- '{{ whetherOnlySystemDisk }}'
- false
OnlySystemDisk:
Fn::Equals:
- '{{ whetherOnlySystemDisk }}'
- true
Tasks:
- Name: createImage
Action: ACS::ECS::CreateImage
Description:
en: Creates a new image with the specified instance ID and image name.
zh-cn: Creates a new image with the specified instance ID and image name.
When: NotOnlySystemDisk
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: Creates a new system disk image with the specified instance ID and image name.
zh-cn: Creates a new system disk image with the specified instance ID and image name.
When: OnlySystemDisk
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: Select ECS Instance
en: Select ECS Instance
- Parameters:
- imageName
- tags
- whetherOnlySystemDisk
- imageFamily
- imageDescription
- resourceGroupId
- detectionStrategy
Label:
default:
zh-cn: Image Settings
en: Image Settings
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: Advanced Options
en: Advanced Options