Updated on 2025-08-08 GMT+08:00

Creating a Drill Task Using a Template

Scenarios

You can use a drill template to create a drill task in a specific scenario.

Creating a Drill Task Using a Template

  1. Log in to COC.
  2. In the navigation pane, choose Resilience Center > Drill Templates.
  3. Create a drill task in either of the following ways:

    • Select the required template based on Drill Template Description and click Create Task on the template card.
    • Select the required template based on Drill Template Description, click the template card to go to the Template Details page, and click Create Task in the upper right corner.

  4. Configure the basic information.

    Table 1 Basic information parameters

    Parameter

    Description

    Example Value

    Drill Task

    Name of the drill task. Set it according to the naming rules.

    Test-Drill

    Expected Recovery Duration (Minutes)

    Expected time from the fault occurrence to the fault recovery, in minutes.

    Expected time for an application to automatically recover to the normal state during contingency plan execution after a fault is injected. This time does not affect the drill task.

    3

  5. In the task group that contains scenario and parameters, locate the scenario and add an attack target for the task.

    1. Click Select under Attack Target.
    2. Cloud Service Provider and Source of Attack Target are selected based on the preset value of the scenario.
    3. In the Attack Target table, the instances that do not support the current weapon are dimmed. After you select an existing task, change the cloud server provider, or change the source of the attack target, the preset weapon information will be cleared. For details, see Creating a Drill Task Using a Template.
    4. After you select an attack target and click Next, the corresponding weapon is selected based on the target scenario. The preset value of the attack parameter is the data in the template.
    5. (Optional) Set Configure Monitoring Tasks.
      Table 2 Parameters for configuring a monitoring task

      Parameter

      Description

      Steady-State Metrics

      Select the target resource, performance metric, lower limit, and upper limit from the drop-down lists one by one.

      If a service can perform well and stably when a performance monitoring metric is set to a certain value range, this metric is called steady-state metric. If this metric value is not in that value range before a drill, the drill will be canceled. If the value of the steady-state metric is not within the stable value range during a drill, the corresponding fault injection automatically stops after automatic rollback is enabled.

      Metric

      Select the target resource, monitoring metric, lower limit, and upper limit from the drop-down lists one by one.

      These service metrics monitor the corresponding service data during fault drills. If the value of such a metric is within the allowed value range, the service is normal. Otherwise, you can determine whether to stop a drill.

      Automatic Rollback

      Select whether to enable automatic rollback.

      Fault injection is automatically rolled back and restored to the status before fault injection. Automatic rollback cannot be configured for some fault drill weapons that do not support fault termination.

    6. Click Finish. The attack task is added.

  6. (Optional) Click Add Attack Task.

    Attack tasks are preset in the template. You can add an attack task as required. Click Add Task Group. After adding an attack task, you can click Add Attack Task to add another one.
    • Tasks in different task groups are executed in serial, and tasks in the same task group are executed in parallel.
    • Currently, multiple fault injection operations on the same resource in a task group are not supported.
    • To add an existing task, click Select from Existing, select the existing task, and click OK.
    • To add a new attack task, perform the follow-up steps.
      1. Set the attack target.
        Table 3 Attack target parameters

        Parameter

        Description

        Example Value

        Cloud Service Provider

        Select a cloud service vendor type.

        Huawei Cloud

        Source of Attack Target

        Select the source of the target instance.

        You can select attack targets by selecting instances, pods, or a specified number of targets if CCE instances are used.

        ECS

        Attack Task

        Customize the name of the attack task based on the naming rule.

        test-attacktask

        Attack Target

        Select a target instance.

        -

      2. Click Next.
      3. Set parameters for selecting an attack scenario.
        For details, see Attack Scenarios.
        Table 4 Attack scenario parameters

        Parameter

        Description

        Example Value

        Attack Type

        Attack scenarios are classified based on attack scenario types.

        Host resources

        Attack Scenario

        Customize the name of the attack task based on the naming rule.

        CPU usage increase

        Attack Parameters

        Configure attack parameters based on attack scenarios.

        CPU usage (%): 80

        Fault duration (s): 60

      4. Click Next.
      5. (Optional) Set Configure Monitoring Tasks.
        Table 5 Parameters for configuring a monitoring task

        Parameter

        Description

        Steady-State Metrics

        Select the target resource, performance metric, lower limit, and upper limit from the drop-down lists one by one.

        If a service can perform well and stably when a performance monitoring metric is set to a certain value range, this metric is called steady-state metric. If this metric value is not in that value range before a drill, the drill will be canceled. If the value of the steady-state metric is not within the stable value range during a drill, the corresponding fault injection automatically stops after automatic rollback is enabled.

        Metric

        Select the target resource, monitoring metric, lower limit, and upper limit from the drop-down lists one by one.

        These service metrics monitor the corresponding service data during fault drills. If the value of such a metric is within the allowed value range, the service is normal. Otherwise, you can determine whether to stop a drill.

        Automatic Rollback

        Select whether to enable automatic rollback.

        Fault injection is automatically rolled back and restored to the status before fault injection. Automatic rollback cannot be configured for some fault drill weapons that do not support fault termination.

      6. Click Finish. The attack task is added.

  7. If a preset scenario in the template is not required, click Delete next to the task. This step is optional.
  8. Click OK.

    After a drill task is created, choose Resilience Center > Chaos Drills > Drill Tasks to view the task and start the drill by referring to Starting a Drill Task.