Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-BulkyRebootInstances

Dernière mise à jour :Aug 11, 2026

Nom du modèle

ACS-ECS-BulkyRebootInstances : redémarre des instances par lots

Exécuter maintenant

Description du modèle

Redémarre plusieurs instances ECS en lot, ce qui s'avère utile lors des mises à jour système ou des opérations de maintenance. Vous devez spécifier l'ID de la région (regionId) ainsi que les instances cibles (targets). Une fois l'exécution terminée, le modèle renvoie la liste des ID d'instance redémarrés, que vous pouvez utiliser pour vérifier l'état du redémarrage.

Type de modèle

Automatisé

Propriétaire

Alibaba Cloud

Paramètres d'entrée

Paramètre

Description

Type

Obligatoire

Valeur par défaut

Limite

targets

Instance cible

Json

Oui

regionId

ID de la région.

String

Non

{{ ACS::RegionId }}

forceStop

Indique si les instances ECS doivent être arrêtées de force.

Boolean

Non

False

rateControl

Taux de concurrence pour l'exécution des tâches

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

instanceIds

List

Stratégie d'autorisation requise pour exécuter le modèle

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:RebootInstance"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Détails

Détails de ACS-ECS-BulkyRebootInstances

Contenu du modèle

FormatVersion: OOS-2019-06-01
Description:
  en: 'Bulky restarts the ECS instances, applicable to scenarios that require managing and restarting multiple ECS instances simultaneously, such as system updates and maintenance. During configuration, users need to provide the following required parameter information: Region ID (regionId), which specifies the region of the ECS instances to be restarted, and Target Instances (targets), which defines the specific ECS instances to be operated on. Upon execution, the template will return a list of the restarted instance IDs, enabling users to verify the status of the instance restart operations.'
  zh-cn: 'Restarts multiple ECS instances in a batch. This is useful for scenarios that require managing and restarting multiple ECS instances at the same time, such as for system updates and maintenance. During configuration, provide the following required parameters: the region ID (regionId), which specifies the region of the instances to restart, and the target instances (targets), which define the specific ECS instances for the operation. After the template runs, it returns a list of all restarted instance IDs. This helps you verify the restart status of the instances.'
  name-en: Bulky Reboot Instances
  name-zh-cn: Restart multiple instances in a batch
  categories:
    - instance_manage
    - application_manage
    - computenest
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: TargetInstance
      zh-cn: Target instance
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  forceStop:
    Label:
      en: ForceStop
      zh-cn: Force shutdown
    Type: Boolean
    Default: false
  rateControl:
    Label:
      en: RateControl
      zh-cn: Concurrency rate for task execution
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: RAM role assumed by OOS
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
  Description:
    en: Views the ECS instances
    zh-cn: Get ECS instances
  Action: ACS::SelectTargets
  Properties:
    ResourceType: ALIYUN::ECS::Instance
    RegionId: '{{ regionId }}'
    Filters:
      - '{{ targets }}'
  Outputs:
    instanceIds:
      Type: List
      ValueSelector: Instances.Instance[].InstanceId
- Name: rebootInstance
  Action: ACS::ECS::RebootInstance
  Description:
    en: Restarts the ECS instances
    zh-cn: Restart instances
  Properties:
    regionId: '{{ regionId }}'
    instanceId: '{{ ACS::TaskLoopItem }}'
    forceStop: '{{ forceStop }}'
  Loop:
    RateControl: '{{ rateControl }}'
    Items: '{{ getInstance.instanceIds }}'
Outputs:
  instanceIds:
    Type: List
    Value: '{{ getInstance.instanceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: Select instances
            en: Select Ecs Instances
      - Parameters:
          - forceStop
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced options
            en: Control Options