This topic describes how to start multiple ECS instances in the ECS console by using the ACS-ECS-StartInstancesByTag public template of OOS.

Prerequisites

Before creating an O&M task on OOS, make sure that the following requirements have been met:

  • You have activated OOS.
  • You have created a RAM role and added the AliyunECSFullAccess policy to the OOS service role. For this example, the OOSServiceRole-EcsDocGuideTest RAM role has been created.
  • You have bound a tag to the ECS instances. For this example, the key-value pair of the tag is KeyNode:LimitedAccess. For more information, see Add a tag to resources.

Background information

OOS defines the O&M tasks that you want to perform in a template. Both YAML and JSON formats are supported in templates. Templates are divided into public and custom templates. Public templates are provided for your reference and can be used directly. The ACS-ECS-StartInstancesByTag template used in this topic is a public one. Before executing a template, you must carefully check the O&M tasks defined in the template and set up a test environment to check the execution results of the template.

You also can customize a template to perform your O&M tasks.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Maintenance & Monitoring > Operation Orchestration Service.
  3. In the top navigation bar, select a region.
  4. On the Public Templates page, select ACS-ECS-StartInstancesByTag and click Create Execution.
  5. On the Basic Information page, configure the following parameters and click Next: Parameter Settings.
    • Execution Mode: For this example, Automatic is selected, indicating that all tasks in the template are to be executed automatically.
    • Risk Confirmation: For this example, Skip Confirmation for High-risk Tasks is selected. You also can select Require Confirmation for High-risk Tasks, indicating that high-risk tasks require you to confirm them before they are executed.
    • Template Category: For this example, Public Templates and ACS-ECS-StartInstancesByTag are selected, indicating that the StartInstance API operation is called to start multiple ECS instances after instances are filtered by tag. An error is returned if the instance is not in Stopped state.
  6. On the Parameter Settings page, enter the parameter values based on the template and then click Next: Preview.
    • tagKey: the key of the created tag.
    • tagValue: the value of the created tag.
    • maxErrors: the maximum number of errors allowed for the batch operation. If the number of errors exceeds the preset value, the current O&M task will not be executed. A smaller value of maxErrors indicates more caution is required.
    • Concurrency: concurrency control for the batch operation. This parameter controls the number of concurrent tasks and batches.
  7. On the Preview page, preview and confirm the values defined on the Basic Information and Parameter Settings pages and then click Create Execution.

Result

You can view the execution results of O&M tasks on the Executions page after creating O&M tasks.

  • If Success is displayed in the Execution Status column corresponding to an O&M task, it indicates that the O&M task is successful.
  • If Failed is displayed in the Execution Status column corresponding to an O&M task, you can click Details in the Actions column and then click Execution Logs. Then you can analyze and adjust the execution content based on the log information.