huaweicloud/huaweicloud-skills/huawei-cloud-cce-chaos-experiment
Claude Code and agent skill by huaweicloud/huaweicloud-skills
- community
Checking that the SKILL.md file is still in the repository.
Huawei Cloud CCE AZ power outage chaos experiment — end-to-end fault drill: discover clusters and node AZ distribution, validate cross-AZ capacity, shut down all CCE nodes in one AZ to simulate a power failure, observe Pod eviction and rescheduling to surviving AZs, then start nodes back and verify recovery, and optionally analyze logs for an impact report. Use this skill when the user wants to run or prepare a CCE fault drill / chaos experiment / AZ outage drill. Triggers: CCE, 故障演练, 混沌演练, AZ断电, 演练, 故障注入, chaos experiment, AZ power outage, fault drill, chaos drill.
Install
npx vskill@latest install huaweicloud/huaweicloud-skills/huawei-cloud-cce-chaos-experimentSKILL.md
The same SKILL.md was published earlier as huaweicloud/huaweicloud-skills/huawei-cloud-cce-chaos-experiment.
Huawei Cloud CCE AZ Power Outage Chaos Experiment
Overview
End-to-end CCE AZ power outage chaos experiment in three phases:
Scenario: Shut down all CCE nodes in one AZ → Kubernetes marks nodes NotReady → Pods evicted and rescheduled to other AZs → start nodes back → verify recovery. Tests cluster HA under AZ-level failure.
Prerequisites
- hcloud CLI — installed and configured with AK/SK (ECS + CCE permissions)
- kubectl — installed and configured for CCE cluster access
- Python 3 — for discovery, validation, execution, and analysis scripts
- Environment variables:
HW_ACCESS_KEY,HW_SECRET_KEY,HW_REGION_NAME(optional, defaults to cn-north-4 if unset)
Run environment check:
If kubectl is missing, check_env.sh auto-installs it. Manual install:
Phase 1: Prepare (故障演练准备)
Generates experiment configuration. Does NOT start the experiment.
Step 1.1: Environment Check
Step 1.2: Determine Region [INTERACTIVE]
Check HW_REGION_NAME environment variable:
- Set → use that region (confirm with user: "Region is <region>, correct?").
- Not set → ask the user which region to use. Do NOT silently default to
cn-north-4.
Region is used in all subsequent --region parameters and hcloud --cli-region calls.
Step 1.3: Discover CCE Clusters
Output: JSON with all clusters (ID, name, status, flavor, version).
Step 1.4: User Selects Cluster [INTERACTIVE]
Present discovered clusters in a table. Ask the user to choose — never auto-select.
- Only
Availableclusters can be selected directly. Hibernationclusters must be awakened first.
Step 1.5: Get Credentials & Discover Node AZ Distribution
Present node-to-AZ mapping to the user.
Step 1.6: User Selects Target AZ [INTERACTIVE]
Present AZ distribution. Ask the user to choose the target AZ.
- Show node count per AZ.
- Warn if cluster has only one AZ (no cross-AZ redundancy).
- Never auto-select.
Step 1.7: Create Experiment Directory
Create the experiment directory before running discovery and validation, so all artifacts (discovery.json, validation.json, experiment.json, logs, reports) live inside one directory.
All subsequent steps use $EXP_DIR as the output path.
Step 1.8: Discover Nodes & Pods in Target AZ
Step 1.9: Validate Compatibility [CRITICAL GATE]
Validation rules (see references/cce-validation-rules.md):
- All target nodes must be Ready
- Cross-AZ capacity sufficient for rescheduling
- PDB constraints checked (warnings only for AZ outage — shutdown bypasses eviction API)
- Workload replicas ≥ 2 (warning)
- Single-AZ cluster risk (error)
Decision: errors → stop and fix. warnings only → proceed to generate.
Step 1.10: Generate, Deploy & Report
Experiment is prepared but NOT started. Proceed to Phase 2 when ready.
Phase 1 References
references/cce-az-power-scenario.md— scenario definition, fault impact chain, API mappingreferences/cce-validation-rules.md— validation rules with rationale and decision matrixreferences/experiment-template-guide.md— experiment.json schema with full example
Phase 2: Execute (故障演练执行)
Performs actual node shutdown. Target CCE nodes will be stopped.
Step 2.1: Environment Check
Step 2.2: Execute Experiment [Core Step]
6 Execution Phases
| Phase | Operation | Description | |
|---|---|---|---|
| 1. Pre-check | kubectl get nodes | All target nodes must be Ready | |
| 2. Shutdown | hcloud ECS BatchStopServers | Execute fault injection | |
| 3. Monitor | Poll Node + Pod status | Wait for NotReady + Pod rescheduling | |
| 4. Wait | sleep(duration) | Experiment duration | |
| 5. Rollback | hcloud ECS BatchStartServers | Start all target nodes | |
| 6. Verify | Poll Node + Pod status | Confirm Ready + Running + replicas met |
Produces execution-log.json with complete timeline.
Step 2.3: Generate Report
Emergency Rollback
Phase 2 References
references/execution-workflow.md— 6-phase details, execution-log.json format, safety mechanismsreferences/monitoring-guide.md— Node/Pod state machines, polling mechanism
CCE Resource State Machine
Phase 3: Log Analysis (生成日志分析报告)
Collects and analyzes application/CCE logs within the experiment time window.
Step 3.1: Environment Check
Step 3.2: Load Experiment Context & Analyze Logs
Auto-detects mode:
execution-log.jsonexists → post-hoc analysis (事后分析)- Only
experiment.jsonexists → real-time monitoring (实时监控)
Step 3.3: Discover Affected Services
Scans Service/Ingress/ConfigMap references to identify directly impacted services. Note: discover_dependencies.py queries the cluster directly via kubectl, not from discovery.json. Pass the affected node names with --nodes.
Tip: Step 3.2 (analyze_logs.py) already callsdiscover_dependencies.pyinternally, so this step is optional — use it only for standalone dependency discovery.
Step 3.4: Collect Logs
Collects within experiment time window:
- CCE Pod logs:
kubectl logs --since-time - LTS logs:
hcloud LTS ListLogs - Kubernetes Events:
kubectl get events
Step 3.5: Generate Analysis Report
Output: Markdown report with:
- Experiment overview & affected services
- Pod rescheduling timeline
- Error pattern statistics (ERROR/Exception/Connection refused/Timeout/5xx)
- Business impact assessment
- Improvement recommendations
Phase 3 References
references/analysis-workflow.md— 6-step analysis workflow, error pattern classification tablereferences/managed-service-logs.md— kubectl logs, LTS, CES commands, best practices
Error Pattern Classification
| Pattern | Keywords | Severity | Description | |
|---|---|---|---|---|
| ERROR | error | High | Application error | |
| Exception | exception, stacktrace | High | Exception stack trace | |
| Connection refused | connection refused | High | Service unavailable | |
| Timeout | timeout, deadline exceeded | Medium | Timeout | |
| 5xx HTTP | 500, 502, 503, 504 | High | Server error | |
| Reconnect | reconnect, reconnected | Low | Reconnected successfully | |
| Degraded | degrad | Medium | Degraded mode | |
| Recovered | recover, restored | Low | Recovered |
Script Reference
| Script | Phase | Purpose | |
|---|---|---|---|
scripts/check_env.sh | All | Environment verification (shared) | |
scripts/discover_cce.py | 1 | Discover CCE clusters and AZ nodes | |
scripts/validate_targets.py | 1 | Validate cross-AZ capacity and PDB | |
scripts/generate_experiment.py | 1 | Generate experiment config | |
scripts/deploy_experiment.sh | 1 | Deploy experiment (local mode, generate rollback script) | |
scripts/execute_experiment.py | 2 | Main execution (6 phases) | |
scripts/monitor_resources.py | 2 | Monitor Node/Pod status (called by execute) | |
scripts/rollback_experiment.py | 2 | Emergency rollback | |
scripts/generate_report.py | 2 | Generate Markdown execution report | |
scripts/analyze_logs.py | 3 | Main analysis orchestration | |
scripts/discover_dependencies.py | 3 | Discover CCE service dependencies | |
scripts/collect_logs.py | 3 | Collect LTS + CCE Pod logs | |
scripts/generate_analysis_report.py | 3 | Generate Markdown analysis report |
Key Design Decisions
- Interactive cluster and AZ selection — the agent must present discovered clusters and AZ distributions to the user and let the user choose. Never auto-select.
- Validate before generating — cross-AZ capacity and PDB constraints are checked before any files are produced.
- PDB warnings are informational for AZ outage — PDBs govern voluntary pod eviction, not direct node shutdown via ECS API. PDB violations are warnings, not errors.
- Dry Run and auto-rollback —
--dry-runsimulates without API calls;--auto-rollbacktriggers rollback on shutdown failure.
- Local deployment mode —
deploy_experiment.shgenerates the emergency rollback script locally; the full drill flow is executed by the built-inscripts/execute_experiment.py(no external COC dependency).
- AZ-scoped targeting — targets all CCE nodes in a specified AZ, simulating real AZ power outage.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/container/cce/huawei-cloud-cce-chaos-experiment/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/huaweicloud/huaweicloud-skills/huawei-cloud-cce-chaos-experiment)