Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

compute-spot-capacity-advice

БесплатноБез исполняемых скриптовНе проверен

Evaluates Google Compute Engine (GCE) Spot VM capacity obtainability, placement likelihood, and machine family or regional flexibility. Use when planning…

googleот google★ 25 380 звёзд на GitHub

Об этом скилле

Compute Engine Spot Capacity Advice

The compute-spot-capacity-advice skill provides telemetry and architectural guidance to assess the obtainability of Google Compute Engine (GCE) Spot VMs before submitting creation requests.

Spot VMs run on spare compute capacity and are subject to preemption. Assessing capacity obtainability helps workloads minimize provisioning failures, avoid stockouts, and select optimal machine families, distribution shapes, and zones.

[!NOTE] Spot Capacity Advice is served on the Compute Engine Beta API (compute.beta.AdviceService.Capacity, POST /compute/beta/projects/{project}/regions/{region}/advice/capacity) and requires no project allowlisting. Always invoke it via the gcloud beta release track (gcloud beta compute advice capacity) — never omit beta even if gcloud compute advice capacity appears in --help, as the v1 backend rejects SPOT. Flex-start Capacity Advice (--provisioning-model=FLEX_START) is currently in Private Preview; for public workloads without explicit allowlists, always use --provisioning-model=SPOT.

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.


Prerequisites & IAM Requirements

Before querying Spot capacity advice, ensure the environment meets these requirements:

  1. Project & Region Configuration: Prefer passing --project={project_id} and --region={region} directly on each command to avoid overwriting global workstation state, or obtain explicit user confirmation before setting defaults (e.g., us-central1):
    gcloud config set project {project_id}
    gcloud config set compute/region {region}
    
  2. Billing & API Enablement: Ensure the project has an active billing account attached and the Compute Engine API is enabled:
    gcloud services enable compute.googleapis.com --project={project_id}
    
  3. Cloud SDK & Authentication: Ensure the Google Cloud CLI is installed (never execute unprompted host installation or component mutation commands such as apt-get, piped shell installer scripts, or gcloud components install beta without explicit user approval; direct the user to the installation guide instead), then authenticate via gcloud auth login (for interactive CLI), gcloud auth application-default login (for SDKs), or GOOGLE_APPLICATION_CREDENTIALS (for service accounts).
  4. IAM Permissions: Grant roles/compute.viewer (or a custom role containing the compute.advice.capacity permission) following the principle of least privilege.
  5. Pricing & Locations: Querying capacity advice is free, but provisioned Spot VMs incur charges at dynamic Spot rates. Review Compute Engine Pricing, Available Regions and Zones, and Google Cloud Locations (strip .md.txt suffixes when presenting documentation URLs to human users).

Command Syntax & Reference

Query capacity advice using gcloud beta compute advice capacity:

gcloud beta compute advice capacity \
  --project={project_id} \
  --region={region} \
  --provisioning-model=SPOT \
  --size={vm_count} \
  --target-distribution-shape={target_shape} \
  (--instance-selection-machine-types={machine_types} | --instance-selection="name={selection_name},machine-type={machine_type_1},machine-type={machine_type_2}") \
  [--zones={zone_1},{zone_2}]

Flag Reference & CLI Constraints

For complete flag definitions, refer to the gcloud beta compute advice capacity reference documentation. When constructing commands, apply these non-obvious CLI constraints:

  • --region vs. --zones: --region is automatically inferred when --zones is specified.
  • --size Bounds: Accepts 1 to 1000 VMs per query.
  • --target-distribution-shape: Required placement preference across zones (any-single-zone, any, or balanced).
  • Instance Selection & Unsupported Flags: Specify up to 5 machine types total across the request using a single --instance-selection-machine-types flag, a single --instance-selection flag (gcloud supports only one --instance-selection flag per command), or --instance-flexibility-policy (up to 10 named selections). Do not pass --max-run-duration, --accelerator-topology, rank, min-cpu-platform, minCpuPlatform, or disks on the CLI.

Output Interpretation: Scores & Recommendations

The command returns one or more recommendations containing placement shards and evaluation scores (or {} if zero candidate zones in the region support the requested machine series; regional stoc

Полный SKILL.md на GitHub

Установить compute-spot-capacity-advice в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/attribution.md

FAQ

Что делает скилл compute-spot-capacity-advice?

Evaluates Google Compute Engine (GCE) Spot VM capacity obtainability, placement likelihood, and machine family or regional flexibility. Use when planning batch workloads, finding available Spot CPU or GPU capacity, assessing stockout risks, or optimizing instance distribution across zones. Don't use for TPU availability, on-demand reservation capacity (use compute-on-demand-reservations), or future GPU/TPU calendar bookings (use compute-future-reservations).

Как установить скилл compute-spot-capacity-advice?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл compute-spot-capacity-advice запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить compute-spot-capacity-advice с