huawei-cloud-ecs-shutdown-experiment
БесплатноЗапускает вложенные скриптыНе проверенFull lifecycle ECS shutdown fault injection experiment for Huawei Cloud chaos engineering: prepare → execute → analyze. Phase 1 discovers target ECS…
от huaweicloudskill401 установка в других каталогахОб этом скилле
Huawei Cloud ECS Shutdown Chaos Experiment
⚠️ This skill performs real ECS shutdown operations in Phase 2. Ensure target instances can tolerate downtime. Emergency rollback is always available.
Overview
Full lifecycle ECS shutdown fault injection experiment for Huawei Cloud chaos engineering, covering three phases:
| Phase | Name | Action | Key Output |
|---|---|---|---|
| 1 | Prepare | Discover, validate, generate config | experiment.json + rollback_experiment.sh |
| 2 | Execute | Shutdown → hold → rollback → verify | execution-log.json + execution-report.md |
| 3 | Analyze | Collect CES metrics + LTS logs, analyze patterns | log-analysis-result.json + log-analysis-report.md |
Scope: standalone ECS instances in any availability zone (non-CCE).
Prerequisites
- hcloud CLI (KooCLI) — installed and configured with AK/SK. See
references/cli-installation-guide.md. - Python 3 — for discovery, validation, execution, and analysis scripts.
- Environment variables:
HW_ACCESS_KEY,HW_SECRET_KEY,HW_REGION_NAME(optional, defaultcn-north-4). - IAM permissions: varies by phase — see
references/iam-policies.mdfor the full matrix. - Phase 3 only: LTS log group ID (find via
hcloud LTS ListLogGroupsor LTS console).
Environment check (run before any phase):
bash scripts/check_env.sh --cli-region <region>
Phase 1: Prepare
Does NOT start the experiment. Only discovers targets, validates compatibility, and generates configuration files.
Step 1.1: Discover Target ECS Instances
python3 scripts/discover_ecs.py --cli-region <region>
python3 scripts/discover_ecs.py --cli-region <region> --az cn-north-4a --status ACTIVE
python3 scripts/discover_ecs.py --cli-region <region> --name-pattern "web-"
Output: JSON with instance ID, name, status, AZ, flavor, charging mode, and tags.
Step 1.2: Validate Compatibility [CRITICAL GATE]
python3 scripts/validate_targets.py --instances-file instances.json --cli-region <region>
Validation rules (see references/ecs-validation-rules.md for details):
- Status must be ACTIVE — can only shut down running instances
- Spot/bidding instance warning — may be released instead of stopped
- AS group association — shutdown may trigger auto-scaling activity
- Single-AZ risk — no cross-AZ redundancy if all targets in one AZ
Decision: errors → stop and fix; warnings only → review with user before proceeding.
Step 1.3: Generate Experiment Configuration
python3 scripts/generate_experiment.py \
--targets "i-xxx,i-yyy" --cli-region <region> --duration 300 --output-dir ./experiments
Output directory: {timestamp}-ecs-shutdown-{slug}/ containing experiment.json + README.md. See references/experiment-template-guide.md for schema.
Step 1.4: Deploy Experiment
bash scripts/deploy_experiment.sh --experiment-dir ./experiments/{dir}/ --cli-region <region>
Generates rollback_experiment.sh (emergency rollback script) in the experiment directory.
Step 1.5: Review
Experiment is prepared but NOT started. Review experiment.json and README.md, then proceed to Phase 2 when ready.
Phase 2: Execute
Real shutdown operation. Target ECS instances are stopped. Ensure
experiment.jsonfrom Phase 1 is available.
Step 2.1: Execute the Experiment
# Real execution (--yes is mandatory; default refuses without it)
python3 scripts/execute_experiment.py --experiment-dir ./experiments/xxx/ --cli-region <region> --yes
# Dry Run (simulated, no API calls)
python3 scripts/execute_experiment.py --experiment-dir ./experiments/xxx/ --cli-region <region> --dry-run
# Auto-rollback when shutdown fails
python3 scripts/execute_experiment.py --experiment-dir ./experiments/xxx/ --cli-region <region> --auto-rollback --yes
6-phase execution flow (see references/execution-workflow.md for details):
| Phase | Action | Description |
|---|---|---|
| 1. Pre-check | Query status | All instances must be ACTIVE |
| 2. Shutdown | BatchStopServers |
Inject the fault |
| 3. Monitor | Poll status | Wait until all reach SHUTOFF |
| 4. Wait | sleep(duration) |
Hold with stop-condition checks |
| 5. Rollback | BatchStartServers |
Restore instances |
| 6. Verify | Poll status | Confirm all back to ACTIVE |
Output: execution-log.json with full execution timeline and state changes.
Step 2.2: Generate Execution Report
python3 scripts/generate_report.py --log-file ./experiments/xxx/execution-log.json
Report contains: experiment overview, target instances, phase timeline, state changes, conclusions.
Emergency Rollback
If the experiment must be terminated early:
python3 scripts/rollback_experiment.py --experiment-dir ./experiments/xxx/ --cli-region <region>
# Or pass instance IDs directly:
python3 scripts/rollback_experiment.py --ids "i-xxx,i-yyy" --cli-region <region>
Phase 3: Ana
Установить huawei-cloud-ecs-shutdown-experiment в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл huawei-cloud-ecs-shutdown-experiment?
Full lifecycle ECS shutdown fault injection experiment for Huawei Cloud chaos engineering: prepare → execute → analyze. Phase 1 discovers target ECS instances, validates compatibility, generates experiment configuration. Phase 2 executes BatchStopServers shutdown, polls status, holds for duration, rolls back via BatchStartServers, verifies recovery, generates execution report. Phase 3 collects CES monitoring metrics and LTS application logs, analyzes error patterns, generates analysis report. Key safety: --dry-run, --auto-rollback, mandatory --yes confirmation, independent emergency rollback script. Triggers: ECS故障演练, ECS关机实验, chaos engineering, 故障注入, ECS shutdown experiment, 演练准备, 执行实验, 运行实验, 启动演练, 执行 ECS 关机故障演练, 分析应用日志, 查看应用表现, 应用日志分析, 故障影响分析, experiment prepare, experiment execute, analyze app logs, log analysis.
Как установить скилл huawei-cloud-ecs-shutdown-experiment?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл huawei-cloud-ecs-shutdown-experiment запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic