Install
openclaw skills install @huaweicloudskill/huawei-cloud-devkit-application-check-cliUse Kunpeng DevKit CLI to collect installed software information (packages, middleware, databases) from application systems, analyze Maven POM file dependency compatibility, and generate migration assessment reports.Automatically creates a Kunpeng ECS server, uploads DevKit scripts, and on user request installs DevKit and executes scans. Trigger words: "system migration", "information collection", "maven migration", "container migration", "system migration assessment", "系统迁移", "信息收集", "maven迁移", "容器迁移", "系统迁移评估"
openclaw skills install @huaweicloudskill/huawei-cloud-devkit-application-check-cli⚠️ Security Rules:
DEVKIT_ECS_PASSWORD value and nodes.conf plaintext ssh_pass values MUST NEVER appear in plaintext anywhere in AI-generated content — including chat responses, internal thinking/reasoning, tool call arguments, command examples, error messages, debug output, and status reports. Always mask as *** or use placeholders (<your_password>, <encrypted_password>). This is a hard prohibition with zero exceptions.nodes.conf content, run bash ${DEVKIT_HOME}/encrypt-nodes-verify.sh --mask on the DevKit server (outputs all ssh_pass values masked as ***). NEVER cat/grep/sed nodes.conf directly into chat output.encrypt-nodes-verify.sh on the DevKit server to encrypt plaintext ssh_pass via sys-mig -ec and replace plaintext values in nodes.conf with encrypted ones. NEVER execute devkit sys-mig scan commands while nodes.conf still contains plaintext passwords.DEVKIT_ECS_PASSWORD env var value) MUST NEVER appear in plaintext in any AI output (chat, thinking, tool calls, logs). Always mask as *** or <your_password>. Command examples must use ${DEVKIT_ECS_PASSWORD} (variable reference), never the actual value.Write tool to create temporary script files (e.g., _exec_scan.py, _rename.py, etc.). All commands must use inline execution (py -c, bash -c, etc.) or call existing scripts directly.py -c "..." inline mode instead of creating temporary .py files.DEVKIT_ECS_USER/DEVKIT_ECS_PASSWORD), Scan (mode, path, report path, log level), Report (local download path). Confirmation flow: AI collects parameters → presents summary → asks "Confirm above parameters? (yes/no)" → user explicitly says yes → execute; user says no or no response → do NOT execute. NEVER execute with unconfirmed parameters, assumed defaults, or without explicit user approval.references/devkit-operations-guide.md, references/ecs-creation.md, references/devkit-operations-workflow.md) to obtain the correct command templates, parameter names, and formats. NEVER guess or fabricate command parameters, command templates, API parameters, or file paths from memory or assumptions. NEVER present command templates to the user without first verifying them against the skill documentation. If unsure about a command or parameter, read the corresponding reference document first. This rule applies to ALL steps: scan command templates (stmt/sbom/mvn_analyse/container_mig), ECS creation parameters, network configuration, script execution, etc.See Security Rules.
End-to-end workflow for Kunpeng application migration assessment:
devkit-ecs-* prefix ECS (MANDATORY before any flavor/OS selection); if found, list all for user to choose reuse or create new; if reuse → skip Steps 4B-6, proceed to Step 7; if create new or none found → proceed to Step 4Bdevkit-ecs-{timestamp}; resolve credentials (no defaults). Image query uses ECS Nova API (GET /v2.1/{project_id}/images/detail) with HW_ARCH == "x86_64" architecture check and GPU keyword exclusion (gpu/with cuda/with tesla/with graphic/vroce)encrypt-nodes-verify.sh → verify SSH to target servers from DevKit server → ready for scan<scan_mode>_<nodes_IP>_<timestamp>CRITICAL: Step 8 (Scan) is ONLY executed when the user explicitly requests it. Do NOT proceed with scans without explicit user request.
This skill uses two categories of commands with distinct execution modes:
All Huawei Cloud resource operations (ECS, EIP, VPC, Subnet, Security Group, configure) are executed via hcloud CLI. These commands have CLI equivalents and most also have SDK/API equivalents.
cli (hcloud CLI)hcloud ECS CreateServers, hcloud VPC ListVpcs, hcloud configure set, etc.The following 4 local scripts are executed manually on the Agent or DevKit server. They do not have hcloud CLI, SDK, or API equivalents — they are custom scripts for SSH operations, DevKit installation, encryption, and scanning.
| Script | Purpose | Executor | Risk Level | SDK/API |
|---|---|---|---|---|
scripts/devkit_remote.py | SSH/SFTP to DevKit server (paramiko), EIP auto-resolve from hcloud | manual | high | Not available |
scripts/encrypt-nodes-verify.sh | Encrypt plaintext passwords in nodes.conf & verify SSH to targets | manual | high | Not available |
scripts/install_devkit.sh | Install DevKit CLI + Maven on DevKit server (auto-detect arch) | manual | high | Not available |
scripts/scan_devkit.sh | Execute DevKit sys-mig scan (stmt/sbom/mvn_analyse/container_mig) | manual | high | Not available |
Note:
devkit_remote.pyinternally callshcloudCLI for EIP resolution, but the script itself is a local Python script (requiresparamiko) and cannot be mapped to a single hcloud command or SDK method.
These guidelines apply to ALL SSH remote operations performed via devkit_remote.py throughout the workflow. Following them prevents two classes of failures: missing PATH in non-interactive shells and incorrect command parsing due to unescaped shell metacharacters.
devkit_remote.py MUST go through ssh_exec() with login_shell=True, including report discovery (find, cat) commands.client.exec_command() directly — it bypasses bash -l -c wrapping, causing PATH missing in non-interactive shells where tools like devkit, sys-mig, and maven are not found.login_shell=False explicitly to ssh_exec() instead of bypassing the function entirely. This makes the intent explicit rather than silently dropping the wrapper.bash -l -c, ALWAYS use shlex.quote(cmd) to escape the original command string.wrapped = f"bash -l -c {shlex.quote(cmd)}"f"bash -l -c '{cmd}') — commands containing single quotes, spaces, or shell metacharacters will be parsed incorrectly by the remote shell.uname -m → bash -l -c 'uname -m'bash ${DEVKIT_HOME}/install_devkit.sh 2.1.0 → bash -l -c 'bash ${DEVKIT_HOME}/install_devkit.sh 2.1.0'NEVER create temporary script files (e.g., devkit_remote.py, _exec_scan.py). Complex SSH operations must use inline execution instead. This reinforces Security Rules #6 and #7.
bash -c "ssh -o StrictHostKeyChecking=no user@host 'command'"py -c "import paramiko; ..." — keep it single-line, avoid multi-line heredocECS ListServersDetails) over custom SSH scriptsWhen querying existing devkit resources (ECS, EIP, VPC, etc.), follow these standard steps to avoid repeated trial-and-error in local parsing.
hcloud ECS ListServersDetails --cli-region=${HUAWEI_REGION} --cli-output=json standalone to inspect the raw output format before writing any parsing logic.--filter parameters to reduce data volume and avoid heavy local parsing.hcloud EIP ListPublicips --cli-output=json 2>/dev/null, then match by vnic.port_id against the target ECS.hcloud VPC ListVpcs --cli-output=json 2>/dev/null, then filter by name prefix devkit-.Create commands such as CreateServers, CreateVpc, etc. are non-idempotent — running them twice creates two separate resources. To avoid duplicate resources, wasted quota, and unexpected charges, follow this safe creation pattern for every create-class command:
hcloud ECS CreateServers ... > create_result.json
jq or py -c, never a direct pipe. This isolates parsing from command execution and preserves the raw output for debugging.
py -c "import json; d=json.load(open('create_result.json')); print(d['serverIds'][0])"
hcloud ECS ListServersDetails --name devkit-ecs-xxx --cli-region=${HUAWEI_REGION} --cli-output=json
This pattern reinforces Security Rule #12 and applies to ALL non-idempotent hcloud create commands (CreateServers, CreateVpc, CreateSubnet, CreateSecurityGroup, etc.).
hcloud ECS CreateServers returns the following structure:
{
"job_id": "xxx",
"serverIds": ["server-id-1"]
}
Note: The response is not {server: {id, name, status}}. Parse serverIds[0] to obtain the server ID. After extracting the ID, poll hcloud ECS ShowServer --server_id <id> until status becomes ACTIVE before proceeding.
Verify hcloud CLI (≥7.2.2) and AK/SK configured. If not, install and configure. If connectivity fails, STOP.
hcloud version to verify hcloud CLI is installed and version ≥ 7.2.2hcloud configure list to check if AK/SK is configured (existence check only)hcloud configure set on behalf of the user. NEVER read AK/SK from env vars and write them into hcloud profile. Credential configuration is the user's responsibility. AI only performs hcloud configure list existence checks.hcloud configure list (verification only)hcloud ECS ListCloudServers --cli-region=cn-north-4 --limit=1 to verify connectivitySee CLI Installation & hcloud Setup.
Present 4 region options (cn-north-4, cn-east-3, cn-south-1, cn-southwest-2). No default. NEVER cache or reuse a previously selected region.
See CLI Installation & hcloud Setup.
Detect or create VPC + Subnet + Security Group by devkit-* prefix. If found, ask user whether to reuse. All network parameters (VPC name, subnet name, security group name, CIDR) MUST be confirmed by user before creation. NEVER reuse without user consent. New resource naming: VPC=devkit-vpc-{timestamp} (CIDR 192.168.0.0/16), Subnet=devkit-subnet-{timestamp} (CIDR 192.168.0.0/24, gateway 192.168.0.1), Security Group=devkit-secgroup-{timestamp}.
See Network Configuration, Architecture Selection & ECS Creation.
Detect existing ECS by devkit-ecs-* prefix using hcloud ECS ListCloudServers --cli-region=${HUAWEI_REGION}. This detection MUST be performed BEFORE any flavor/OS selection. NEVER skip this sub-step.
devkit-ecs-* ECS (name, IP, status, flavor) → ask user to choose: reuse an existing ECS or create new
🔴 HARD RULE: NEVER proceed to Step 4.2 (flavor/OS selection) without first executing Step 4.1 (detect existing ECS). NEVER create a new ECS without first asking the user whether to reuse an existing one.
Architecture is fixed to x86_64 (no ARM/aarch64). User must select flavor from available 4U8G flavors in ac/C/S/T/X series only and choose OS (CentOS 7.6 / Ubuntu 20.04). Flavor selection rule: query hcloud ECS ListFlavors --cli-region=${HUAWEI_REGION} --availability_zone=${AZ} --limit=2000 (⚠️ limit MUST be ≥2000 — some AZs have 700+ flavors; --limit=500 will miss 4U8G flavors), filter vcpus=4 (⚠️ API returns vcpus as string — always use int() conversion before comparison) and ram=8192, ONLY include flavor id matching ^ac/^c/^s/^t/^x (exclude all other series). Recommendation rule: present ≥1 flavor from each available series (ac, C, S, T, X) as options. Image selection rule (ECS Nova API): query images via ECS Nova API GET https://ecs.{region}.myhuaweicloud.com/v2.1/{project_id}/images/detail (NOT hcloud IMS ListImages), then filter in Python: ① architecture check metadata.HW_ARCH == "x86_64" (skip non-x86_64), ② GPU keyword exclusion skip images with name containing gpu/with cuda/with tesla/with graphic/vroce, ③ bare metal/ARM exclusion skip names containing baremetal/bms/arm/aarch64/kunpeng/ai/with uniagent, ④ name match image name contains OS pattern (CentOS 7.6 64bit or Ubuntu 20.04 server 64bit), ⑤ public image preference prefer metadata.__image_type == "gold". Only these 2 OS options are valid — NEVER offer other OS options. Instance name is auto-generated as devkit-ecs-{timestamp} (NOT user-selected, NOT recommended by AI). No defaults. All parameters (flavor, OS) MUST be confirmed by user before proceeding. Credentials come ONLY from DEVKIT_ECS_USER / DEVKIT_ECS_PASSWORD env vars — user must confirm these are correct before use. NEVER call hcloud ECS BatchResetServersPassword.
See Network Configuration, Architecture Selection & ECS Creation.
Prerequisite: Step 4.1 detection must have determined that a new ECS is needed (either no existing
devkit-ecs-*ECS found, or user explicitly chose "create new"). If user chose "reuse existing" in Step 4.1, this step is SKIPPED — proceed directly to Step 7.
Before ECS creation, present ALL parameters (instance name, flavor, OS, VPC, subnet, security group, adminPass source) to user for explicit confirmation. NEVER reuse without user consent. DEVKIT_ECS_EIP obtained ONLY by querying hcloud. Fixed creation params: root volume=GPSSD 40GB, EIP bandwidth=300Mbit/s (chargemode=traffic, sharetype=PER, iptype=5_bgp).
🔴 AUTO-PROCEED RULE: Once ECS creation succeeds and status is
ACTIVE, AUTOMATICALLY proceed to Step 6 — verify SSH login, upload scripts, and execute install_devkit.sh (DevKit + Maven). Do NOT wait for user confirmation. Step 6 is a mandatory continuous flow triggered by Step 5 success.
See Network Configuration, Architecture Selection & ECS Creation.
🔴 AUTO-TRIGGERED: This step is automatically triggered by Step 5 success (ECS created & ACTIVE). No user confirmation is required. Execute all 3 sub-steps as a continuous flow: verify SSH login → upload 3 shell scripts → execute install_devkit.sh (DevKit + Maven).
See DevKit Operations Workflow.
🔴 MANDATORY after Step 6: Once DevKit + Maven installation completes, the AI MUST prompt the user to configure
nodes.conffor remote scan targets. This step is required before any scan can be executed.
AI prompts user to configure nodes.conf with target server IPs, SSH credentials, and scan directories. See DevKit Operations Workflow.
AI runs encrypt-nodes-verify.sh --check to detect plaintext passwords in nodes.conf. If plaintext found, encrypts them using sys-mig -ec. See DevKit Operations Workflow.
AI verifies SSH connectivity to all target servers. If any host fails, scan is aborted. See DevKit Operations Workflow.
If the user directly requests a scan (skipping Step 7.1-7.3), the AI MUST perform the pre-scan mandatory check flow (nodes.conf exists → password encryption check → SSH verification → scan).
See DevKit Operations Workflow for detailed Step 7 configuration, encryption, and verification procedures.
Execute scan. Scan targets read from nodes.conf. Before executing any scan command, AI MUST present all scan parameters (scan mode, scan path, report path, log level) to user for explicit confirmation. NO defaults. NO execution without user approval.
Scan Trigger: Scanning can begin once Step 7 (nodes.conf configuration + encryption + SSH verification) is complete. The user may explicitly request a scan, or scanning can proceed after Step 7 passes.
-mn all); Option 2 = command-line local scan.install_devkit.sh --check-maven i.e. check_and_install_maven function for environment detection and installation) → ② ask user whether Maven repository exists on DevKit server (if not, prompt user to prepare first) → ③ proceed to scan command input. See references/devkit-operations-guide.md → "mvn_analyse Command-Line Scan".<scan_mode>_<target_server_IP>_<timestamp>, report path ${DEVKIT_HOME}/report/.🔴 Scan Type Selection Rule (MANDATORY, zero exceptions): When AI uses the
questiontool to let user select scan type, it MUST and ONLY provide the following 6 options, NEVER use inaccurate descriptions like "source migration remote scan" or "source migration local scan":
Option Label Description Requires nodes.conf stmt remote scanScan system configuration statements of remote target servers ✅ Yes stmt local scanScan system configuration statements of DevKit ECS local machine ❌ No sbom remote scanScan software package dependencies of remote target servers ✅ Yes sbom local scanScan software package dependencies of DevKit ECS local machine ❌ No mvn_analyse (Maven source migration analysis)Analyze Maven project pom.xml dependency Kunpeng compatibility, local only ❌ No container_mig (container image migration)Migrate x86 container images to ARM-compatible architecture, local only ❌ No
- NEVER provide "source migration remote scan" option (mvn_analyse does not support remote scan)
- NEVER provide "source migration local scan" option (inaccurate description, should be mvn_analyse or container_mig)
- After user selection, execute corresponding command-line scan flow
🔴 Command-Line Scan Input Rule (MANDATORY, zero exceptions): AI MUST use the
questiontool (options: []) to let user input complete scan command in a single input box. NEVER provide preset command options, NEVER use multiple input boxes to collect parameters separately. Seereferences/devkit-operations-guide.md→ "Command-Line Scan Templates & Input Rules" for detailed templates and input rules.
🔴 Post-Scan Follow-up Suggestion Rule (MANDATORY): After mvn_analyse and container_mig scan completion and report download, AI MUST display corresponding mode's follow-up suggestions in chat. See
references/devkit-operations-guide.md→ "Scan Mode Details" for each mode's "Post-Scan Follow-up Suggestions".
See DevKit Operations Workflow.
🔴 MANDATORY after scan success: After scan succeeds and report directory renaming completes, AI MUST ask user to provide local download path (no default value, must be explicitly provided by user), then download reports to local via SFTP.
See DevKit Operations Workflow.
When inline Python parsing of hcloud output raises JSONDecodeError or Traceback, the root cause is typically non-JSON content mixed into the output stream. Follow these steps to resolve:
--cli-output=json parameter to the hcloud command to request pure JSON output.2>/dev/null to the pipeline, preventing warning lines from contaminating the JSON stream.sed -n '/^{/,$p' to extract from the first { to end of output before parsing.json.load(sys.stdin): instead use raw = sys.stdin.read().strip() and manually locate the JSON boundaries, which is more resilient to leading/trailing non-JSON content.Cause: CreateServers parsing failed and was retried, but the create command is non-idempotent — each call creates a new instance.
Solution:
hcloud ECS ListServersDetails --name devkit-ecs-xxx --cli-region=${HUAWEI_REGION} --cli-output=json
hcloud ECS DeleteServers --server_ids <duplicate-id-1> --cli-region=${HUAWEI_REGION}
ACTIVE status and a bound EIP) and delete the rest.vnic.port_id), and release them:
hcloud EIP ListPublicIps --cli-region=${HUAWEI_REGION} --cli-output=json
# Identify EIPs where vnic.port_id is empty, then release:
hcloud EIP DeletePublicIp --publicip_id <orphan-eip-id> --cli-region=${HUAWEI_REGION}
Prevention: Always follow the Safe Resource Creation Pattern — output to file, parse from file, and query by name on parse failure. NEVER re-run create commands.