MGC Cross-Region Migration
Execute and troubleshoot Huawei Cloud server migration in this repository. Supports both the current batch existing-target SMS workflow (`terraform apply` +…
от huaweicloudskill210 установок в других каталогах
Установить MGC Cross-Region Migration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
MGC Cross-Region Migration
Overview
This skill runs the migration flow implemented in this repository, from precheck to task startup and result validation, keeping execution deterministic by following the exact command sequence and error-handling rules already implemented in the migration scripts.
Architecture: Terraform (main.tf) reads terraform.tfvars, maps the values to runtime environment variables, and invokes scripts/run_migration.sh, which currently calls python3 scripts/mgc_sms_existing_target_batch.py (batch existing-target SMS migration). That script signs and issues HTTPS requests directly against the Huawei Cloud IAM, SMS, ECS, VPC, and EVS REST APIs (no KooCLI/hcloud involved) to create migration projects, register migration tasks against pre-existing target servers, and poll them to completion. scripts/mgc_migrate.py remains available for the single-source SMS/rsync workflow, and scripts/repair_boot_via_helper.py performs post-migration boot-disk/SSH repair via a temporary helper ECS. Default policy is SMS first; when precheck/runtime indicates an incompatible source (for example SMS.6504), single-source runs switch to rsync phases (full_sync -> incremental_sync -> cutover_sync).
Applicable scenarios:
- Batch-migrating multiple sources to pre-existing target ECS instances matched by fixed IP.
- Migrating a single on-prem VMware VM, or an external GCP/AWS instance, into Huawei Cloud.
- Resuming a paused/interrupted batch run from checkpoint files.
- Repairing a target ECS that fails to boot or accept SSH after migration.
- Postmortem/experience-capture requests after a migration run.
Example user requests:
- "帮我批量迁移这几台 GCP 实例到已有的目标机器上。"
- "terraform apply 报错 SMS.1404,target disk 提示 IN-USE,怎么处理?"
- "迁移之后目标机器起不来,GRUB 报 Cannot open root device,帮我修。"
- "上次批量迁移中断了,帮我从 checkpoint 继续。"
Relationship to huawei-cloud-sms-host-migrator: that skill is a general, interactive SMS-console/API assistant for ad-hoc host migrations from any source (IDC, Alibaba Cloud, Tencent Cloud, AWS) to Huawei Cloud. This skill is narrower and automation-first: it drives the exact same SMS APIs through a fixed Terraform + Python pipeline (main.tf -> scripts/run_migration.sh -> mgc_sms_existing_target_batch.py/mgc_migrate.py) to get deterministic, repeatable batch runs, with built-in rsync/VPN-bridge fallback and boot-disk/SSH repair (repair_boot_via_helper.py) that huawei-cloud-sms-host-migrator does not provide. Prefer this skill when the user already has (or wants) a Terraform-driven, scriptable, resumable migration pipeline; prefer huawei-cloud-sms-host-migrator for one-off, console-guided migrations.
Prerequisites
- Terraform
>= 1.5.0onPATH. Verify withterraform version. - Python 3.8+ on
PATH(verify withpython3 --version). The core migration/repair paths use only the standard library plus mutual imports betweenmgc_sms_existing_target_batch.pyandmgc_migrate.py. Optional paths need extra packages, which are not bundled:pexpect— required only for the rsync fallback SSH path (scripts/mgc_migrate.py); install withpip install pexpectwhen rsync fallback may be used.boto3— required only when profiling an AWS source instance's security groups (scripts/mgc_migrate.py); install withpip install boto3when migrating from AWS.- The SMS-only batch flow needs neither package.
- This skill does not use Huawei Cloud KooCLI (
hcloud). All Huawei Cloud API calls are issued as signed HTTPS requests fromscripts/*.py; no separate CLI installation is required. - Credentials: set
source_access_key/source_secret_keyanddestination_access_key/destination_secret_keyinterraform.tfvars. Terraform passes them to the migration script only as local-exec environment variables; never print them, log them, or paste them into chat. See references/iam-policies.md for the required IAM permissions. - Permission failure handling (MUST): if any API call fails with a permission/
403error, open references/iam-policies.md, show the user the exact missing permission and the minimal policy JSON, have them grant it in the IAM console, then pause until the user confirms the grant before retrying.
Workflow
- Confirm prerequisites before running any write operation.
- Prepare Terraform inputs in
terraform.tfvars. - Before migration, precheck and cleanup old source-bound SMS tasks if they can occupy the same source VM.
- Execute Terraform so it calls
scripts/run_migration.shandscripts/mgc_sms_existing_target_batch.py. - Verify
out/migration_result.json; for batch mode verify everyresults[]item hassource_sms_server_id,task_id, andtask_state. - Run postcheck for
vpc-migration, EIP binding, source/target security-group connectivity, and SSH/TCP-22 reachability. - If SSH/TCP-22 fails after SMS or rsync reports success, i
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл MGC Cross-Region Migration?
Execute and troubleshoot Huawei Cloud server migration in this repository. Supports both the current batch existing-target SMS workflow (`terraform apply` + `scripts/mgc_sms_existing_target_batch.py`) and the single-source SMS/rsync workflow (`scripts/mgc_migrate.py`), orchestrated by Terraform against the Huawei Cloud SMS/ECS/VPC/EVS/IAM REST APIs. Use when the user asks to migrate ECS/on-prem VMware/external GCP/AWS sources, run migration in `ap-southeast-3`/`la-*`, resume after pause from `out/resume_checkpoint_latest.json`, monitor tasks in `out/task_poll_latest.json`, repair a broken boot disk with `scripts/repair_boot_via_helper.py`, or diagnose SMS/MGC errors such as SMS.0202, SMS.1404, SMS.0515, SMS.6504, SMS.6602, SMS.6603, SMS.6617, SMS.7605, SMS.7703, SMS.8115, stale SMS-Agent process, or missing `disk_id` in target disk mapping. Trigger words: migrate, migration, SMS, MGC, batch migration, boot repair, GRUB repair, 跨区域迁移, MGC/SMS 迁移流程, 批量迁移恢复, 迁移排障.
Как установить скилл MGC Cross-Region Migration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл MGC Cross-Region Migration запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
AnthropicUse 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…
xlsx
AnthropicUse 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…
pptx
AnthropicUse 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…