aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage
Claude Code and agent skill by aliyun/alibabacloud-aiops-skills
- community
Checking that the SKILL.md file is still in the repository.
Manage the full lifecycle of Alibaba Cloud PAI DSW (Data Science Workshop) instances — create, update, query, list, start, stop, and look up ECS specs. Triggers: PAI DSW, DSW instance, create instance, start instance, stop instance, update instance, query instance, instance list, ECS spec, CreateInstance, UpdateInstance, GetInstance, ListInstances, StartInstance, StopInstance, ListEcsSpecs
Install
npx vskill@latest install aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manageSKILL.md
The same SKILL.md was published earlier as aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage.
PAI DSW Instance Management
Manage the full lifecycle of Alibaba Cloud PAI DSW (Data Science Workshop) instances — from provisioning through configuration changes, status monitoring, and start/stop operations. Also supports querying available ECS compute specs.
Architecture: PAI Workspace + DSW Instance + ECS Spec + Image + VPC + Dataset
API Version: pai-dsw/2022-01-01
Installation
Pre-check: Aliyun CLI >= 3.3.3 requiredRunaliyun versionto verify >= 3.3.3. If not installed or version too low,runcurl -fsSL https://aliyuncli.alicdn.com/setup.sh | bashto update,or see `references/cli-installation-guide.md` for installation instructions.
Pre-check: Aliyun CLI plugin update required[MUST] runaliyun configure set --auto-plugin-install trueto enable automatic plugin installation.[MUST] runaliyun plugin updateto ensure that any existing plugins are always up-to-date.
[MUST] CLI User-Agent — Every aliyun CLI command invocation must include: --user-agent AlibabaCloud-Agent-Skills/alibabacloud-pai-dsw-manage
Authentication
Pre-check: Alibaba Cloud Credentials RequiredSecurity Rules:- NEVER read, echo, or print AK/SK values (e.g.,echo $ALIBABA_CLOUD_ACCESS_KEY_IDis FORBIDDEN)- NEVER ask the user to input AK/SK directly in the conversation or command line- NEVER usealiyun configure setwith literal credential values- ONLY usealiyun configure listto check credential status```bashaliyun configure list```Check the output for a valid profile (AK, STS, or OAuth identity).If no valid profile exists, STOP here.1. Obtain credentials from Alibaba Cloud Console2. Configure credentials outside of this session (viaaliyun configurein a terminal or environment variables in a shell profile)3. Return and retry afteraliyun configure listshows a valid profile
RAM Permissions
See `references/ram-policies.md` for the complete permission list and minimum-privilege policy.
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:1. Readreferences/ram-policies.mdto get the full list of permissions required by this skill2. Use theram-permission-diagnoseskill to guide the user through requesting the necessary permissions3. Pause and wait until the user confirms that the required permissions have been granted
Parameter Confirmation
IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks, passwords, domain names, resource specifications, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
| Parameter | Required | Description | Default | ||
|---|---|---|---|---|---|
WorkspaceId | Required | PAI workspace ID | None — user must provide | ||
InstanceName | Required | Instance name (letters, digits, underscores only; max 27 chars) | None — user must provide | ||
EcsSpec | Required (post-paid) | ECS compute spec, e.g., ecs.c6.large. Query via list-ecs-specs | None | ||
ImageId | Mutually exclusive with ImageUrl | Image ID from PAI console | None | ||
ImageUrl | Mutually exclusive with ImageId | Container image URL. See `references/common-images.md` for common official images | None | ||
RegionId | Required | Region, e.g., cn-hangzhou, cn-shanghai | None — user must confirm | ||
Accessibility | Optional | Visibility scope: PUBLIC (all workspace users) or PRIVATE | PRIVATE | ||
InstanceId | Required (update/get/start/stop) | Instance ID (dsw-xxxxx format) | None | ||
VpcId | Optional | VPC ID for private network access | None | ||
VSwitchId | Optional | VSwitch ID within the VPC | None | ||
SecurityGroupId | Optional | Security group ID | None | ||
AcceleratorType | Required (spec query) | Accelerator type: CPU or GPU | None — user must confirm | ||
Datasets | Optional | Dataset mounts in CLI list format: `DatasetId=<> MountPath=<> MountAccess=RO | RW` | None — user must confirm, no default | |
--read-timeout | Optional | CLI read timeout in seconds (for long-running operations) | 10 | ||
--connect-timeout | Optional | CLI connection timeout in seconds | 10 |
How to get WorkspaceId: If the user doesn't know their workspace ID, run:```bashaliyun aiworkspace list-workspaces --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-pai-dsw-manage```This returns all workspaces the user has access to. Select the appropriate one based onWorkspaceNameor ask the user to confirm.Reference: Create and Manage Workspaces
Core Workflow
Full command syntax and parameter details: `references/related-commands.md`.
1. Query Available ECS Specs
Run aliyun pai-dsw list-ecs-specs --accelerator-type <CPU|GPU> --region <region> to list available compute specs.
[MUST] Region confirmation: The--regionparameter is required. Spec availability varies by region — always confirm the region with the user before querying.
[MUST] Determine accelerator type correctly:- User mentions a spec name (e.g.,ecs.hfc6.10xlarge): Query BOTH CPU and GPU types, then matchInstanceTypein results. Use the returnedAcceleratorTypefield to confirm the classification.- User specifies image type: GPU image URL (contains-gpu-orcu) → query GPU specs; CPU image URL → query CPU specs.- User describes use case only: GPU for 大模型训练/深度学习, CPU for 数据分析/轻量任务. Always confirm with user if ambiguous.- [IMPORTANT] Do NOT guess from spec name prefix — the naming convention is unreliable. Always verify via API response.
[MUST] Choose accelerator type based on user requirements:- Default recommendation: GPU for 大模型训练/深度学习, CPU for 数据分析/轻量任务- Match image type (strong indicator): If user specifies a GPU image URL (contains-gpu-orcu), query GPU specs. If CPU image, query CPU specs.- Spec name requires verification: If user mentions a spec name, query both types and find the match in results- Always confirm with user before querying if the use case is ambiguous and no spec name is provided
Key response fields:
InstanceType: Spec name (e.g.,ecs.hfc6.10xlarge)AcceleratorType:CPUorGPU— the actual classification from APIIsAvailable: PRIMARY indicator —truemeans the spec is available for pay-as-you-go/subscriptionSpotStockStatus: SECONDARY indicator — only for spot instances:WithStock(available) orNoStock(unavailable)CPU/Memory/GPU/GPUType: Hardware detailsPrice: Hourly price in CNY
[MUST] Availability check logic:- For pay-as-you-go/subscription: CheckIsAvailable == true- For spot instances: CheckIsAvailable == trueANDSpotStockStatus == "WithStock"- DO NOT useSpotStockStatusalone to judge availability — many specs haveIsAvailable: truebutSpotStockStatus: "NoStock"- Example:ecs.hfc6.10xlargewithIsAvailable: true, SpotStockStatus: "NoStock"→ Available for pay-as-you-go
2. Create Instance (check-then-act)
[MUST] Idempotency guarantee: The CreateInstance API does not support ClientToken, so idempotency is ensured via a check-then-act pattern. Before creating, you must calllist-instances --instance-name <name>to check if the name already exists.
Step 2.1 — Check existence
Decision logic:
TotalCount == 0→ Name is available, proceed to Step 2.2 to createTotalCount >= 1→ [MUST] Verify exact name match:
- Iterate through the returned
Instancesarray - For each instance, compare its
InstanceNamefield with the target name character by character (case-sensitive, exact string match) - Exact match found (
instance.InstanceName === targetName) → Name already exists:
- Extract the
InstanceIdfrom the matching instance - Call
get-instance --instance-id <id>to get full details - Compare key parameters (
EcsSpec,ImageUrl,Accessibility, etc.) - Match → Return the existing
InstanceId, do not recreate - Mismatch → Ask user to choose a different name
- No exact match found (no instance has
InstanceName === targetName) → Name is available, proceed to Step 2.2 to create
[WARNING] Critical: Exact name match requiredThe--instance-namefilter may return partial matches. For example:- Query:--instance-name llm_train_001- Response may include:llm_train_001,llm_train_001_v2,llm_train_001_backupYou MUST verify exact match by checking:```for instance in response.Instances:if instance.InstanceName == targetName: # EXACT string equality# Name already exists - DO NOT create```Do NOT assume name is available just becauseTotalCount > 0but you "think" no exact match. IfTotalCount >= 1, carefully check each instance's InstanceName field.
Step 2.2 — Provision
Run aliyun pai-dsw create-instance with required args: --workspace-id, --instance-name, --ecs-spec, --region, and either --image-url or --image-id.
[MUST] Region confirmation: The--regionparameter is required and must be confirmed with the user. Do NOT use CLI default region without explicit user approval. Spec availability and pricing vary by region.
[MUST] Match EcsSpec with image type:- GPU image URL (contains-gpu-orcu) → Must select a GPU spec (e.g.,ecs.gn6v-c4g1.xlarge)- CPU image URL (contains-cpu-) → Must select a CPU spec (e.g.,ecs.c6.large)- The spec type MUST match the image type, otherwise the instance will fail to start- Use case (大模型训练/数据分析) is only a recommendation, image type is the definitive indicator
Dataset mounting (optional): If the user specifies a dataset to mount, use the--datasetsparameter in CLI list format:```bash--datasets DatasetId=<dataset-id> MountPath=<mount-path> MountAccess=RO```[MUST] Dataset parameters require explicit user confirmation — do NOT assume or auto-generate dataset configurations.Official images: `references/common-images.md`.Advanced usage (VPC, datasets): `references/related-commands.md`.
Response: {"InstanceId": "dsw-xxxxx", ...}
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/aiml/learn/alibabacloud-pai-dsw-manage/SKILL.md
Popularity
- Repository stars
- 219
- Repository forks
- 28
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Aug 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage)