azure-compute
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAzure Compute Skill
Azure Compute Skill
Recommend Azure VM sizes, VM Scale Sets (VMSS), and configurations by analyzing workload type, performance requirements, scaling needs, and budget. No Azure subscription required — all data comes from public Microsoft documentation and the unauthenticated Retail Prices API.
通过分析工作负载类型、性能要求、缩放需求和预算,推荐Azure VM大小、VM Scale Sets (VMSS)及配置。无需Azure订阅——所有数据均来自Microsoft公开文档和无需认证的Retail Prices API。
When to Use This Skill
何时使用此技能
- User asks which Azure VM or VMSS to choose for a workload
- User needs VM size recommendations for web, database, ML, batch, HPC, or other workloads
- User wants to compare VM families, sizes, or pricing tiers
- User asks about trade-offs between VM options (cost vs performance)
- User needs a cost estimate for Azure VMs without an Azure account
- User asks whether to use a single VM or a scale set
- User needs autoscaling, high availability, or load-balanced VM recommendations
- User asks about VMSS orchestration modes (Flexible vs Uniform)
- 用户询问针对某一工作负载应选择哪种Azure VM或VMSS
- 用户需要针对Web、数据库、ML、批处理、HPC或其他工作负载的VM大小推荐
- 用户希望对比VM系列、大小或定价层级
- 用户询问VM选项之间的权衡(成本vs性能)
- 用户无需Azure账户即可获取Azure VM的成本估算
- 用户询问应使用单个VM还是规模集
- 用户需要自动缩放、高可用性或负载均衡VM的推荐
- 用户询问VMSS编排模式(Flexible vs Uniform)
Workflow
工作流程
Use reference files for initial filtering
CRITICAL: then always verify with live documentation from learn.microsoft.com before making final recommendations. Iffails, use reference files as fallback but warn the user the information may be stale.web_fetch
使用参考文件进行初始筛选
重要提示: 在给出最终推荐前,务必通过learn.microsoft.com的实时文档进行验证。如果失败,可使用参考文件作为备选,但需提醒用户信息可能已过期。web_fetch
Step 1: Gather Requirements
步骤1:收集需求
Ask the user for (infer when possible):
| Requirement | Examples |
|---|---|
| Workload type | Web server, relational DB, ML training, batch processing, dev/test |
| vCPU / RAM needs | "4 cores, 16 GB RAM" or "lightweight" / "heavy" |
| GPU needed? | Yes → GPU families; No → general/compute/memory |
| Storage needs | High IOPS, large temp disk, premium SSD |
| Budget priority | Cost-sensitive, performance-first, balanced |
| OS | Linux or Windows (affects pricing) |
| Region | Affects availability and price |
| Instance count | Single instance, fixed count, or variable/dynamic |
| Scaling needs | None, manual scaling, autoscale based on metrics or schedule |
| Availability needs | Best-effort, fault-domain isolation, cross-zone HA |
| Load balancing | Not needed, Azure Load Balancer (L4), Application Gateway (L7) |
向用户询问(可在可能的情况下推断):
| 需求项 | 示例 |
|---|---|
| 工作负载类型 | Web服务器、关系型数据库、ML训练、批处理、开发/测试环境 |
| vCPU / 内存需求 | "4核,16 GB内存" 或 "轻量级" / "重型" |
| 是否需要GPU? | 是 → GPU系列;否 → 通用/计算/内存优化型 |
| 存储需求 | 高IOPS、大临时磁盘、高级SSD |
| 预算优先级 | 成本敏感型、性能优先型、平衡型 |
| 操作系统 | Linux或Windows(会影响定价) |
| 区域 | 影响可用性和价格 |
| 实例数量 | 单实例、固定数量或可变/动态数量 |
| 缩放需求 | 无、手动缩放、基于指标或计划的自动缩放 |
| 可用性需求 | 尽力而为、故障域隔离、跨区域高可用 |
| 负载均衡 | 不需要、Azure Load Balancer(L4)、Application Gateway(L7) |
Step 2: Determine VM vs VMSS
步骤2:确定使用VM还是VMSS
Workflow:
- Review VMSS Guide to understand when VMSS vs single VM is appropriate
- Use the gathered requirements to decide which approach fits best
- REQUIRED: If recommending VMSS, fetch current documentation to verify capabilities:
bash
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-autoscale-overview - If fails, proceed with reference file guidance but include this warning:
web_fetchUnable to verify against latest Azure documentation. Recommendation based on reference material that may not reflect recent updates.
text
Needs autoscaling?
├─ Yes → VMSS
├─ No
│ ├─ Multiple identical instances needed?
│ │ ├─ Yes → VMSS
│ │ └─ No
│ │ ├─ High availability across fault domains / zones?
│ │ │ ├─ Yes, many instances → VMSS
│ │ │ └─ Yes, 1-2 instances → VM + Availability Zone
│ │ └─ Single instance sufficient? → VM| Signal | Recommendation | Why |
|---|---|---|
| Autoscale on CPU, memory, or schedule | VMSS | Built-in autoscale; no custom automation needed |
| Stateless web/API tier behind a load balancer | VMSS | Homogeneous fleet with automatic distribution |
| Batch / parallel processing across many nodes | VMSS | Scale out on demand, scale to zero when idle |
| Mixed VM sizes in one group | VMSS (Flexible) | Flexible orchestration supports mixed SKUs |
| Single long-lived server (jumpbox, AD DC) | VM | No scaling benefit; simpler management |
| Unique per-instance config required | VM | Scale sets assume homogeneous configuration |
| Stateful workload, tightly-coupled cluster | VM (or VMSS case-by-case) | Evaluate carefully; VMSS Flexible can work for some stateful patterns |
Warning: If the user is unsure, default to single VM for simplicity. Recommend VMSS only when scaling, HA, or fleet management is clearly needed.
工作流程:
- 查看VMSS指南,了解何时适合使用VMSS而非单个VM
- 根据收集到的需求决定哪种方案更合适
- 必填:如果推荐VMSS,获取当前文档以验证功能:
bash
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-autoscale-overview - 如果失败,继续使用参考文件的指导,但需包含以下警告:
web_fetch无法通过最新Azure文档进行验证。推荐内容基于参考材料,可能无法反映最新更新。
text
需要自动缩放?
├─ 是 → VMSS
├─ 否
│ ├─ 需要多个相同实例?
│ │ ├─ 是 → VMSS
│ │ └─ 否
│ │ ├─ 需要跨故障域/区域的高可用性?
│ │ │ ├─ 是,多个实例 → VMSS
│ │ │ └─ 是,1-2个实例 → VM + 可用性区域
│ │ └─ 单实例足够? → VM| 信号 | 推荐方案 | 原因 |
|---|---|---|
| 基于CPU、内存或计划的自动缩放 | VMSS | 内置自动缩放功能;无需自定义自动化 |
| 负载均衡后的无状态Web/API层 | VMSS | 同构实例集群,支持自动流量分发 |
| 跨多个节点的批处理/并行处理 | VMSS | 按需横向扩展,空闲时可缩容至零 |
| 同一组中混合不同VM大小 | VMSS (Flexible) | 灵活编排模式支持混合SKU |
| 单个长期运行的服务器(跳转机、AD域控制器) | VM | 无缩放收益;管理更简单 |
| 需要每个实例的独特配置 | VM | 规模集假设实例配置同构 |
| 有状态工作负载、紧耦合集群 | VM(或视情况使用VMSS) | 需仔细评估;VMSS Flexible模式可适配部分有状态场景 |
注意: 如果用户不确定,默认推荐单个VM以简化操作。仅当明确需要缩放、高可用性或集群管理时,才推荐VMSS。
Step 3: Select VM Family
步骤3:选择VM系列
Workflow:
-
Review VM Family Guide to identify 2-3 candidate VM families that match the workload requirements
-
REQUIRED: verify specifications for your chosen candidates by fetching current documentation:bash
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/<family-category>/<series-name>Examples:- B-series:
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/b-family - D-series:
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/ddsv5-series - GPU:
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/gpu-accelerated/nc-family
- B-series:
-
If considering Spot VMs, also fetch:bash
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/use-spot -
Iffails, proceed with reference file guidance but include this warning:
web_fetchUnable to verify against latest Azure documentation. Recommendation based on reference material that may not reflect recent updates or limitations (e.g., Spot VM compatibility).
This step applies to both single VMs and VMSS since scale sets use the same VM SKUs.
工作流程:
-
查看VM系列指南,确定2-3个符合工作负载需求的候选VM系列
-
必填:验证规格,通过获取当前文档确认所选候选的参数:bash
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/<family-category>/<series-name>示例:- B系列:
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/b-family - D系列:
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/ddsv5-series - GPU:
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/gpu-accelerated/nc-family
- B系列:
-
如果考虑Spot VMs,还需获取:bash
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/use-spot -
如果失败,继续使用参考文件的指导,但需包含以下警告:
web_fetch无法通过最新Azure文档进行验证。推荐内容基于参考材料,可能无法反映最新更新或限制(如Spot VM兼容性)。
此步骤适用于单个VM和VMSS,因为规模集使用相同的VM SKU。
Step 4: Look Up Pricing
步骤4:查询定价
Query the Azure Retail Prices API — Retail Prices API Guide
Tip: VMSS has no extra charge — pricing is per-VM instance. Use the same VM pricing from the API and multiply by the expected instance count to estimate VMSS cost. For autoscaling workloads, estimate cost at both the minimum and maximum instance count.
调用Azure Retail Prices API —— 零售价格API指南
提示: VMSS无额外费用——定价按VM实例计算。使用API中的相同VM定价,乘以预期实例数量即可估算VMSS成本。对于自动缩放工作负载,需估算最小和最大实例数量下的成本。
Step 5: Present Recommendations
步骤5:呈现推荐方案
Provide 2–3 options with trade-offs:
| Column | Purpose |
|---|---|
| Hosting Model | VM or VMSS (with orchestration mode if VMSS) |
| VM Size | ARM SKU name (e.g., |
| vCPUs / RAM | Core specs |
| Instance Count | 1 for VM; min–max range for VMSS with autoscale |
| Estimated $/hr | Per-instance pay-as-you-go from API |
| Why | Fit for the workload |
| Trade-off | What the user gives up |
Tip: Always explain why a family fits and what the user trades off (cost vs cores, burstable vs dedicated, single VM simplicity vs VMSS scalability, etc.).
For VMSS recommendations, also mention:
- Recommended orchestration mode (Flexible for most new workloads)
- Autoscale strategy (metric-based, schedule-based, or both)
- Load balancer type (Azure Load Balancer for L4, Application Gateway for L7/TLS)
提供2-3个选项并说明权衡:
| 列名 | 用途 |
|---|---|
| 托管模型 | VM或VMSS(若为VMSS需注明编排模式) |
| VM大小 | ARM SKU名称(如 |
| vCPUs / 内存 | 核心规格 |
| 实例数量 | VM为1;带自动缩放的VMSS为最小-最大范围 |
| 预估每小时费用 | 来自API的按实例按需付费价格 |
| 推荐理由 | 适配工作负载的原因 |
| 权衡点 | 用户需要做出的取舍 |
提示: 务必解释为什么该系列适配,以及用户需要权衡的点(成本vs核心数、可突增vs专用、单个VM的简洁性vs VMSS的可扩展性等)。
对于VMSS推荐,还需提及:
- 推荐的编排模式(大多数新工作负载使用Flexible)
- 自动缩放策略(基于指标、基于计划或两者结合)
- 负载均衡器类型(L4使用Azure Load Balancer,L7/TLS使用Application Gateway)
Step 6: Offer Next Steps
步骤6:提供后续步骤
- Compare reservation / savings plan pricing (query API with )
priceType eq 'Reservation' - Suggest Azure Pricing Calculator for full estimates
- For VMSS: suggest reviewing autoscale best practices and VMSS networking
- 对比预留实例/节约计划定价(调用API时使用)
priceType eq 'Reservation' - 建议使用Azure定价计算器进行全面估算
- 对于VMSS:建议查看自动缩放最佳实践和VMSS网络配置
Error Handling
错误处理
| Scenario | Action |
|---|---|
| API returns empty results | Broaden filters — check |
| User unsure of workload type | Ask clarifying questions; default to General Purpose D-series |
| Region not specified | Use |
| Unclear if VM or VMSS needed | Ask about scaling and instance count; default to single VM if unsure |
| User asks VMSS pricing directly | Use same VM pricing API — VMSS has no extra charge; multiply by instance count |
| 场景 | 操作 |
|---|---|
| API返回空结果 | 放宽筛选条件——检查 |
| 用户不确定工作负载类型 | 询问澄清问题;默认推荐通用型D系列 |
| 未指定区域 | 使用 |
| 不确定是否需要VM或VMSS | 询问缩放需求和实例数量;若不确定则默认推荐单个VM |
| 用户直接询问VMSS定价 | 使用相同的VM定价API——VMSS无额外费用;乘以实例数量计算总价 |
References
参考资料
- VM Family Guide — Family-to-workload mapping and selection
- Retail Prices API Guide — Query patterns, filters, and examples
- VMSS Guide — When to use VMSS, orchestration modes, and autoscale patterns
- VM系列指南 —— 系列与工作负载的映射及选择
- 零售价格API指南 —— 查询模式、筛选条件及示例
- VMSS指南 —— 何时使用VMSS、编排模式及自动缩放模式