huaweicloud-devkit 1.0.3-dev.0 → 1.0.3-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.agents/plugins/marketplace.json +18 -18
  2. package/README.md +99 -41
  3. package/README.zh-CN.md +99 -41
  4. package/bin/setup.cjs +5 -3
  5. package/integrations/opencode/opencode.json +1 -4
  6. package/package.json +61 -42
  7. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
  8. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +4 -17
  9. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
  10. package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
  11. package/plugins/huaweicloud-core/.mcp.json +2 -5
  12. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
  13. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +32 -9
  14. package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
  15. package/plugins/huaweicloud-core/safety/policy.json +75 -99
  16. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
  17. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
  18. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
  19. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
  20. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +34 -32
  21. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
  22. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
  23. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
  24. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
  25. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
  26. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
  27. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
  28. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
  29. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
  31. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
  32. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
  33. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
  36. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
  37. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
  38. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
  39. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
  40. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
  41. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +33 -25
  42. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +51 -44
  43. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
  44. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
  45. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
  46. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
  47. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
  48. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +128 -42
  49. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
  50. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
  51. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
  52. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
  53. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
  54. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
  55. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
  56. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
  57. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +25 -2
  58. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
  59. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +27 -1
  60. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
  61. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +65 -47
  62. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
  63. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
  64. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
  65. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
  66. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
  67. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
  68. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
  69. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +123 -2
  70. package/plugins/huaweicloud-core/src/auth/credentials.mjs +77 -4
  71. package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
  72. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
  73. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +25 -7
  74. package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
  75. package/plugins/huaweicloud-core/src/mcp-server.mjs +30 -3
  76. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +73 -0
  77. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +94 -0
  78. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
  79. package/plugins/huaweicloud-core/src/safety-policy.mjs +122 -68
  80. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +14 -10
  81. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +34 -27
  82. package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
  83. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +521 -8
  84. package/plugins/huaweicloud-core/src/search-market.mjs +53 -14
  85. package/plugins/huaweicloud-core/src/setup-cli.mjs +1741 -215
  86. package/plugins/huaweicloud-core/src/tools.mjs +667 -123
  87. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
  88. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
  89. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +12 -15
  90. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
  91. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
  92. package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +267 -0
  93. package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
  94. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +9 -5
  95. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +0 -190
  96. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +0 -124
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: huawei-deployment
3
- description: "Use when creating, managing, or running deployment tasks and pipelines on Huawei Cloud CloudDeploy. Triggers: CloudDeploy, deployment, CI/CD, pipeline, release, artifact deployment, deploy task. NOT for: CodeArts Build (build pipeline), SWR container registry."
3
+ description: 'Use when creating, managing, or running deployment tasks and pipelines on Huawei Cloud CloudDeploy. Triggers: CloudDeploy, deployment, CI/CD, pipeline, release, artifact deployment, deploy task. NOT for: CodeArts Build (build pipeline), SWR container registry.'
4
4
  version: 1
5
5
  ---
6
6
 
@@ -16,32 +16,33 @@ Domain expertise for Huawei Cloud CloudDeploy. Covers application creation, depl
16
16
 
17
17
  ## Critical Warnings
18
18
 
19
- | Trap | Why |
20
- |------|-----|
21
- | Service name may be `CodeArtsDeploy` | hcloud service name for deployment may be `CodeArtsDeploy` instead of `CloudDeploy`. Run `hcloud --help` to verify |
22
- | Deployment hosts need agent | Install CloudDeploy agent on target hosts first |
23
- | Task must reference application first | Create application before task |
24
- | Artifact source defaults to OBS | Most deployment tasks pull artifacts from OBS. Ensure bucket and object exist |
25
- | Parallel deployments may conflict | Lock resources or use deployment groups |
19
+ | Trap | Why |
20
+ | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | **Flyway SQL dialect mismatch (H2 dev → MySQL prod)** | Spring Boot apps commonly develop with H2 in-memory DB, then deploy to RDS MySQL. Flyway migrations using H2-specific syntax (e.g. `DATEADD`, `CHARACTER_LENGTH`, `BOOLEAN`) silently succeed on H2 but fail on MySQL. Before deploying, audit `V*__*.sql` migration files: replace `DATEADD` with `DATE_ADD`, `BOOLEAN` with `TINYINT(1)`, remove `characterEncoding=utf8mb4` from Spring Boot datasource URL (KooCLI RDS CreateInstance sets charset at the instance level). Use `Flyway.validate-on-migrate=true` in CI to catch dialect issues early. |
22
+ | Service name may be `CodeArtsDeploy` | hcloud service name for deployment may be `CodeArtsDeploy` instead of `CloudDeploy`. Run `hcloud --help` to verify |
23
+ | Deployment hosts need agent | Install CloudDeploy agent on target hosts first |
24
+ | Task must reference application first | Create application before task |
25
+ | Artifact source defaults to OBS | Most deployment tasks pull artifacts from OBS. Ensure bucket and object exist |
26
+ | Parallel deployments may conflict | Lock resources or use deployment groups |
26
27
 
27
28
  ## Common Workflows
28
29
 
29
- | Task | Operation |
30
- |------|-----------|
31
- | Create application | `CreateApp --name=<n> --platform=<p> --cli-region=<r>` |
30
+ | Task | Operation |
31
+ | ---------------------- | ---------------------------------------------------------------- |
32
+ | Create application | `CreateApp --name=<n> --platform=<p> --cli-region=<r>` |
32
33
  | Create deployment task | `CreateTask --name=<n> --app_id=<id> --artifact_source_type=OBS` |
33
- | Start deployment | `StartTask --task_id=<id>` |
34
- | List tasks | `ListTasks --app_id=<id>` |
35
- | Delete task | `DeleteTask --task_id=<id>` |
34
+ | Start deployment | `StartTask --task_id=<id>` |
35
+ | List tasks | `ListTasks --app_id=<id>` |
36
+ | Delete task | `DeleteTask --task_id=<id>` |
36
37
 
37
38
  ## Troubleshooting
38
39
 
39
- | Error | Fix |
40
- |-------|-----|
41
- | Agent offline | Check agent service on target host, network connectivity, firewall rules |
42
- | Deployment timeout | Check artifact size, increase task timeout, verify target host resources |
43
- | Artifact not found | Verify OBS bucket and object path, check artifact permissions |
44
- | Permission denied | Verify IAM roles for deployment: `CodeArtsDeploy FullAccess` or custom policy |
40
+ | Error | Fix |
41
+ | ------------------ | ----------------------------------------------------------------------------- |
42
+ | Agent offline | Check agent service on target host, network connectivity, firewall rules |
43
+ | Deployment timeout | Check artifact size, increase task timeout, verify target host resources |
44
+ | Artifact not found | Verify OBS bucket and object path, check artifact permissions |
45
+ | Permission denied | Verify IAM roles for deployment: `CodeArtsDeploy FullAccess` or custom policy |
45
46
 
46
47
  ## Security
47
48
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: huawei-dew
3
- description: "Use when managing secrets, credentials, encryption keys, certificates, or any sensitive data on Huawei Cloud. Covers CSMS (Cloud Secret Management Service) for secrets, KMS for encryption keys, and credential rotation. Triggers on: secret, credential, API key, token, password, encrypt, decrypt, KMS, CSMS, DEW, certificate, CSR, rotation. Activates for ANY task involving secrets or credentials — load this skill first before touching secrets."
3
+ description: 'Use when managing secrets, credentials, encryption keys, certificates, or any sensitive data on Huawei Cloud. Covers CSMS (Cloud Secret Management Service) for secrets, KMS for encryption keys, and credential rotation. Triggers on: secret, credential, API key, token, password, encrypt, decrypt, KMS, CSMS, DEW, certificate, CSR, rotation. Activates for ANY task involving secrets or credentials — load this skill first before touching secrets.'
4
4
  version: 1
5
5
  ---
6
6
 
@@ -16,64 +16,73 @@ Domain expertise for Huawei Cloud Data Encryption Workshop (DEW). Covers CSMS fo
16
16
 
17
17
  ## Critical Warnings
18
18
 
19
- | Trap | Why |
20
- |------|-----|
21
- | NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection |
22
- | NEVER echo credentials in conversation | AK/SK, passwords, tokens must never appear in chat |
23
- | KMS key deletion is irreversible | 7-30 day pending deletion window. Once gone, data is unrecoverable |
24
- | Secret rotation requires automation | Manual rotation risks stale credentials |
25
- | Cross-account KMS needs grants | KMS keys are regional. Cross-region data needs grant setup |
19
+ | Trap | Why |
20
+ | -------------------------------------------- | ------------------------------------------------------------------ |
21
+ | NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection |
22
+ | NEVER echo credentials in conversation | AK/SK, passwords, tokens must never appear in chat |
23
+ | KMS key deletion is irreversible | 7-30 day pending deletion window. Once gone, data is unrecoverable |
24
+ | Secret rotation requires automation | Manual rotation risks stale credentials |
25
+ | Cross-account KMS needs grants | KMS keys are regional. Cross-region data needs grant setup |
26
26
 
27
27
  ## CSMS Operations
28
28
 
29
29
  ### Read-only (safe — metadata only)
30
- | Operation | Description |
31
- |-----------|-------------|
32
- | ListSecrets | List all secrets (names only, no values) |
33
- | DescribeSecret | Get secret metadata (rotation config, KMS key, status) |
34
- | ListSecretVersions | List version IDs and stages (no values) |
30
+
31
+ | Operation | Description |
32
+ | ------------------ | ------------------------------------------------------ |
33
+ | ListSecrets | List all secrets (names only, no values) |
34
+ | DescribeSecret | Get secret metadata (rotation config, KMS key, status) |
35
+ | ListSecretVersions | List version IDs and stages (no values) |
35
36
 
36
37
  ### Secret Value (blocked by policy — use runtime injection)
37
- | Operation | Safe Alternative |
38
- |-----------|-----------------|
39
- | DownloadSecret | Use {{resolve:csms:secret-id}} in IaC or SDK |
38
+
39
+ | Operation | Safe Alternative |
40
+ | ----------------- | --------------------------------------------- |
41
+ | DownloadSecret | Use {{resolve:csms:secret-id}} in IaC or SDK |
40
42
  | ShowSecretVersion | Use runtime injection, never in agent context |
41
- | GetSecretValue | Blocked. Use MCP proxy resolve pattern |
43
+ | GetSecretValue | Blocked. Use MCP proxy resolve pattern |
42
44
 
43
45
  ## KMS Operations
44
46
 
45
- | Task | Command | Notes |
46
- |------|---------|-------|
47
- | List keys | hcloud KMS ListKeys | Read-only |
48
- | Create key | hcloud KMS CreateKey --key_alias=<name> | Requires write approval |
49
- | Encrypt | hcloud KMS EncryptData --key_id=<id> --plaintext=<b64> | Prefer SDK offline encrypt |
50
- | Decrypt | hcloud KMS DecryptData (**BLOCKED**) | Use runtime injection |
47
+ | Task | Command | Notes |
48
+ | ---------- | ------------------------------------------------------ | -------------------------- |
49
+ | List keys | hcloud KMS ListKeys | Read-only |
50
+ | Create key | hcloud KMS CreateKey --key_alias=<name> | Requires write approval |
51
+ | Encrypt | hcloud KMS EncryptData --key_id=<id> --plaintext=<b64> | Prefer SDK offline encrypt |
52
+ | Decrypt | hcloud KMS DecryptData (**BLOCKED**) | Use runtime injection |
51
53
 
52
54
  ## Runtime Injection Pattern
53
55
 
54
56
  `ash
57
+
55
58
  # Terraform / IaC
59
+
56
60
  resource "huaweicloud_csms_secret" "db_password" {
57
- secret_string = var.db_password # NEVER hardcode
61
+ secret_string = var.db_password # NEVER hardcode
58
62
  }
59
63
 
60
64
  # SDK
65
+
61
66
  secret_value = client.get_secret(secret_id="my-secret")
67
+
62
68
  # Use immediately, never print or store in context
63
69
 
64
70
  # hcloud (for approved automation only)
71
+
65
72
  hcloud CSMS DownloadSecret --secret_name=<name>
73
+
66
74
  # WARNING: Output goes to stdout. Pipe directly, never capture in agent.
75
+
67
76
  `
68
77
 
69
78
  ## Troubleshooting
70
79
 
71
- | Error | Root Cause -> Fix |
72
- |-------|------------------|
73
- | Secret not found | Wrong region or project -> Verify secret ARN includes region/project |
74
- | AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt |
75
- | KMS key disabled | Key scheduled for deletion or manually disabled -> Enable or create new key |
76
- | Rotation stuck | Lambda/Python function error -> Check rotation function logs |
80
+ | Error | Root Cause -> Fix |
81
+ | -------------------- | --------------------------------------------------------------------------- |
82
+ | Secret not found | Wrong region or project -> Verify secret ARN includes region/project |
83
+ | AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt |
84
+ | KMS key disabled | Key scheduled for deletion or manually disabled -> Enable or create new key |
85
+ | Rotation stuck | Lambda/Python function error -> Check rotation function logs |
77
86
 
78
87
  ## Security Considerations
79
88
 
@@ -1,28 +1,35 @@
1
1
  # CSMS Usage Guide
2
2
 
3
3
  ## Create Secret
4
+
4
5
  hcloud CSMS CreateSecret --secret_name=prod-db-password --secret_string='{"password":"CHANGE_ME"}'
5
6
 
6
7
  ## List Secrets (metadata only)
8
+
7
9
  hcloud CSMS ListSecrets
8
10
 
9
11
  ## Describe Secret
12
+
10
13
  hcloud CSMS DescribeSecret --secret_name=prod-db-password
11
14
 
12
15
  ## List Versions
16
+
13
17
  hcloud CSMS ListSecretVersions --secret_name=prod-db-password
14
18
 
15
19
  ## Runtime Injection (Terraform)
20
+
16
21
  data "huaweicloud_csms_secret" "db" {
17
- secret_name = "prod-db-password"
22
+ secret_name = "prod-db-password"
18
23
  }
19
24
  Use: data.huaweicloud_csms_secret.db.secret_string
20
25
 
21
26
  ## Rotation
27
+
22
28
  - Enable auto-rotation: hcloud CSMS EnableSecretRotation --secret_name=<name> --rotation_interval=30
23
29
  - Rotation function ARN: provide Lambda to generate new secret value
24
30
 
25
31
  ## Policy Rules
32
+
26
33
  - hcloud CSMS DownloadSecret -> BLOCKED (use runtime injection)
27
34
  - hcloud CSMS ShowSecretVersion -> BLOCKED
28
35
  - hcloud CSMS ListSecrets -> ALLOWED (metadata only)
@@ -1,23 +1,29 @@
1
1
  # KMS Usage Guide
2
2
 
3
3
  ## Create Key
4
+
4
5
  hcloud KMS CreateKey --key_alias=app-encryption-key --key_description="Application data encryption"
5
6
 
6
7
  ## List Keys (metadata only)
8
+
7
9
  hcloud KMS ListKeys
8
10
 
9
11
  ## Encrypt (offline preferred)
12
+
10
13
  hcloud KMS EncryptData --key_id=<key-id> --plaintext=<base64-data>
11
14
 
12
15
  ## Decrypt (BLOCKED - use runtime)
16
+
13
17
  DO NOT use hcloud KMS DecryptData directly.
14
18
  Use SDK with KMS client in application runtime.
15
19
 
16
20
  ## Key Rotation
21
+
17
22
  - Enable: hcloud KMS EnableKeyRotation --key_id=<key-id>
18
23
  - Rotation period: 365 days (default)
19
24
 
20
25
  ## Key Deletion
26
+
21
27
  - Schedule: hcloud KMS ScheduleKeyDeletion --key_id=<key-id> --pending_days=7
22
28
  - Cancel during pending window: hcloud KMS CancelKeyDeletion --key_id=<key-id>
23
29
  - WARNING: After deletion window passes, data encrypted with this key is UNRECOVERABLE
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: huawei-ecs
3
- description: "Use when creating, configuring, managing, or troubleshooting ECS instances on Huawei Cloud. Covers instance creation (hcloud ECS CreateServers), flavor selection, image management, security groups, EIP binding, disk attachment, auto-scaling (AS), and troubleshooting. Triggers on: ECS, instance, flavor, image, security group, EIP, EVS, auto-scaling. NOT for: CCE container workloads (use huawei-cce), BMS bare metal servers."
3
+ description: 'Use when creating, configuring, managing, or troubleshooting ECS instances on Huawei Cloud. Covers instance creation (hcloud ECS CreateServers), flavor selection, image management, security groups, EIP binding, disk attachment, auto-scaling (AS), and troubleshooting. Triggers on: ECS, instance, flavor, image, security group, EIP, EVS, auto-scaling. NOT for: CCE container workloads (use huawei-cce), BMS bare metal servers.'
4
4
  version: 1
5
5
  ---
6
6
 
@@ -17,6 +17,7 @@ Domain expertise for Huawei Cloud Elastic Cloud Server (ECS). Covers instance li
17
17
  ## Prerequisites
18
18
 
19
19
  Before creating an ECS instance from scratch, you MUST have:
20
+
20
21
  - A VPC (see `huawei-vpc`)
21
22
  - A subnet with DNS configured (see `huawei-vpc`)
22
23
  - A security group with application ports open (see `huawei-vpc`)
@@ -25,39 +26,39 @@ If these do not exist, load the `huawei-vpc` skill first and create them before
25
26
 
26
27
  ## Critical Warnings
27
28
 
28
- | Trap | Why |
29
- |------|-----|
30
- | Flavor not in region | Not all flavors available everywhere. Check with ECS ListFlavors first |
31
- | Security group denies all | New SGs deny ALL inbound. Must explicitly add rules |
32
- | EIP bills when idle | Unattached EIP still incurs charges |
33
- | Stopped instance still bills | Pay-per-use instances bill when stopped (unless shutdown-no-billing flavor) |
34
- | Disk survives instance delete | Deleting instance does NOT delete system disk by default |
29
+ | Trap | Why |
30
+ | ----------------------------- | --------------------------------------------------------------------------- |
31
+ | Flavor not in region | Not all flavors available everywhere. Check with ECS ListFlavors first |
32
+ | Security group denies all | New SGs deny ALL inbound. Must explicitly add rules |
33
+ | EIP bills when idle | Unattached EIP still incurs charges |
34
+ | Stopped instance still bills | Pay-per-use instances bill when stopped (unless shutdown-no-billing flavor) |
35
+ | Disk survives instance delete | Deleting instance does NOT delete system disk by default |
35
36
 
36
37
  ## Flavor Selection Guide
37
38
 
38
39
  Flavor families are **region-dependent**. Always run `hcloud ECS ListFlavors --cli-region=<r>` to discover available flavors before recommending.
39
40
 
40
- | Scenario | Family | What to look for |
41
- |----------|--------|-----------------|
42
- | Web app / microservices | General-purpose (ac, s, sn, c) | 2-4 vCPU, 4-8 GB RAM |
43
- | Database / big data | Memory-optimized (m, r) | 4-8 vCPU, 16-64 GB RAM |
44
- | AI inference | GPU (g, p) | 8+ vCPU, 64+ GB RAM + GPU |
45
- | HPC | High-IO (h, ir, i) | 8+ vCPU, local SSD |
41
+ | Scenario | Family | What to look for |
42
+ | ----------------------- | ------------------------------ | ------------------------- |
43
+ | Web app / microservices | General-purpose (ac, s, sn, c) | 2-4 vCPU, 4-8 GB RAM |
44
+ | Database / big data | Memory-optimized (m, r) | 4-8 vCPU, 16-64 GB RAM |
45
+ | AI inference | GPU (g, p) | 8+ vCPU, 64+ GB RAM + GPU |
46
+ | HPC | High-IO (h, ir, i) | 8+ vCPU, local SSD |
46
47
 
47
48
  > See `references/flavors.md` for discovery workflow. **Do not hardcode flavor names** — availability changes by region and over time.
48
49
 
49
50
  ## Common Workflows
50
51
 
51
- | Task | Command | Steps |
52
- |------|---------|-------|
53
- | List flavors | hcloud ECS ListFlavors --cli-region=<region> | references/flavors.md |
54
- | Create instance | hcloud ECS CreateServers --server.name=<n> --server.flavorRef=<id> --server.imageRef=<id> --server.nics.1.subnet_id=<id> --server.availability_zone=<az> | references/create-instance.md |
55
- | Find by name | See "How to search for instances" below | |
56
- | Bind EIP | hcloud EIP AssociatePublicips --publicip_id=<id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT | Get port ID from `hcloud ECS ListServersDetails --server_id=<id>` → `OS-EXT-IPS:port_id` |
57
- | Security group rule | hcloud VPC CreateSecurityGroupRule --security_group_id=<id> --direction=<direction> --protocol=<protocol> | references/sg.md |
58
- | Attach disk | hcloud EVS AttachVolume --volume_id=<id> --server_id=<id> | references/evs.md |
59
- | Delete instance | hcloud ECS DeleteServers --servers.1.id=<id> --delete_publicip=true --delete_volume=true | references/create-instance.md |
60
- | Reboot instance | hcloud ECS BatchRebootServers --reboot.servers.1.id=<id> --reboot.type=SOFT | NOT `RebootServer` — that operation does not exist |
52
+ | Task | Command | Steps |
53
+ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
54
+ | List flavors | hcloud ECS ListFlavors --cli-region=<region> | references/flavors.md |
55
+ | Create instance | hcloud ECS CreateServers --server.name=<n> --server.flavorRef=<id> --server.imageRef=<id> --server.nics.1.subnet_id=<id> --server.availability_zone=<az> | references/create-instance.md |
56
+ | Find by name | See "How to search for instances" below | |
57
+ | Bind EIP | hcloud EIP AssociatePublicips --publicip_id=<id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT | Get port ID from `hcloud ECS ListServersDetails --server_id=<id>` → `OS-EXT-IPS:port_id` |
58
+ | Security group rule | hcloud VPC CreateSecurityGroupRule --security_group_id=<id> --direction=<direction> --protocol=<protocol> | references/sg.md |
59
+ | Attach disk | hcloud EVS AttachVolume --volume_id=<id> --server_id=<id> | references/evs.md |
60
+ | Delete instance | hcloud ECS DeleteServers --servers.1.id=<id> --delete_publicip=true --delete_volume=true | references/create-instance.md |
61
+ | Reboot instance | hcloud ECS BatchRebootServers --reboot.servers.1.id=<id> --reboot.type=SOFT | NOT `RebootServer` — that operation does not exist |
61
62
 
62
63
  ## How to Search for Instances
63
64
 
@@ -112,6 +113,7 @@ ssh -o StrictHostKeyChecking=accept-new -i <key> root@<eip> 'command'
112
113
  ```
113
114
 
114
115
  Example — re-run failed cloud-init setup manually:
116
+
115
117
  ```bash
116
118
  ssh -o StrictHostKeyChecking=accept-new -i <key> root@<eip> 'dnf install -y nginx && systemctl enable --now nginx'
117
119
  ```
@@ -127,14 +129,14 @@ ssh -o StrictHostKeyChecking=accept-new -i <key> root@<eip> 'dnf install -y ngin
127
129
 
128
130
  ## Troubleshooting
129
131
 
130
- | Error | Root Cause -> Fix |
131
- |-------|------------------|
132
- | Cannot SSH | SG missing port 22 or no EIP -> Add ingress rule / Bind EIP |
133
- | Flavor unavailable | Region limitation -> ListFlavors in target region |
134
- | Insufficient resources | Stock depleted -> Change flavor or AZ |
135
- | AuthFailure | Expired AK/SK -> re-run `npx huaweicloud-devkit auth init` |
136
- | APIGW.0802 / region permission | IAM user has no access to this region -> IAM console → User → Permissions → add region, or switch to another region |
137
- | Cannot SSH (port 22 open) | SCP policy may be blocking SSH. Check `SYS.0403` errors in command output -> Use cloud-init/user_data for initial setup instead. See `references/create-instance.md` §Bootstrap |
132
+ | Error | Root Cause -> Fix |
133
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
134
+ | Cannot SSH | SG missing port 22 or no EIP -> Add ingress rule / Bind EIP |
135
+ | Flavor unavailable | Region limitation -> ListFlavors in target region |
136
+ | Insufficient resources | Stock depleted -> Change flavor or AZ |
137
+ | AuthFailure | Expired AK/SK -> re-run `npx huaweicloud-devkit auth init` |
138
+ | APIGW.0802 / region permission | IAM user has no access to this region -> IAM console → User → Permissions → add region, or switch to another region |
139
+ | Cannot SSH (port 22 open) | SCP policy may be blocking SSH. Check `SYS.0403` errors in command output -> Use cloud-init/user_data for initial setup instead. See `references/create-instance.md` §Bootstrap |
138
140
 
139
141
  ## Security Considerations
140
142
 
@@ -158,6 +160,7 @@ Prefer these tools over raw hcloud CLI — they enforce safety policies:
158
160
  ## Without MCP (Fallback)
159
161
 
160
162
  If MCP tools are NOT available (new install, session not restarted):
163
+
161
164
  - Raw hcloud commands WILL appear in shell history — passwords and secrets are at risk
162
165
  - Always use key_name instead of adminPass
163
166
  - Verify safety manually: no secret value reads, no credential file access
@@ -171,10 +174,10 @@ Fall back to hcloud CLI. State: "MCP unavailable, using local hcloud CLI."
171
174
 
172
175
  Flexus is the lightweight ECS family. Two variants:
173
176
 
174
- | Variant | API | CLI | Billing |
175
- |---------|-----|:---:|---------|
176
- | **Flexus L** | HCSS (hcss:lightInstances) | ❌ No hcloud — Python SDK only | Prepaid only |
177
- | **Flexus X** | Standard ECS API | ✅ `hcloud ECS` with `x1.*` flavors | On-demand & prepaid |
177
+ | Variant | API | CLI | Billing |
178
+ | ------------ | -------------------------- | :---------------------------------: | ------------------- |
179
+ | **Flexus L** | HCSS (hcss:lightInstances) | ❌ No hcloud — Python SDK only | Prepaid only |
180
+ | **Flexus X** | Standard ECS API | ✅ `hcloud ECS` with `x1.*` flavors | On-demand & prepaid |
178
181
 
179
182
  For Flexus X, use standard ECS CreateServers flow with `x1.*` flavors. For Flexus L, manual console provisioning is recommended — no KooCLI path exists.
180
183
 
@@ -3,10 +3,12 @@
3
3
  **Before executing any command: If MCP tools are not available** (new session after install), restart your session or use hcloud CLI directly with caution. Commands using adminPass/password WILL appear in shell history — prefer key_name.
4
4
 
5
5
  ## 1. Discover flavors
6
+
6
7
  hcloud ECS ListFlavors --cli-region=<region> --cli-output=json
7
8
  Filter for `os_extra_specs.cond:operation:status == normal` — most results are abandoned. See references/flavors.md.
8
9
 
9
10
  ## 2. Find availability zones
11
+
10
12
  hcloud ECS NovaListAvailabilityZones --cli-region=<region>
11
13
 
12
14
  ## 3. Find image
@@ -19,27 +21,32 @@ hcloud IMS ListImages --cli-region=<region> --__imagetype=gold --__isregistered=
19
21
  If searching by name (e.g. --name="Ubuntu") returns empty: use broad search without name filter, pick from results. Some regions only offer Huawei Cloud EulerOS (HCE).
20
22
 
21
23
  Common images (verify live per region):
22
- | Image | Region | ID |
23
- |-------|--------|----|
24
+
25
+ | Image | Region | ID |
26
+ | ---------------- | ---------- | ------------------------------------ |
24
27
  | HCE 2.0 Standard | cn-north-4 | 7d940784-ac0a-425f-b3fa-8478f1a1df70 |
25
- | Ubuntu 22.04 | Query live | Query live |
26
- | CentOS 8.2 | Query live | Query live |
28
+ | Ubuntu 22.04 | Query live | Query live |
29
+ | CentOS 8.2 | Query live | Query live |
27
30
 
28
31
  ## 4. Verify or create VPC/subnet
32
+
29
33
  hcloud VPC ListVpcs --cli-region=<region>
30
34
  hcloud VPC ListSubnets --vpc_id=<vpc-id> --cli-region=<region>
31
35
  If no VPC/subnet exists: load `huawei-vpc` skill → create VPC → create subnet (with DNS) → create security group → return here.
32
36
 
33
37
  ## 5. Create keypair (recommended over adminPass)
38
+
34
39
  hcloud ECS NovaCreateKeypair --keypair.name=<name>
35
40
  Save the returned private key to a local file. The public key is auto-injected.
36
41
 
37
42
  Password alternative:
43
+
38
44
  - adminPass: 8-26 chars, must have uppercase + lowercase + digit + special char
39
45
  - Passwords appear ONCE in creation output and are not retrievable
40
46
  - Passwords are logged in shell history — this is a security risk
41
47
 
42
48
  ## 6. Create instance
49
+
43
50
  hcloud ECS CreateServers --cli-region=<region> --server.name=<name> --server.flavorRef=<flavor-id> --server.imageRef=<image-id> --server.nics.1.subnet_id=<subnet-id> --server.root_volume.volumetype=<type> --server.root_volume.size=<minsize> --server.vpcid=<vpc-id> --server.availability_zone=<az> --server.key_name=<keypair-name> --server.count=1
44
51
 
45
52
  ### Bootstrap with user_data (cloud-init)
@@ -63,6 +70,7 @@ hcloud ECS CreateServers ... --server.user_data=$user_data
63
70
  > **Debugging**: If the script didn't run, check `/var/log/cloud-init-output.log` on the instance.
64
71
  >
65
72
  > **Recovery after failure**: user_data only executes on **first boot**. Restarting the instance will NOT re-run user_data scripts. If cloud-init fails (e.g., DNS missing → `yum`/`apt` cannot resolve repos):
73
+ >
66
74
  > 1. Fix the root cause (e.g., update subnet DNS via `VPC UpdateSubnet`)
67
75
  > 2. Either: SSH into the instance and run the setup commands manually (see `huawei-ecs` → SSH Connection Verification → Running Commands Inside the Instance)
68
76
  > 3. Or: Delete the instance and recreate with corrected user_data (fresh boot)
@@ -70,6 +78,7 @@ hcloud ECS CreateServers ... --server.user_data=$user_data
70
78
  ## 7. EIP (two methods)
71
79
 
72
80
  ### Method A: Inline with CreateServers (Recommended)
81
+
73
82
  Add EIP parameters to the `CreateServers` command in step 6:
74
83
 
75
84
  ```bash
