tencent cloud

Tencent Smart Advisor-Chaotic Fault Generator

Product Introduction
Overview
Strengths
Scenarios
Purchase Guide
Purchase Instructions
Getting Started
Quick Start with the Console
Quick Start with API
Operation Guide
Template Library
Experiments
Fault Action
Guardrail Monitoring
Tag
Agent Management
Fault Action Library
Compute
Database
Network
Container
Big Data
Cloud Load Balancer
Message Queue
Direct Connect
Custom Actions
Cloud Streaming Services (CSS)
Permission Management Guide
Overview
Authorization Policy Syntax
Authorizable Resource Types
Service Authorization and Role Permissions
Sub-users and Authorization
API Documentation
History
Introduction
API Category
Making API Requests
Task APIs
Template Library APIs
Data Types
Error Codes
FAQs
Product Feature Issues
Action Execution Issues
Agent FAQ
Related Protocol
PRIVACY POLICY MODULE CHAOTIC FAULT GENERATOR
DATA PRIVACY AND SECURITY AGREEMENT MODULE CHAOTIC FAULT GENERATOR
Contact Us

Expanding Fault Injection Actions with Custom Scripts

PDF
Focus Mode
Font Size
Last updated: 2024-09-26 15:49:18
To meet users' personalized fault action needs, CFG has developed custom actions. You can package fault scripts as a fault action for experiment orchestration. During experiment execution, custom actions are distributed to the selected CVM for execution. Additionally, custom actions support dynamic parameter configuration and action resource sharing under the root account, allowing for creation once and multiple uses. Below is an introduction about how to use custom actions with custom scripts to kill the specified process.
During the operation of the business, processes may terminate due to various unexpected situations. To verify whether the service can automatically restart, you can use a custom script to simulate this scenario by killing the process.

Directions

Step 1: Create an action

Log in to Tencent Smart Advisor > Chaotic Fault Generator, select Action Library Management, and click Create Custom Action.

Step 2: Fill in action basic information

1. Fill in the basic information for the custom action:
Note:
Custom actions support two command types:
Shell: means Linux script commands.
Powershell: means Windows script commands.
Command content supports dynamic parameter replacement. Use {{}} to enclose parameters that need to be dynamically replaced in the script, then click Use Parameters to automatically extract dynamic parameters.
ps -ef | grep -w {{process_name}} | grep -v grep | awk '{print $2;}' | xargs kill -9
2. Click Save to see the newly created custom action in the action list. If you have more granular permission management needs, you can specify tags during creation so that only sub-users under the same tag can share the custom action.

Step 3: Create an experiment

1. Enter the Experiment Management page and click Create a New Experiment.
2. Custom actions can participate in experiment orchestration. During experiment creation, click Skip and create a blank experiment, then fill in the experiment details and add experiment Instances.
3. Click Add Now, and select the experiment action to add.
4. After selecting the relevant custom action, click Next.
5. Set dynamic parameters. If not set, default values for creation will be used.
Custom actions will be distributed to the corresponding CVM instances. If multiple instances are chosen, the script can be distributed for batch parallel execution.

Step 4: Execute the experiment

After completing experiment orchestration, click Execute Experiment. If the action is executed successfully (Return code 0 indicates success.), you can log in to the server for verification.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback