All Products
Search
Document Center

Elastic Compute Service:Start multiple ECS instances at a time by using OOS

Last Updated:Dec 26, 2023

This topic describes how to start multiple Elastic Compute Service (ECS) instances at a time in the ECS console by using the ACS-ECS-BulkyStartInstances public template of CloudOps Orchestration Service.

Prerequisites

Before you create an O&M task on OOS, make sure that the following requirements are met:

  • OOS is activated. You can log on to the OOS console to activate OOS.

  • A Resource Access Management (RAM) role is created for OOS, and the AliyunECSFullAccess policy is attached to the role. For more information, see Grant RAM permissions to OOS.

  • A specific tag is added to the instances that you want to manage. For more information, see Create or add a tag.

Background information

OOS defines the O&M tasks that you want to perform in a template. OOS supports public and custom templates. Both templates support YAML and JSON formats. Public templates are provided for your reference and can be used directly, such as the ACS-ECS-BulkyStartInstances public template used in this topic. Before you execute a template, you must check the O&M tasks defined in the template and set up a test environment to check the execution results of the template.

You can also customize a template to perform your O&M tasks. For more information about custom templates, see Template structure.

Procedure

  1. Log on to the OOS console.

  2. In the left-side navigation pane, choose Automated Task > Public Template.

  3. In the upper-left corner of the top navigation bar, select a region. 地域

  4. On the Public Template page, find ACS-ECS-BulkyStartInstances and click Create Execution.

    ACS-ECS-StartInstancesByTag

  5. On the Create Task page, perform the following operations:

    1. In the Basic Information step, accept the default settings and click Next Step: Parameter Settings.

      Note

      The default value of Execution Mode is Automatic. This indicates that all tasks defined in the template are automatically executed in sequence.

    2. In the Parameter Settings step, complete the parameter settings and click Next Step: OK.

      The following table describes some parameters. You can use the default settings for other parameters.

      Parameter

      Description

      Example

      TargetInstance

      Select a method of specifying instances. You can specify instances by using one of the following methods:

      Note

      If a selected instance is not in the Stopped state, an error is reported.

      • Manually Select Instances

      • Specify Instance Tags

      • Specify Resource Group

      • Upload CSV File

      • Select All

      • Specify Inventory Conditions

      Specify Instance Tags

      Select Instances

      If you select Manually Select Instances, you must select one or more instances that are in the Stopped state.

      i-bp1e9mxelweamh5g****

      Instance Tag

      If you select Specify Instance Tags, you must select one or more existing tags. You must specify the Tag key parameter for the tags. OOS calls the StartInstance operation to batch start ECS instances.

      ECS: Documentation

      Resource Group

      If you select Specify Resource Group, you must select a resource group.

      Test

      OOSAssumeRole

      OOS allows you to use RAM to configure O&M permissions. You can use the existing permissions of your account or permissions granted to the created oosAssumeRole RAM role to implement fine-grained control.

      Specify RAM Role and Use Permissions Granted to This Role

    3. In the OK step, check the Basic Information, Resource Preview, and Parameter Preview settings and click Create.

Execution results

After an O&M task is created, choose Automated Task > Task Execution Management in the left-side navigation pane to view the results.

查看执行结果

  • If Success is displayed in the Execution Status column corresponding to the O&M task, the O&M task is completed.

  • If Failed is displayed in the Execution Status column corresponding to the O&M task, you can click Details in the Actions column. Click Log in the Output section. Then, you can analyze and adjust the execution content based on the log information.