@@ -84,6 +93,7 @@ hcloud ECS CreateServers \
84
93
  > **Trap**: Parameter names differ from `EIP CreatePublicip`. Use `iptype` (not `type`), `sharetype` (not `share_type`), and `chargemode` (not `charging_mode`). Always verify with `hcloud ECS CreateServers --help`.
85
94
 
86
95
  ### Method B: Create and bind separately
96
+
87
97
  hcloud EIP CreatePublicip --publicip.type=<type> --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
88
98
 
89
99
  ```bash
@@ -131,3 +141,4 @@ Warning: --delete_publicip and --delete_volume default to false. Set to true to
131
141
  - Flavor: must be available in target region — always ListFlavors first
132
142
  - Root volume: SSD 40GB min
133
143
  - Keypair is safer than adminPass (passwords leak into shell history)
144
+ ```
@@ -20,21 +20,23 @@ hcloud ECS ListFlavors --cli-region=<region> --cli-output=json \
20
20
 
21
21
  ## Step 2: Filter by scenario
22
22
 
23
- | Scenario | Look for | Preference |
24
- |----------|----------|------------|
25
- | Web app / microservices | General-purpose families (ac, s, sn) | 2-4 vCPU, 4-8 GB RAM |
26
- | Database / big data | Memory-optimized families (m, r) | 4-8 vCPU, 16-64 GB RAM |
27
- | AI inference / training | GPU families (g, p) | 8+ vCPU, 64+ GB RAM |
28
- | HPC / high throughput | High-IO families (h, ir, i) | 8+ vCPU, local SSD |
23
+ | Scenario | Look for | Preference |
24
+ | ----------------------- | ------------------------------------ | ---------------------- |
25
+ | Web app / microservices | General-purpose families (ac, s, sn) | 2-4 vCPU, 4-8 GB RAM |
26
+ | Database / big data | Memory-optimized families (m, r) | 4-8 vCPU, 16-64 GB RAM |
27
+ | AI inference / training | GPU families (g, p) | 8+ vCPU, 64+ GB RAM |
28
+ | HPC / high throughput | High-IO families (h, ir, i) | 8+ vCPU, local SSD |
29
29
 
30
30
  ## Step 3: Match spec from ListFlavors output
31
31
 
32
32
  Common naming pattern: `<family><gen>.<type>x<ratio>`
33
+
33
34
  - `ac6.2xlarge.2` = ac6 family, 2xlarge (8 vCPU), ratio 2 (vCPU:RAM = 1:2 → 16 GB)
34
35
 
35
36
  ## Do Not Hardcode
36
37
 
37
38
  Flavor family names are region-dependent. Example discrepancies seen in testing:
39
+
38
40
  - cn-south-1: ac6/ac7/kc/r-c7e (s6/m6/g6 NOT available)
39
41
  - Other regions may have s6/m6/g6 families
40
42
 
@@ -44,10 +46,10 @@ Always run ListFlavors and pick from actual results.
44
46
 
45
47
  `ListFlavors` returns ALL specs including abandoned ones. Before selecting a spec, check the `os_extra_specs` field in the JSON response:
46
48
 
