Nom du modèle
ACS-ECS-BulkyReplaceSystemDisk : remplace les disques système des instances ECS par lots
Description du modèle
Remplace les disques système de plusieurs instances Elastic Compute Service (ECS) par lot, notamment pour les mises à niveau du système ou la récupération après incident. Les paramètres requis sont regionId (région des instances ECS), imageId (image du nouveau disque système) et targets (instances ECS cibles). À l'issue de l'exécution, le modèle renvoie la liste des ID des nouveaux disques système, permettant de vérifier l'état du remplacement.
Type de modèle
Automatisé
Propriétaire
Alibaba Cloud
Paramètres d'entrée
|**Paramètre**
|
**Description**
|
**Type**
|
**Obligatoire**
|
**Valeur par défaut**
|
**Limite**
| | --- | --- | --- | --- | --- | --- | |
imageId
|
ID de l'image.
|
String
|
Oui
| | | |
targets
|
Instances ECS cibles.
|
Json
|
Oui
| | | |
regionId
|
ID de la région.
|
String
|
Non
|
{{ ACS::RegionId }}
| | |
password
|
Mot de passe d'accès à l'instance ECS.
|
String
|
Non
|
""
| | |
keyPairName
|
Nom de la paire de clés.
|
String
|
Non
|
""
| | |
rateControl
|
Paramètres de concurrence pour l'exécution des tâches.
|
Json
|
Non
|
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}
| | |
OOSAssumeRole
|
Rôle RAM endossé par CloudOps Orchestration Service (OOS).
|
String
|
Non
|
""
| |
Paramètres de sortie
|**Paramètre**
|
**Description**
|
**Type**
| | --- | --- | --- | |
newSystemDiskIds
| |
String
|
Stratégie d'autorisation requise pour exécuter le modèle
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeDisks",
"ecs:DescribeInstances",
"ecs:ReplaceSystemDisk",
"ecs:StartInstance",
"ecs:StopInstance"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Détails
Pour plus d'informations, consultez le fichier ACS-ECS-BulkyReplaceSystemDisk.yml sur GitHub.
Contenu du modèle
If the system disk capacity of the image you select is larger than the original system disk capacity, the system disk will be automatically expanded, which may incur additional costs.
Description:
en: 'Replaces the system disks of multiple ECS instances in batches. This template is useful for scenarios such as system upgrades and fault recovery. During configuration, provide the required parameters: Region ID (regionId) to specify the region of the ECS instances, Image ID (imageId) to specify the image for the new system disk, and Target Instances (targets) to define the specific ECS instances. After execution, the template returns a list of the new system disk IDs to help you verify the replacement status.'
name-en: ACS-ECS-BulkyReplaceSystemDisk
categories:
- instance_manage
- application_management
- tag_operate_resource
Parameters:
regionId:
Type: String
Label:
en: RegionId
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
imageId:
Label:
en: ImageId
Description:
en: <div>If the system disk capacity of the image you select is larger than the original system disk capacity, the system disk is automatically expanded. This may incur additional costs. </div>
Type: String
AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
AssociationPropertyMetadata:
RegionId: regionId
password:
Label:
en: Password
Type: String
Default: ''
keyPairName:
Label:
en: KeyPairName
Type: String
Default: ''
targets:
Type: Json
Label:
en: TargetInstance
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
en: RateControl
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Gets the specified ECS instances
Action: 'ACS::SelectTargets'
Properties:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: 'Instances.Instance[].InstanceId'
- Name: replaceSystemDisk
Action: 'ACS::ECS::ReplaceSystemDisk'
Description:
en: Replaces the system disk
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
imageId: '{{ imageId }}'
keyPairName: '{{ keyPairName }}'
password: '{{ password }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Outputs:
newSystemDiskIds:
AggregateType: 'Fn::ListJoin'
AggregateField: newSystemDiskId
Outputs:
newSystemDiskId:
Type: String
ValueSelector: newSystemDiskId
Outputs:
newSystemDiskIds:
Type: String
Value: '{{ replaceSystemDisk.newSystemDiskIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- imageId
- password
- keyPairName
Label:
default:
en: Configure Parameters
- Parameters:
- regionId
- targets
Label:
default:
en: Select ECS Instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
en: Advanced Options