huaweicloud-devkit 0.1.21 → 0.1.25-dev.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 (66) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +169 -169
  4. package/bin/setup.cjs +7 -7
  5. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  6. package/integrations/opencode/opencode.json +14 -14
  7. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +30 -30
  8. package/package.json +43 -43
  9. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +43 -43
  10. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +42 -42
  11. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +43 -43
  12. package/plugins/huaweicloud-core/.mcp.json +13 -13
  13. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  14. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +88 -88
  15. package/plugins/huaweicloud-core/safety/policy.json +85 -85
  16. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +144 -144
  17. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  18. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  19. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
  20. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +73 -73
  21. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  22. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  23. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
  24. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
  25. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
  26. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +131 -131
  27. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +96 -96
  28. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  29. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +28 -28
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  31. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -132
  32. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
  33. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  36. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  37. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
  38. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  39. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  40. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +118 -118
  41. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
  42. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  43. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +181 -181
  44. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  45. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +78 -78
  46. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
  47. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
  48. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  49. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  50. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +47 -47
  51. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  52. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +127 -127
  53. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  54. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +93 -93
  55. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  56. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
  57. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
  58. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +46 -46
  59. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  60. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  61. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  62. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
  63. package/plugins/huaweicloud-core/src/mcp-server.mjs +116 -93
  64. package/plugins/huaweicloud-core/src/safety-policy.mjs +289 -289
  65. package/plugins/huaweicloud-core/src/setup-cli.mjs +874 -869
  66. package/plugins/huaweicloud-core/src/tools.mjs +677 -677
@@ -1,96 +1,96 @@
1
- # Create ECS Instance SOP
2
-
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
-
5
- ## 1. Discover flavors
6
- hcloud ECS ListFlavors --cli-region=<region> --cli-output=json
7
-
8
- ## 2. Find availability zones
9
- hcloud ECS NovaListAvailabilityZones --cli-region=<region>
10
-
11
- ## 3. Find image
12
-
13
- ```bash
14
- # Broad search — specific names may return empty in some regions
15
- hcloud IMS ListImages --cli-region=<region> --__imagetype=gold --__isregistered=true --limit=20
16
- ```
17
-
18
- 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).
19
-
20
- Common images (verify live per region):
21
- | Image | Region | ID |
22
- |-------|--------|----|
23
- | HCE 2.0 Standard | cn-north-4 | 7d940784-ac0a-425f-b3fa-8478f1a1df70 |
24
- | Ubuntu 22.04 | Query live | Query live |
25
- | CentOS 8.2 | Query live | Query live |
26
-
27
- ## 4. Verify or create VPC/subnet
28
- hcloud VPC ListVpcs --cli-region=<region>
29
- hcloud VPC ListSubnets --vpc_id=<vpc-id> --cli-region=<region>
30
- If no VPC/subnet exists: load `huawei-vpc` skill → create VPC → create subnet (with DNS) → create security group → return here.
31
-
32
- ## 5. Create keypair (recommended over adminPass)
33
- hcloud ECS NovaCreateKeypair --keypair_name=<name>
34
- Save the returned private key to a local file. The public key is auto-injected.
35
-
36
- Password alternative:
37
- - adminPass: 8-26 chars, must have uppercase + lowercase + digit + special char
38
- - Passwords appear ONCE in creation output and are not retrievable
39
- - Passwords are logged in shell history — this is a security risk
40
-
41
- ## 6. Create instance
42
- 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
43
-
44
- ### Bootstrap with user_data (cloud-init)
45
-
46
- Use `--server.user_data` to run a cloud-init script at first boot. The value must be **base64-encoded**:
47
-
48
- ```bash
49
- # Encode the script
50
- user_data=$(cat << 'SCRIPT' | base64
51
- #!/bin/bash
52
- # Your bootstrap commands here.
53
- # Output logs: /var/log/cloud-init-output.log
54
- SCRIPT
55
- )
56
-
57
- hcloud ECS CreateServers ... --server.user_data=$user_data
58
- ```
59
-
60
- > **Security**: Never embed secrets (passwords, AK/SK, tokens) in user_data. It is stored unencrypted and readable from within the instance via IMDS. Fetch secrets at boot from DEW/CSMS instead.
61
-
62
- > **Debugging**: If the script didn't run, check `/var/log/cloud-init-output.log` on the instance.
63
-
64
- ## 7. EIP (optional)
65
- hcloud EIP CreatePublicip --publicip.type=<type> --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
66
-
67
- # Get the ECS network port ID
68
- hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
69
- # → addresses.<vpc-id>[].OS-EXT-IPS:port_id
70
-
71
- # Bind EIP via port
72
- hcloud EIP AssociatePublicips --publicip_id=<eip-id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
73
-
74
- ## 8. Verify
75
- hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
76
- Expected: status=ACTIVE
77
-
78
- ### Verify HTTP accessibility (if EIP bound)
79
-
80
- ```bash
81
- # Get the EIP address from instance details
82
- hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
83
- # → addresses.<vpc-id>[].OS-EXT-IPS:addr
84
-
85
- curl http://<eip-address>
86
- # Expected: HTTP 200 (if port 80 open and web server installed)
87
-
88
- ## 9. Delete instance (with cleanup)
89
- hcloud ECS DeleteServers --servers.1.id=<instance-id> --delete_publicip=true --delete_volume=true
90
- Warning: --delete_publicip and --delete_volume default to false. Set to true to avoid orphaned charges.
91
-
92
- ## Constraints
93
- - Name: 1-64 chars, letters/digits/hyphens
94
- - Flavor: must be available in target region — always ListFlavors first
95
- - Root volume: SSD 40GB min
96
- - Keypair is safer than adminPass (passwords leak into shell history)
1
+ # Create ECS Instance SOP
2
+
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
+
5
+ ## 1. Discover flavors
6
+ hcloud ECS ListFlavors --cli-region=<region> --cli-output=json
7
+
8
+ ## 2. Find availability zones
9
+ hcloud ECS NovaListAvailabilityZones --cli-region=<region>
10
+
11
+ ## 3. Find image
12
+
13
+ ```bash
14
+ # Broad search — specific names may return empty in some regions
15
+ hcloud IMS ListImages --cli-region=<region> --__imagetype=gold --__isregistered=true --limit=20
16
+ ```
17
+
18
+ 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).
19
+
20
+ Common images (verify live per region):
21
+ | Image | Region | ID |
22
+ |-------|--------|----|
23
+ | HCE 2.0 Standard | cn-north-4 | 7d940784-ac0a-425f-b3fa-8478f1a1df70 |
24
+ | Ubuntu 22.04 | Query live | Query live |
25
+ | CentOS 8.2 | Query live | Query live |
26
+
27
+ ## 4. Verify or create VPC/subnet
28
+ hcloud VPC ListVpcs --cli-region=<region>
29
+ hcloud VPC ListSubnets --vpc_id=<vpc-id> --cli-region=<region>
30
+ If no VPC/subnet exists: load `huawei-vpc` skill → create VPC → create subnet (with DNS) → create security group → return here.
31
+
32
+ ## 5. Create keypair (recommended over adminPass)
33
+ hcloud ECS NovaCreateKeypair --keypair_name=<name>
34
+ Save the returned private key to a local file. The public key is auto-injected.
35
+
36
+ Password alternative:
37
+ - adminPass: 8-26 chars, must have uppercase + lowercase + digit + special char
38
+ - Passwords appear ONCE in creation output and are not retrievable
39
+ - Passwords are logged in shell history — this is a security risk
40
+
41
+ ## 6. Create instance
42
+ 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
43
+
44
+ ### Bootstrap with user_data (cloud-init)
45
+
46
+ Use `--server.user_data` to run a cloud-init script at first boot. The value must be **base64-encoded**:
47
+
48
+ ```bash
49
+ # Encode the script
50
+ user_data=$(cat << 'SCRIPT' | base64
51
+ #!/bin/bash
52
+ # Your bootstrap commands here.
53
+ # Output logs: /var/log/cloud-init-output.log
54
+ SCRIPT
55
+ )
56
+
57
+ hcloud ECS CreateServers ... --server.user_data=$user_data
58
+ ```
59
+
60
+ > **Security**: Never embed secrets (passwords, AK/SK, tokens) in user_data. It is stored unencrypted and readable from within the instance via IMDS. Fetch secrets at boot from DEW/CSMS instead.
61
+
62
+ > **Debugging**: If the script didn't run, check `/var/log/cloud-init-output.log` on the instance.
63
+
64
+ ## 7. EIP (optional)
65
+ hcloud EIP CreatePublicip --publicip.type=<type> --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
66
+
67
+ # Get the ECS network port ID
68
+ hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
69
+ # → addresses.<vpc-id>[].OS-EXT-IPS:port_id
70
+
71
+ # Bind EIP via port
72
+ hcloud EIP AssociatePublicips --publicip_id=<eip-id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
73
+
74
+ ## 8. Verify
75
+ hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
76
+ Expected: status=ACTIVE
77
+
78
+ ### Verify HTTP accessibility (if EIP bound)
79
+
80
+ ```bash
81
+ # Get the EIP address from instance details
82
+ hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
83
+ # → addresses.<vpc-id>[].OS-EXT-IPS:addr
84
+
85
+ curl http://<eip-address>
86
+ # Expected: HTTP 200 (if port 80 open and web server installed)
87
+
88
+ ## 9. Delete instance (with cleanup)
89
+ hcloud ECS DeleteServers --servers.1.id=<instance-id> --delete_publicip=true --delete_volume=true
90
+ Warning: --delete_publicip and --delete_volume default to false. Set to true to avoid orphaned charges.
91
+
92
+ ## Constraints
93
+ - Name: 1-64 chars, letters/digits/hyphens
94
+ - Flavor: must be available in target region — always ListFlavors first
95
+ - Root volume: SSD 40GB min
96
+ - Keypair is safer than adminPass (passwords leak into shell history)
@@ -1,31 +1,31 @@
1
- # EVS Cloud Disk
2
-
3
- ## Create Volume
4
-
5
- ```bash
6
- hcloud EVS CreateVolume --help
7
- # Required: --volume.availability_zone, --volume.size, --volume.volume_type
8
- ```
9
-
10
- ```bash
11
- hcloud EVS CreateVolume \
12
- --volume.availability_zone=<az> \
13
- --volume.size=<size> \
14
- --volume.volume_type=<type> \
15
- --volume.name=<name>
16
- ```
17
-
18
- ## Attach to ECS
19
-
20
- ```bash
21
- hcloud EVS AttachVolume --volume_id=<vol-id> --server_id=<ecs-id>
22
- ```
23
-
24
- ## List / Delete
25
-
26
- ```bash
27
- hcloud EVS ListVolumes
28
- hcloud EVS DeleteVolume --volume_id=<id>
29
- ```
30
-
31
- > Deleting an ECS instance does NOT automatically delete attached EVS volumes unless `--delete_volume=true` is set during instance deletion.
1
+ # EVS Cloud Disk
2
+
3
+ ## Create Volume
4
+
5
+ ```bash
6
+ hcloud EVS CreateVolume --help
7
+ # Required: --volume.availability_zone, --volume.size, --volume.volume_type
8
+ ```
9
+
10
+ ```bash
11
+ hcloud EVS CreateVolume \
12
+ --volume.availability_zone=<az> \
13
+ --volume.size=<size> \
14
+ --volume.volume_type=<type> \
15
+ --volume.name=<name>
16
+ ```
17
+
18
+ ## Attach to ECS
19
+
20
+ ```bash
21
+ hcloud EVS AttachVolume --volume_id=<vol-id> --server_id=<ecs-id>
22
+ ```
23
+
24
+ ## List / Delete
25
+
26
+ ```bash
27
+ hcloud EVS ListVolumes
28
+ hcloud EVS DeleteVolume --volume_id=<id>
29
+ ```
30
+
31
+ > Deleting an ECS instance does NOT automatically delete attached EVS volumes unless `--delete_volume=true` is set during instance deletion.
@@ -1,28 +1,28 @@
1
- # ECS Flavor Selection
2
-
3
- **Always discover flavors dynamically before recommending a specific flavor name.** Flavor availability varies by region and changes over time.
4
-
5
- ## Step 1: List available flavors
6
- hcloud ECS ListFlavors --cli-region=<region> --cli-output=json
7
-
8
- ## Step 2: Filter by scenario
9
-
10
- | Scenario | Look for | Preference |
11
- |----------|----------|------------|
12
- | Web app / microservices | General-purpose families (ac, s, sn) | 2-4 vCPU, 4-8 GB RAM |
13
- | Database / big data | Memory-optimized families (m, r) | 4-8 vCPU, 16-64 GB RAM |
14
- | AI inference / training | GPU families (g, p) | 8+ vCPU, 64+ GB RAM |
15
- | HPC / high throughput | High-IO families (h, ir, i) | 8+ vCPU, local SSD |
16
-
17
- ## Step 3: Match spec from ListFlavors output
18
-
19
- Common naming pattern: `<family><gen>.<type>x<ratio>`
20
- - `ac6.2xlarge.2` = ac6 family, 2xlarge (8 vCPU), ratio 2 (vCPU:RAM = 1:2 → 16 GB)
21
-
22
- ## Do Not Hardcode
23
-
24
- Flavor family names are region-dependent. Example discrepancies seen in testing:
25
- - cn-south-1: ac6/ac7/kc/r-c7e (s6/m6/g6 NOT available)
26
- - Other regions may have s6/m6/g6 families
27
-
28
- Always run ListFlavors and pick from actual results.
1
+ # ECS Flavor Selection
2
+
3
+ **Always discover flavors dynamically before recommending a specific flavor name.** Flavor availability varies by region and changes over time.
4
+
5
+ ## Step 1: List available flavors
6
+ hcloud ECS ListFlavors --cli-region=<region> --cli-output=json
7
+
8
+ ## Step 2: Filter by scenario
9
+
10
+ | Scenario | Look for | Preference |
11
+ |----------|----------|------------|
12
+ | Web app / microservices | General-purpose families (ac, s, sn) | 2-4 vCPU, 4-8 GB RAM |
13
+ | Database / big data | Memory-optimized families (m, r) | 4-8 vCPU, 16-64 GB RAM |
14
+ | AI inference / training | GPU families (g, p) | 8+ vCPU, 64+ GB RAM |
15
+ | HPC / high throughput | High-IO families (h, ir, i) | 8+ vCPU, local SSD |
16
+
17
+ ## Step 3: Match spec from ListFlavors output
18
+
19
+ Common naming pattern: `<family><gen>.<type>x<ratio>`
20
+ - `ac6.2xlarge.2` = ac6 family, 2xlarge (8 vCPU), ratio 2 (vCPU:RAM = 1:2 → 16 GB)
21
+
22
+ ## Do Not Hardcode
23
+
24
+ Flavor family names are region-dependent. Example discrepancies seen in testing:
25
+ - cn-south-1: ac6/ac7/kc/r-c7e (s6/m6/g6 NOT available)
26
+ - Other regions may have s6/m6/g6 families
27
+
28
+ Always run ListFlavors and pick from actual results.
@@ -1,52 +1,52 @@
1
- # ECS Troubleshooting
2
-
3
- 基于真实测试暴露的常见错误和诊断步骤。
4
-
5
- ## 错误码映射
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 过期或无效 | `hcloud configure init` 重新配置 |
17
-
18
- ## 创建失败诊断流程
19
-
20
- 1. 运行 `hcloud ECS ListFlavors` — 确认规格在目标区域可用
21
- 2. 运行 `hcloud IMS ListImages --__imagetype=gold --limit=20` — 确认可用的公共镜像
22
- 3. 交叉检查:flavor `os_extra_specs` 中的虚拟化类型 vs image 的 `__support_*` 属性
23
- 4. 运行 `hcloud VPC ListVpcs` / `ListSubnets` — 确认 VPC 和子网存在
24
- 5. 运行 `hcloud ECS NovaListAvailabilityZones` — 确认 AZ 可用
25
- 6. 创建后:`hcloud ECS ListServersDetails --server_id=<id>` 检查状态
26
- 7. 状态 `BUILD` → 等待。`ERROR` → 查看 job_id 详情
27
-
28
- ## 镜像查询正确姿势
29
-
30
- ```bash
31
- # 正确:双下划线前缀
32
- hcloud IMS ListImages --cli-region=<r> --__imagetype=gold --__isregistered=true --limit=20
33
-
34
- # 按需过滤(如果参数支持)
35
- # --virtual_env_type=FusionCompute 排除 BareMetal
36
- # 不支持的参数不要传,用 client-side 过滤
37
- ```
38
-
39
- ## 密钥对 vs 密码
40
-
41
- | 方式 | 安全 | 建议 |
42
- |------|------|------|
43
- | `--server.key_name=<name>` | ✅ 高 | **推荐**。先 `hcloud DEW CreateKeypair` 创建密钥对 |
44
- | `--server.adminPass=<pw>` | ❌ 低 | 密码明文进入 shell 历史。仅测试用 |
45
-
46
- 密码要求:8-26 字符,含大写 + 小写 + 数字 + 特殊字符。
47
-
48
- ## 删除注意事项
49
-
50
- - `--delete_publicip` 默认 false — EIP 不随实例删除,继续计费
51
- - `--delete_volume` 默认 false — 系统盘不随实例删除
52
- - 数据盘默认随实例删除(与系统盘行为相反)
1
+ # ECS Troubleshooting
2
+
3
+ 基于真实测试暴露的常见错误和诊断步骤。
4
+
5
+ ## 错误码映射
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 过期或无效 | `hcloud configure init` 重新配置 |
17
+
18
+ ## 创建失败诊断流程
19
+
20
+ 1. 运行 `hcloud ECS ListFlavors` — 确认规格在目标区域可用
21
+ 2. 运行 `hcloud IMS ListImages --__imagetype=gold --limit=20` — 确认可用的公共镜像
22
+ 3. 交叉检查:flavor `os_extra_specs` 中的虚拟化类型 vs image 的 `__support_*` 属性
23
+ 4. 运行 `hcloud VPC ListVpcs` / `ListSubnets` — 确认 VPC 和子网存在
24
+ 5. 运行 `hcloud ECS NovaListAvailabilityZones` — 确认 AZ 可用
25
+ 6. 创建后:`hcloud ECS ListServersDetails --server_id=<id>` 检查状态
26
+ 7. 状态 `BUILD` → 等待。`ERROR` → 查看 job_id 详情
27
+
28
+ ## 镜像查询正确姿势
29
+
30
+ ```bash
31
+ # 正确:双下划线前缀
32
+ hcloud IMS ListImages --cli-region=<r> --__imagetype=gold --__isregistered=true --limit=20
33
+
34
+ # 按需过滤(如果参数支持)
35
+ # --virtual_env_type=FusionCompute 排除 BareMetal
36
+ # 不支持的参数不要传,用 client-side 过滤
37
+ ```
38
+
39
+ ## 密钥对 vs 密码
40
+
41
+ | 方式 | 安全 | 建议 |
42
+ |------|------|------|
43
+ | `--server.key_name=<name>` | ✅ 高 | **推荐**。先 `hcloud DEW CreateKeypair` 创建密钥对 |
44
+ | `--server.adminPass=<pw>` | ❌ 低 | 密码明文进入 shell 历史。仅测试用 |
45
+
46
+ 密码要求:8-26 字符,含大写 + 小写 + 数字 + 特殊字符。
47
+
48
+ ## 删除注意事项
49
+
50
+ - `--delete_publicip` 默认 false — EIP 不随实例删除,继续计费
51
+ - `--delete_volume` 默认 false — 系统盘不随实例删除
52
+ - 数据盘默认随实例删除(与系统盘行为相反)