47
- | Field | Values | Meaning |
48
- |-------|--------|---------|
49
+ | Field | Values | Meaning |
50
+ | -------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------ |
49
51
  | `os_extra_specs.cond:operation:status` | `normal`, `abandon`, `sellout` | Only `normal` specs can be created. `abandon` = deprecated, `sellout` = out of stock |
50
- | `os_extra_specs.cond:operation:az` | e.g. `cn-north-4g(normal)` | Spec is available in this AZ. Multiple entries = multiple AZ support |
52
+ | `os_extra_specs.cond:operation:az` | e.g. `cn-north-4g(normal)` | Spec is available in this AZ. Multiple entries = multiple AZ support |
51
53
 
52
54
  A flavor can be `normal` globally but `abandon` in specific AZs. Selecting an `abandon` or `sellout` spec will fail with **`Ecs.0019`** at creation time — there is no pre-flight validation in `ListFlavors`. If creation fails:
53
55
 
@@ -4,16 +4,16 @@
4
4
 
5
5
  ## 错误码映射
6
6
 
7
- | 错误 | 根因 | 修复 |
8
- |------|------|------|
9
- | `Ecs.0005` flavor-image 不匹配 | 镜像虚拟化类型与规格不兼容 | 检查 image `__support_amd`/`__support_xen` 与 flavor `os_extra_specs`。BareMetal 镜像不兼容标准 ECS 规格 |
10
- | `[USE_ERROR]不正确的参数:imagetype` | 参数名错误 | KooCLI 使用双下划线前缀:`--__imagetype=gold`(不是 `--imagetype`) |
11
- | `[USE_ERROR]不正确的参数:chargingMode` | 参数路径错误 | 计费模式参数路径:`--server.extendparam.chargingMode=postPaid`。不传默认按需付费 |
12
- | `[USE_ERROR]不正确的参数:__support_amd` | 参数无效 | `IMS ListImages` 某些版本不支持此过滤。去掉该参数,使用 client-side 过滤 |
13
- | Cannot SSH | 安全组未开放22端口 或 未绑定EIP | 1) 添加入方向规则 tcp 22。2) `hcloud EIP BindPublicIp` |
14
- | Flavor unavailable | 区域不支持该规格 | `hcloud ECS ListFlavors --cli-region=<r>` 先查。不硬编码 s6/m6 等规格名 |
15
- | Insufficient resources | AZ 库存不足 | 换规格、换 AZ、或等待资源释放 |
16
- | AuthFailure | AK/SK 过期或无效 | `npx huaweicloud-devkit auth init` 重新配置统一凭据 |
7
+ | 错误 | 根因 | 修复 |
8
+ | --------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------- |
9
+ | `Ecs.0005` flavor-image 不匹配 | 镜像虚拟化类型与规格不兼容 | 检查 image `__support_amd`/`__support_xen` 与 flavor `os_extra_specs`。BareMetal 镜像不兼容标准 ECS 规格 |
10
+ | `[USE_ERROR]不正确的参数:imagetype` | 参数名错误 | KooCLI 使用双下划线前缀:`--__imagetype=gold`(不是 `--imagetype`) |
11
+ | `[USE_ERROR]不正确的参数:chargingMode` | 参数路径错误 | 计费模式参数路径:`--server.extendparam.chargingMode=postPaid`。不传默认按需付费 |
12
+ | `[USE_ERROR]不正确的参数:__support_amd` | 参数无效 | `IMS ListImages` 某些版本不支持此过滤。去掉该参数,使用 client-side 过滤 |
13
+ | Cannot SSH | 安全组未开放22端口 或 未绑定EIP | 1) 添加入方向规则 tcp 22。2) `hcloud EIP BindPublicIp` |
14
+ | Flavor unavailable | 区域不支持该规格 | `hcloud ECS ListFlavors --cli-region=<r>` 先查。不硬编码 s6/m6 等规格名 |
15
+ | Insufficient resources | AZ 库存不足 | 换规格、换 AZ、或等待资源释放 |
16
+ | AuthFailure | AK/SK 过期或无效 | `npx huaweicloud-devkit auth init` 重新配置统一凭据 |
17
17
 
18
18
  ## 创建失败诊断流程
19
19
 
@@ -38,10 +38,10 @@ hcloud IMS ListImages --cli-region=<r> --__imagetype=gold --__isregistered=true
38
38
 
39
39
  ## 密钥对 vs 密码
40
40
 
41
- | 方式 | 安全 | 建议 |
42
- |------|------|------|
41
+ | 方式 | 安全 | 建议 |
42
+ | -------------------------- | ----- | -------------------------------------------------- |
43
43
  | `--server.key_name=<name>` | ✅ 高 | **推荐**。先 `hcloud DEW CreateKeypair` 创建密钥对 |
44
- | `--server.adminPass=<pw>` | ❌ 低 | 密码明文进入 shell 历史。仅测试用 |
44
+ | `--server.adminPass=<pw>` | ❌ 低 | 密码明文进入 shell 历史。仅测试用 |
45
45
 
46
46
  密码要求:8-26 字符,含大写 + 小写 + 数字 + 特殊字符。
47
47