Full lifecycle management for ModelArts dedicated resource pools and node pools via hcloud CLI — 53 operations across 10 functional domains.
Overview
This skill enables users to manage Huawei Cloud ModelArts dedicated resource pools (专属资源池) and node pools through the hcloud CLI. It covers the complete lifecycle including resource pool CRUD, node management, node pool management, network resources, tag management, plugin management, workloads, scheduled events, OS configuration, and resource flavor queries. BSS pricing inquiry is included for chargeable operations.
Architecture
text
User Request → Agent → hcloud ModelArts <Operation> --cli-region={region} [--params] → Huawei Cloud ModelArts API
Applicable Scenarios
Resource Pool Management: Create, list, show, update, delete resource pools; monitor, statistics, node config, order management
⚠️ CRITICAL: This section defines the agent's security boundary. Follow it strictly.
🔒 Security Rules (MANDATORY)
🚫 NEVER read, echo, or print AK/SK values (e.g., cat ~/.hcloud/config.json, echo $HW_ACCESS_KEY is FORBIDDEN)
🚫 NEVER read or cat credential files such as ~/.hcloud/config.json or any file that may contain secrets
🚫 NEVER ask the user to input AK/SK directly in the conversation or command line
🚫 NEVER execute hcloud configure set --cli-access-key=... --cli-secret-key=... — credential configuration is the user's responsibility, done outside the agent session
🚫 NEVER pass --cli-access-key/--cli-secret-key on every API call — they will be exposed in process listings (ps aux) for the entire request duration
✅ ALWAYS use hcloud configure list to check credential status (presence check only, not values)
✅ If no valid profile exists, STOP and instruct the user to configure credentials outside this session
✅ Recommend using IAM user with minimal permissions instead of main account
✅ Agent Credential Check (the ONLY acceptable check)
bash
# Step 1: Check credential status — presence only, not values
hcloud configure list
✅ Expected: Shows a valid profile with mode: AKSK
❌ If empty/invalid → Guide the user with the 3-step process below:
Step-by-step guidance (copy-paste for the user):
"No valid credentials found. Please follow these 3 steps in your terminal:"
① Get your AK/SK
Log in to Huawei Cloud Console → IAM → Access Keys. If you don't have one, click "Create Access Key" and save it securely.
② Run this in your terminal (one-time setup):
bash
hcloud configure set --cli-access-key=<YOUR_AK> --cli-secret-key=<YOUR_SK>
(Replace <YOUR_AK> and <YOUR_SK> with the values from step ①)
③ Come back and tell me "configured", I'll verify it works.
Note: The configure set command stores your credentials in ~/.hcloud/config.json. After that, all hcloud commands use them automatically — no need to pass AK/SK again.
Agent: DO NOT execute any configure set command yourself.
🔧 User's Responsibility (for documentation, NOT agent execution)
The user configures credentials outside the agent session (in their own terminal):
bash
# One-time setup — run this in your terminal, NOT in the agent chat
HISTCONTROL=ignorespace
hcloud configure set --cli-access-key=<YOUR_AK> --cli-secret-key=<YOUR_SK>
⚠️ Note: hcloud CLI does NOT read HW_ACCESS_KEY/HW_SECRET_KEY environment variables (those are for Python SDK only). hcloud configure set is the only supported credential configuration method.
Workflow
Step 1: Identify the Operation
Determine which resource pool operation the user needs based on their request:
Check the Pre-Flight Checklist at the bottom of that file — Verify all conditions are met
Apply documented workarounds — Especially for the following high-risk operations:
Operation
Critical Issue
Action Required
PatchPool, PatchNetwork, PatchNodePool
Content-Type must be application/merge-patch+json
Use --cli-jsonInput with header section
BatchUpdatePoolNodes
--action values are not true/false
Use --cli-jsonInput with string action
CreatePool
Network name must include project ID suffix
Query ListNetworks for exact name
CreateNodePool
count ≥ 1, maxCount ≤ count
Verify constraints before execution
ShowNetworkAvailableIp
network_id from status.subnets[0].networkId
Query ShowNetwork first
ListEvents
--resource must be pools (plural)
Use plural form
BatchResetPoolNodes
strategy not supported for VM pools
Known limitation, inform user
BatchResizePoolNodes
Only supports hyperinstance nodes
Known limitation, inform user
DeleteNetwork
Fails if network in use by pool
Delete pool first
Skipping this step will cause preventable failures. Every issue in the table was discovered through real API testing.
Step 3: Handle Write Operations
For all write operations (Create/Update/Delete/Patch/Batch/Accept), prompt the user for confirmation before execution. For chargeable operations (CreatePool, CreateNodePool, PatchNodePool, BatchResizePoolNodes, CreateOrderId), inquire BSS pricing first to inform the user of costs. See references/pricing-inquiry.md for the pricing inquiry workflow.
Note: --project_id is auto-resolved from authentication credentials if omitted. Include it explicitly only when targeting a specific project.
Complex parameters: For complex nested parameters (e.g., metadata, spec), use --cli-jsonInput=/path/to/file.json. The JSON file must wrap body in {"body": {...}} envelope.
Core Commands
All 53 CLI command examples across 10 functional domains are documented in a separate reference file.