Nom du modèle
ACS-SMC-BulkyVerifyInstances : vérifie les instances cibles dans Server Migration Center (SMC)
Description du modèle
Vérifie plusieurs instances cibles en exécutant des commandes via Server Migration Center (SMC).
Type de modèle
Automatisation
Propriétaire
Alibaba Cloud
Paramètres d'entrée
|
Paramètre |
Description |
Type |
Obligatoire |
Valeur par défaut |
Contraintes |
|
targets |
Les instances cibles à vérifier. |
Json |
Oui |
||
|
regionId |
ID de la région. |
String |
Non |
{{ ACS::RegionId }} |
|
|
commandType |
Type de commande Cloud Assistant. |
String |
Non |
RunShellScript |
|
|
commandContent |
Contenu de la commande. |
String |
Non |
"" |
|
|
timeout |
Délai d'expiration de l'exécution de la commande, en secondes. |
Number |
Non |
600 |
|
|
workingDir |
Répertoire de l'instance dans lequel la commande est exécutée. |
String |
Non |
"" |
|
|
rateControl |
Paramètres de contrôle du débit, tels que la concurrence et la tolérance aux erreurs. |
Json |
Non |
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} |
|
|
OOSAssumeRole |
Rôle RAM endossé par OOS. |
String |
Non |
"" |
Paramètres de sortie
|
Paramètre |
Description |
Type |
|
instanceCheckResults |
Sortie de la commande pour chaque instance vérifiée. |
List |
Autorisations requises
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DeleteInstance",
"ecs:DeleteSecurityGroup",
"ecs:DescribeCloudAssistantStatus",
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:InstallCloudAssistant",
"ecs:RebootInstance",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"vpc:DeleteVSwitch",
"vpc:DeleteVpc",
"vpc:DescribeVSwitches",
"vpc:DescribeVpcs"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Détails
Détails du modèle ACS-SMC-BulkyVerifyInstances
Contenu du modèle
FormatVersion: OOS-2019-06-01
Description:
en: Verifies multiple instances by running commands.
zh-cn: SMC执行指定的多个实例,并通过执行命令验证目标实例
name-en: ACS-SMC-BulkyVerifyInstances
name-zh-cn: SMC验证目标实例
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: 地域ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: 目标实例
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: ALIYUN::ECS::Instance
RegionId: regionId
commandType:
Label:
en: CommandType
zh-cn: 云助手命令类型
Type: String
AllowedValues:
- RunBatScript
- RunPowerShellScript
- RunShellScript
Default: RunShellScript
commandContent:
Label:
en: CommandContent
zh-cn: 云助手命令
Type: String
AssociationProperty: Code
Default: ''
timeout:
Label:
en: Timeout
zh-cn: 执行命令的超时时间
Type: Number
Default: 600
workingDir:
Label:
en: WorkingDir
zh-cn: 运行命令的目录
Type: String
Default: ''
rateControl:
Label:
en: RateControl
zh-cn: 任务执行的并发比率
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Retrieves the target ECS instances.
zh-cn: 获取ECS实例
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: doInstanceCheck
Action: 'ACS::ECS::SMCVerifyInstanceByRunCommand'
Description:
en: Runs a Cloud Assistant command on each instance for verification.
zh-cn: 执行云助手命令检查实例
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
commandContent: '{{ commandContent }}'
commandType: '{{ commandType }}'
workingDir: '{{ workingDir }}'
timeout: '{{ timeout }}'
Outputs:
commandOutput:
Type: String
ValueSelector: invocationOutput
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Outputs:
commandOutputs:
AggregateType: 'Fn::ListJoin'
AggregateField: commandOutput
Outputs:
instanceCheckResults:
Type: List
Value: '{{ doInstanceCheck.commandOutputs }}'