{"data":{"slug":"github-google-skills-skills-cloud-compute-vm-creation-b5bda786b0f4","title":"Provision Google Compute Engine VM","summary":"Provision a standalone Google Compute Engine virtual machine (VM) or bare metal instance using gcloud CLI or MCP tools. The user receives a configured VM with specific hardware, networking, and OS settings, based on the inputs provided.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-compute-vm-creation-b5bda786b0f4","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-compute-vm-creation-b5bda786b0f4","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-compute-vm-creation-b5bda786b0f4.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-compute-vm-creation-b5bda786b0f4\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any command, ensure the user has installed and configured the gcloud CLI (version >= 480.0.0) or has the Compute Engine MCP server configured. Always ask for the four required inputs: project_id, vm_name, region\/zone, and public vs. private networking in the first response.","instructions":"---\nname: compute-vm-creation\ndescription: >-\n  Guides the planning, configuration, and provisioning of standalone Google\n  Compute Engine virtual machines (VMs) and bare metal (-metal) instances using\n  gcloud CLI commands or direct MCP tool execution. Use ONLY when the user wants\n  to create, configure, or provision a new standalone Compute Engine VM or bare\n  metal instance from conversational intents (hardware sizing, region selection,\n  OS image, networking, security defaults). DO NOT read or use for Google\n  Kubernetes Engine (GKE) Autopilot or Standard clusters, Kubernetes node pools\n  or Pods, container orchestration, managing existing VMs, Managed Instance\n  Groups (MIGs), or Instance Templates.\nmetadata:\n  version: \"1.0.0\"\n  category: Compute\n---\n\n# Compute Engine VM Creation\n\nThis skill provides an interactive, intent-based experience for provisioning\nstandalone Google Compute Engine VM and bare metal (`-metal`) instances. It\nsupports users ranging from beginners asking to \"create a VM\" to cloud engineers\nrequiring customized infrastructure, mapping natural language intents to secure\nCompute Engine configurations grounded in the Golden Path.\n\n> **MCP Tools:** `list_instances`, `create_instance`, `get_instance_basic_info`,\n> `delete_instance`, `get_zone_operation`, `list_machine_types`,\n> `list_accelerator_types`, `list_images`\n\n## Usage Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read and follow the instructions in\n[Usage Attribution](references\/attribution.md). Never include attribution\nenvironment variables or `User-Agent` tags in generated scripts, Terraform, or\ncopy-pasteable commands shown to the user.\n\n---\n\n## Prerequisites\n\nEnsure the following setup requirements are met before provisioning instances.\nAny host modifications (such as installing or updating the `gcloud` CLI,\ninstalling or configuring the Google Compute Engine MCP server, or modifying\nlocal environment configuration) must be explicitly approved by the user before\nexecution.\n\n- **Cloud SDK Installation**: Verify `gcloud` is installed (`gcloud --version`,\n  Google Cloud SDK >= 480.0.0) only when executing live CLI commands. If\n  missing or outdated, ask the user for explicit approval before installing or\n  updating via\n  [Install the gcloud CLI](https:\/\/docs.cloud.google.com\/sdk\/docs\/install-sdk.md.txt).\n- **Compute Engine MCP Server**: For direct MCP tool execution\n  (`list_instances`, `create_instance`, `get_instance_basic_info`,\n  `delete_instance`, `get_zone_operation`, `list_machine_types`,\n  `list_accelerator_types`, `list_images`), check whether the Compute Engine MCP\n  tools are loaded in your active tool declarations, or ask the user for\n  approval to configure the server following\n  [Use the Compute Engine MCP server](https:\/\/docs.cloud.google.com\/compute\/docs\/use-compute-engine-mcp.md.txt).\n- **Billing Account**: Confirm the target Google Cloud project has an active\n  billing account linked (required even when using\n  [Google Cloud Free Tier](https:\/\/docs.cloud.google.com\/free\/docs\/free-cloud-features.md.txt)\n  resources).\n- **Authentication**: Authenticate your environment for CLI execution\n  (`gcloud auth login`), application\/MCP SDKs\n  (`gcloud auth application-default login`), or service account credentials\n  (`GOOGLE_APPLICATION_CREDENTIALS`).\n- **Project Selection & API Enablement**: Set the target project and enable the\n  Compute Engine API:\n  ```bash\n  gcloud config set project {project_id}\n  gcloud services enable compute.googleapis.com\n  ```\n- **Required IAM Roles**:\n  - **Caller Roles**: `roles\/compute.instanceAdmin.v1` (to create and manage\n    instances), `roles\/iam.serviceAccountUser` (to attach\n    `{custom_service_account}`), and `roles\/mcp.toolUser` when invoking the\n    Compute Engine MCP server.\n  - **IAP SSH\/RDP Access for Private (`--no-address`) VMs**: Connecting via\n    `gcloud compute ssh {vm_name} --zone={zone} --tunnel-through-iap` requires\n    `roles\/iap.tunnelResourceAccessor` plus a VPC firewall rule allowing TCP\n    `22` (or `3389` for RDP) from IAP's forwarding range `35.235.240.0\/20` (see\n    [Use IAP for TCP forwarding](https:\/\/docs.cloud.google.com\/iap\/docs\/using-tcp-forwarding.md.txt)).\n  - **Custom VM Service Account Setup**: Fresh projects only contain the default\n    Compute Engine service account. If `{custom_service_account}` does not yet\n    exist, create a dedicated least-privilege service account first (seeking\n    user approval before granting IAM bindings):\n    ```bash\n    gcloud iam service-accounts create {sa_name} \\\n      --project={project_id} \\\n      --display-name=\"{sa_display_name}\"\n    gcloud projects add-iam-policy-binding {project_id} \\\n      --member=\"serviceAccount:{sa_name}@{project_id}.iam.gserviceaccount.com\" \\\n      --role=\"roles\/logging.logWriter\"\n    gcloud projects add-iam-policy-binding {project_id} \\\n      --member=\"serviceAccount:{sa_name}@{project_id}.iam.gserviceaccount.com\" \\\n      --role=\"roles\/monitoring.metricWriter\"\n    ```\n\n---\n\n## Workflow\n\n1. **Determine Execution Method & MCP Capability Boundary**:\n   - **Fast Conversational Intake (No Shell Probing on Missing Inputs)**: When a\n     user asks to configure or create a VM without providing mandatory inputs\n     (`project_id`, `vm_name`, `region`\/`zone`, or public vs. private\n     networking), **respond immediately after reading `SKILL.md` without running\n     `gcloud config list`, `gcloud --version`, or any shell commands**. Clarify\n     that you can either execute provisioning once confirmed (Automated\n     Execution) or provide copy-pasteable `gcloud` commands \/ JSON payloads\n     (Manual Execution), recommend a sizing tier, and ask for the missing inputs\n     in a single turn.\n   - **MCP vs. `gcloud` Routing Rule**: Compute Engine MCP discovery tools\n     (`list_instances`, `get_instance_basic_info`, `list_machine_types`,\n     `list_accelerator_types`, `list_images`, `get_zone_operation`) are ideal\n     for read-only inspection. However, MCP `create_instance`\n     (`McpCreateInstanceRequest`) accepts **only eight flat top-level fields**\n     (`project`, `zone`, `name`, bare `machineType`, `imageProject`,\n     `imageFamily`, `guestAccelerators`, `maintenancePolicy`) and hardcodes\n     `global\/networks\/default` without `--no-address`, custom subnets, custom\n     service accounts, Shielded VM flags, OS Login, Spot scheduling, or custom\n     disk sizes\/types. **Route all hardened (`--no-address`, custom\n     `--subnet={subnet}`, `{custom_service_account}`, Shielded VM, OS Login),\n     Spot, custom-disk, 4th-gen Hyperdisk, and bare metal (`-metal`) creations\n     to `gcloud compute instances create` (or REST `instances.insert`)** rather\n     than dropping security guardrails to fit `create_instance`. Use MCP\n     `create_instance` only for default-VPC prototyping when default disk and\n     service-account settings are explicitly acceptable.\n2. **Gather Mandatory Inputs**: **ALWAYS** ask the user for any missing inputs:\n   - **Project ID** (Ask directly if not provided in the prompt).\n   - **VM Name** (Offer a friendly default suggestion if unsure, e.g.,\n     `my-first-web-server`).\n   - **Region & Zone** (Explain *why* simply: *\"Choosing a location closer to\n     you or your users reduces latency and makes things load faster.\"* Recommend\n     `us-central1` \/ `us-central1-a` if the user has no preference, and consult\n     [Regions and zones](https:\/\/docs.cloud.google.com\/compute\/docs\/regions-zones.md.txt),\n     [GPU regions and zones](https:\/\/docs.cloud.google.com\/compute\/docs\/regions-zones\/gpu-regions-zones.md.txt),\n     or [Google Cloud locations](https:\/\/cloud.google.com\/about\/locations) only\n     when verifying non-default regional availability):\n     ```bash\n     gcloud config set compute\/region {region}\n     gcloud config set compute\/zone {zone}\n     ```\n3. **Conversational Triage (Sizing, Generation & OS)**: Map the user's workload\n   to the **Intent-Based Sizing Tiers** and hardware generation defaults:\n   - **Default OS images**: Use `debian-12` (`debian-cloud`) for `E2`, `N2`,\n     `C3` virtualized, and `C2D`; use `debian-13` (`debian-cloud`) for 4th-gen\n     (`C4`, `N4`, `X4`) and bare metal (`c3-standard-192-metal`,\n     `c4-standard-288-metal`, where `debian-12` is unsupported); use\n     `debian-12-arm64` \/ `debian-13-arm64` for Arm `C4A`; and use\n     `common-cu129-ubuntu-2404-nvidia-580` (`deeplearning-platform-release`) for\n     `G2` GPUs. Consult\n     [Operating system details](https:\/\/docs.cloud.google.com\/compute\/docs\/images\/os-details.md.txt)\n     and\n     [Bare metal instances](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/bare-metal-instances.md.txt)\n     only when selecting non-default OS images or bare metal SKUs.\n   - **Storage by generation**: Use `hyperdisk-balanced` on 4th-gen (`C4`, `N4`,\n     `C4A`, `C4D`, `M4`, `X4`, `A4`) and bare metal (`-metal`) instances where\n     `pd-*` disks are rejected (`N4` supports `hyperdisk-balanced` and\n     `hyperdisk-throughput`, not `hyperdisk-extreme`; `H3` supports\n     `pd-balanced` and `hyperdisk-balanced`). Consult the *\"Machine series\n     support for Hyperdisk\"* section of\n     [About Google Cloud Hyperdisk](https:\/\/docs.cloud.google.com\/compute\/docs\/disks\/hyperdisks.md.txt)\n     only for non-default disk types.\n4. **Determine Network Accessibility & Subnet**: **ALWAYS** ask in plain,\n   non-technical language whether the VM needs to be reachable from the public\n   internet or kept private, noting that private networking (`--no-address`) is\n   the security best practice\u2014even when hosting a website or web app. Use\n   `--subnet={subnet}` (verifying whether a custom\/Shared VPC subnet or\n   `default` VPC exists, since many enterprise projects enforce\n   `constraints\/compute.skipDefaultNetworkCreation`).\n5. **Configure Security, OS Login & Service Accounts**: Enable IAM-governed SSH\n   via `--metadata=enable-oslogin=TRUE`, recommend a custom least-privilege\n   service account (`{custom_service_account}`), and enable Shielded VM flags\n   (`--shielded-secure-boot`, `--shielded-vtpm`,\n   `--shielded-integrity-monitoring`) on virtualized VMs (on standard x86\n   `-metal` bare metal instances, pass `--no-shielded-secure-boot` and omit\n   vTPM\/integrity flags).\n6. **Summarize & Confirm (Mode-Aware)**: Present a clear summary of the proposed\n   VM configuration, cost profile, and architectural warnings:\n   - **Automated Execution Mode**: **Always** ask for explicit user confirmation\n     before executing any mutating provisioning command or tool call (e.g.,\n     *\"Would you like me to proceed with provisioning this configuration, or\n     adjust any settings first?\"*).\n   - **Manual \/ `\"Do not execute\"` Mode**: Instruct the user to review and\n     substitute any `{snake_case}` placeholders (such as `{subnet}` or\n     `{custom_service_account}`) before running the command in their terminal;\n     do **not** offer to execute provisioning when tools are disconnected or\n     execution was forbidden.\n7. **Execute or Deliver Payloads**:\n   - **Automated**: Execute `gcloud compute instances create` (prefixed with\n     `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION` per\n     [Usage Attribution](references\/attribution.md)) for hardened\/Spot\/4th-gen\/\n     bare-metal configurations, or call MCP `create_instance` for default-VPC\n     prototyping, tracking progress via `get_zone_operation` and verifying via\n     `get_instance_basic_info`.\n   - **Manual**: Output formatted, copy-pasteable `gcloud` CLI commands (without\n     `--quiet` or attribution prefixes) or JSON payloads with clear\n     instructions.\n8. **Verify, Deliver Next Steps & Teardown Guidance**: Provide post-provisioning\n   access steps (for example, via `--tunnel-through-iap` with `gcloud compute\n   ssh`) and **always** include teardown instructions (omitting `--quiet` so\n   interactive confirmation prevents accidental data loss; see\n   [Delete a VM](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/deleting-instance.md.txt)):\n   ```bash\n   gcloud compute instances delete {vm_name} --zone={zone} --delete-disks=all\n   ```\n   Remind the user to pass `--delete-disks=all` (or `--keep-disks=all` if\n   retaining data) so persistent disks are not orphaned.\n\n---\n\n## Intent-Based Sizing Tiers\n\nIf a user says \"I want to create a VM\" or is unsure of hardware specs, use this\ntable to recommend a tier. Point users to\n[Google Cloud pricing](https:\/\/cloud.google.com\/pricing) and\n[Compute Engine pricing](https:\/\/cloud.google.com\/compute\/all-pricing) for\ncurrent regional rates rather than quoting hardcoded dollar figures.\n\n| **Conversational Tier** | **Best For...** | **Underlying Machine** | **Boot Disk (Default)** | **Cost Profile** |\n| --- | --- | --- | --- | --- |\n| **Starter Tier** *(Dev\/Test & Learning)* | \"I just want to play around,\" \"I'm learning Linux,\" \"I have a tiny hobby script.\" | `e2-micro` (Free Tier eligible) or `e2-small` | 10 GB Standard Disk (`pd-standard`; Free Tier covers up to 30 GB `pd-standard`) | **Very Low** ([Google Cloud Free Tier](https:\/\/docs.cloud.google.com\/free\/docs\/free-cloud-features.md.txt) covers **one non-preemptible `e2-micro` instance\/month** in `us-west1`, `us-central1`, or `us-east1` only; `e2-small` or other regions incur standard billing immediately; active billing account required) |\n| **Standard Tier** *(Websites & Apps)* **[GOLDEN PATH]** | \"I want to host a website,\" \"I'm running a small database,\" \"I don't know, just give me a basic one.\" | `e2-standard-2` (default baseline; `e2-medium` for light websites\/apps, or `e2-standard-4` with 50 GB `pd-balanced` for higher concurrency) | 30 GB Balanced Disk (`pd-balanced`) | **Moderate** (Pay-as-you-go; see [Compute Engine pricing](https:\/\/cloud.google.com\/compute\/all-pricing)) |\n| **Powerhouse Tier** *(Heavy Processing)* | \"I have heavy data pipelines,\" \"I'm compiling large codebases,\" \"I need maximum speed.\" | 3rd-gen General-purpose `c3-standard-4` or `n2-standard-4` (4th-gen `c4-standard-4` \/ `n4-standard-4` \/ Arm `c4a-standard-4`; Compute-optimized `c2d-standard-4` \/ `h3-standard-88`) | 100 GB `pd-ssd` (3rd-gen\/`C2D`), `pd-balanced` or `hyperdisk-balanced` (`H3`), or `hyperdisk-balanced` (mandatory on 4th-gen `C4`\/`N4`\/`C4A`) | **Premium** (Pay-as-you-go) |\n| **Specialist Tier** *(AI, Graphics & Bare Metal)* | \"I want to run an LLM,\" \"I need a GPU workstation,\" \"I need a bare metal `-metal` host.\" | `g2-standard-4` (1 NVIDIA L4 GPU) or bare metal `c3-standard-192-metal` \/ `c4-standard-288-metal` | 100 GB `pd-balanced` (`G2`) or 200 GB `hyperdisk-balanced` (`-metal` \/ 4th-gen `A4`) | **High** (Requires GPU or dedicated bare-metal CPU quota) |\n\n> **Rule:** Default to the Standard Tier (`e2-standard-2` with a 30 GB\n> `pd-balanced` boot disk) unless the user has specific requirements that other\n> tiers or sizes satisfy. When a workload maps to a tier without an explicit\n> vCPU\/RAM count, **always use the baseline machine type listed in the table**\n> (`e2-micro` or `e2-small` for Starter; `e2-standard-2` [or `e2-medium` \/\n> `e2-standard-4` when justified] for Standard; `c3-standard-4` or\n> `n2-standard-4` for 3rd-gen Powerhouse, `c4-standard-4` \/ `n4-standard-4` for\n> 4th-gen, or `c2d-standard-4` for Compute-optimized; `g2-standard-4` for L4\n> GPU) rather than upsizing to `-8` or `-16`.\n\n---\n\n## Conversational Guidelines (How to Talk to Users)\n\n### 1. Early Fork: Establishing Execution Mode\n\nAt the start of an interactive session, state whether execution is automated\n(provisioning after confirmation via `gcloud` \/ Compute Engine MCP) or guided\n(outputting copy-pasteable `gcloud` commands or JSON payloads for Cloud Shell or\nterminal)\u2014**without running `gcloud config list` or shell commands while\nmandatory inputs are still missing**.\n\n### 2. Handling Simple Requests (e.g., \"Create a VM\" or \"Host a Small Website\")\n\nDo not overwhelm beginners with block-storage IOPS or CPU architecture jargon,\nand **do not run terminal commands before the user answers**. Clarify execution\nmode, recommend the **Standard Tier (Golden Path)** baseline (`e2-standard-2` or\n`e2-medium` with a **30 GB `pd-balanced` boot disk**), and **always** ask for\nall four required inputs in your first response:\n\n1. **Google Cloud Project ID**\n2. **VM Name** (e.g., `my-first-web-server`)\n3. **Region or Zone** (explaining that a location closer to users lowers network\n   latency and makes pages load faster; suggest `us-central1` \/ `us-central1-a`\n   if unsure)\n4. **Public Internet vs. Private Networking** (in plain language: *\"Does this VM\n   need to be reachable from the public internet, or should we keep it private?\n   Keeping it private is our default security best practice\u2014even for websites,\n   please confirm which you prefer.\"*)\n\n### 3. Clear Cost, Quota & Resource Availability Guidance\n\n- Warn clearly before provisioning **Powerhouse**, **GPU**, or **Bare Metal**\n  instances that specialized hardware and large `pd-ssd` \/ Hyperdisk volumes\n  accumulate costs quickly (disks bill continuously while stopped) and require\n  sufficient regional CPU\/GPU quota.\n- If VM provisioning fails with `ZONE_RESOURCE_POOL_EXHAUSTED` (or\n  `ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS`), explain that this is a physical\n  zonal hardware supply shortage that **a project quota increase will not fix**.\n  Consult\n  [Troubleshoot resource availability errors](https:\/\/docs.cloud.google.com\/compute\/docs\/troubleshooting\/troubleshooting-resource-availability.md.txt)\n  and guide the user to try another zone in the region (e.g., `us-central1-b` or\n  `us-central1-c`), adjust machine series\/size, or use Compute Engine\n  reservations.\n\n---\n\n## Best Practices & Hardening Rules\n\n### Security & Networking\n\n1. **Private-by-Default (`--no-address`)**: Default to `--no-address` on custom\n   or verified `--subnet={subnet}` subnets, using Cloud NAT for outbound egress\n   and Identity-Aware Proxy (IAP) TCP forwarding (`35.235.240.0\/20`, TCP `22` \/\n   `3389`, `roles\/iap.tunnelResourceAccessor`; see\n   [Use IAP for TCP forwarding](https:\/\/docs.cloud.google.com\/iap\/docs\/using-tcp-forwarding.md.txt))\n   for SSH\/RDP.\n2. **OS Login (`--metadata=enable-oslogin=TRUE`)**: Enable OS Login so SSH\n   access is tied to IAM roles rather than project-wide static SSH keys.\n3. **Custom Service Accounts**: Never use the default Compute Engine service\n   account; attach `{custom_service_account}` with least-privilege IAM roles.\n4. **Shielded VMs**: Enable `--shielded-secure-boot`, `--shielded-vtpm`, and\n   `--shielded-integrity-monitoring` on all virtualized VMs (omit vTPM\/integrity\n   and set `--no-shielded-secure-boot` on standard x86 `-metal` bare metal).\n\n### Cost Optimization & Reliability\n\n1. **Right-Sizing & Free Tier Accuracy**: Use `e2-micro` (`us-west1`,\n   `us-central1`, or `us-east1` only, 1 non-preemptible instance\/month, up to\n   30 GB `pd-standard`, with an active billing account still required on the\n   Google Cloud project; see\n   [Google Cloud Free Tier](https:\/\/docs.cloud.google.com\/free\/docs\/free-cloud-features.md.txt))\n   for Free Tier eligibility, or `e2-medium` for light dev\/test workloads.\n2. **Spot VMs**: Offer Spot VMs (`--provisioning-model=SPOT`,\n   `--instance-termination-action=DELETE` [or `STOP`],\n   `--maintenance-policy=TERMINATE`, `--no-restart-on-failure`; see\n   [Create and use Spot VMs](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/create-use-spot.md.txt))\n   for stateless, fault-tolerant batch workloads to achieve significant\n   discounts compared to standard instances (see\n   [Compute Engine pricing](https:\/\/cloud.google.com\/compute\/all-pricing)).\n3. **Storage & Host Maintenance**: Default 3rd-gen\/E2 boot disks to\n   `pd-balanced` (`hyperdisk-balanced` on 4th-gen and `-metal`), and set\n   `--maintenance-policy=MIGRATE` on standard virtualized VMs (`TERMINATE` on\n   Spot, GPU, and `-metal` instances; see\n   [Handle GPU host maintenance events](https:\/\/docs.cloud.google.com\/compute\/docs\/gpus\/gpu-host-maintenance.md.txt)).\n\n---\n\n## Technical Reference Templates\n\nEvery row below summarizes the complete `gcloud compute instances create` flags\n(with `{vm_name}`, `--project={project_id}`, and `--zone={zone}`) and 8-field\nCompute Engine MCP `create_instance` schema for the five standard VM templates.\nConsult [Technical Reference Templates](references\/templates.md) when full\nmulti-line examples or additional template context are needed, and always read\n[Usage Attribution](references\/attribution.md) before executing any live\n`gcloud`, REST API, or MCP command:\n\n| **Template** | **Complete `gcloud compute instances create {vm_name} --project={project_id} --zone={zone}` Flags** | **MCP `create_instance` Routing & Schema** | **Required Warnings** |\n| --- | --- | --- | --- |\n| **1. Golden Path General Purpose (Production)** | `--machine-type=e2-standard-2 --network-tier=PREMIUM --subnet={subnet} --no-address --maintenance-policy=MIGRATE --metadata=enable-oslogin=TRUE --service-account={custom_service_account} --scopes=https:\/\/www.googleapis.com\/auth\/cloud-platform --create-disk=auto-delete=yes,boot=yes,device-name={vm_name},image=projects\/debian-cloud\/global\/images\/family\/debian-12,mode=rw,size=30,type=projects\/{project_id}\/zones\/{zone}\/diskTypes\/pd-balanced --shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any` | 7-field JSON (`project`, `zone`, `name`, `\"machineType\": \"e2-standard-2\"`, `\"imageProject\": \"debian-cloud\"`, `\"imageFamily\": \"debian-12\"`, `\"maintenancePolicy\": \"MIGRATE\"`) is for default-VPC prototyping only; route hardened (`--no-address`, custom subnet\/SA) deploys to `gcloud`. | Recommend Cloud NAT for egress and IAP TCP forwarding (`35.235.240.0\/20`, `roles\/iap.tunnelResourceAccessor`) for SSH\/RDP; never use the default Compute Engine service account; omit `--quiet`. |\n| **2. Developer Dev\/Test VM (Cost-Optimized Spot)** | `--machine-type=e2-medium --subnet={subnet} --no-address --metadata=enable-oslogin=TRUE --service-account={custom_service_account} --scopes=https:\/\/www.googleapis.com\/auth\/cloud-platform --provisioning-model=SPOT --instance-termination-action=DELETE --maintenance-policy=TERMINATE --no-restart-on-failure --create-disk=auto-delete=yes,boot=yes,device-name={vm_name},image=projects\/debian-cloud\/global\/images\/family\/debian-12,mode=rw,size=20,type=projects\/{project_id}\/zones\/{zone}\/diskTypes\/pd-standard --shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring` | **CLI\/REST only**\u2014Compute Engine MCP `create_instance` does not support Spot scheduling (`--provisioning-model=SPOT`, `--instance-termination-action`), `--no-address`, or custom subnets\/service accounts. | Warn that Spot VMs can be preempted at any time (for stateless workloads only); use `DELETE` or `STOP` (never `TERMINATE`) on `--instance-termination-action`; include teardown command without `--quiet`. |\n| **3. High-Performance General Purpose & Compute-Heavy** | **3rd-gen (`c3-standard-4` \/ `n2-standard-4`)**: `--machine-type=c3-standard-4 --subnet={subnet} --no-address --metadata=enable-oslogin=TRUE --service-account={custom_service_account} --scopes=https:\/\/www.googleapis.com\/auth\/cloud-platform --create-disk=auto-delete=yes,boot=yes,device-name={vm_name},image=projects\/debian-cloud\/global\/images\/family\/debian-12,mode=rw,size=100,type=projects\/{project_id}\/zones\/{zone}\/diskTypes\/pd-ssd --maintenance-policy=MIGRATE --shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring` (for **4th-gen `c4-standard-4` \/ `n4-standard-4`**, replace `--subnet`\/`--no-address` with `--network-interface=subnet={subnet},no-address,nic-type=GVNIC`, use `debian-13`, and use `hyperdisk-balanced`) | Default-VPC 3rd-gen prototyping only (`\"machineType\": \"c3-standard-4\"`); route custom-disk, 4th-gen Hyperdisk, and private-subnet deploys to `gcloud`. | Warn about continuous `pd-ssd`\/Hyperdisk storage billing, 4th-gen Hyperdisk requirement (`pd-*` rejected on `C4`\/`N4`\/`C4A`), and accurate **Day-0 mutability** (disk shrink\/type change uses snapshot + `detach-disk`\/`attach-disk --boot` swap; stopped VMs rename via `gcloud compute instances set-name` and update subnet via `network-interfaces update`; VM recreation required for zone, CPU arch, or Encrypted-Memory VM). |\n| **4. GPU Workstation (ML Inference)** | `--machine-type=g2-standard-4 --accelerator=type=nvidia-l4,count=1 --subnet={subnet} --no-address --metadata=enable-oslogin=TRUE --service-account={custom_service_account} --scopes=https:\/\/www.googleapis.com\/auth\/cloud-platform --maintenance-policy=TERMINATE --create-disk=auto-delete=yes,boot=yes,device-name={vm_name},image=projects\/deeplearning-platform-release\/global\/images\/family\/common-cu129-ubuntu-2404-nvidia-580,mode=rw,size=100,type=projects\/{project_id}\/zones\/{zone}\/diskTypes\/pd-balanced --shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring` | 8-field JSON (`\"project\": \"{project_id}\"`, `\"zone\": \"{zone}\"`, `\"name\": \"{vm_name}\"`, `\"machineType\": \"g2-standard-4\"`, `\"imageProject\": \"deeplearning-platform-release\"`, `\"imageFamily\": \"common-cu129-ubuntu-2404-nvidia-580\"`, `\"guestAccelerators\": [{\"acceleratorType\": \"nvidia-l4\", \"acceleratorCount\": 1}]`, `\"maintenancePolicy\": \"TERMINATE\"`) is for default-VPC prototyping only; route hardened deploys to `gcloud`. | Warn about high GPU hourly costs, required regional GPU quota verification, and that GPU VMs **do not support live migration** (`--maintenance-policy=TERMINATE` is mandatory; never set `MIGRATE`). |\n| **5. Bare Metal Instance (`-metal`)** | `--machine-type=c3-standard-192-metal --network-interface=subnet={subnet},no-address,nic-type=IDPF --maintenance-policy=TERMINATE --metadata=enable-oslogin=TRUE --service-account={custom_service_account} --scopes=https:\/\/www.googleapis.com\/auth\/cloud-platform --create-disk=auto-delete=yes,boot=yes,device-name={vm_name},image=projects\/debian-cloud\/global\/images\/family\/debian-13,mode=rw,size=200,type=projects\/{project_id}\/zones\/{zone}\/diskTypes\/hyperdisk-balanced --no-shielded-secure-boot` (never combine `--network-interface` with top-level `--subnet` or `--no-address`; omit `--shielded-vtpm`) | **CLI\/REST only**\u2014unsupported by Compute Engine MCP `create_instance`. | Warn about dedicated whole-host costs\/quota, mandatory `hyperdisk-balanced` (`pd-*` and Windows unsupported), mandatory `debian-13` (`debian-12` unsupported on `C3-metal`, `C4-metal`, and `X4`), mandatory `nic-type=IDPF` (`GVNIC`\/`VIRTIO_NET` unsupported), and no live migration. |\n\n---\n\n## Instructions & Guardrails\n\n- **EARLY EXECUTION FORK & MCP BOUNDARY**: Never pass unsupported REST fields\n  (`instance`, `disks`, `networkInterfaces`, `serviceAccounts`,\n  `shieldedInstanceConfig`, `scheduling`) or prefixed machine URIs\n  (`zones\/{zone}\/machineTypes\/...`) to MCP `create_instance`, and always route\n  hardened (`--no-address`, custom subnet, custom SA, Shielded VM, OS Login),\n  Spot, custom-disk, 4th-gen, and `-metal` creations to\n  `gcloud compute instances create`.\n- **FAST CONVERSATIONAL INTAKE (NO SHELL COMMANDS ON MISSING INPUTS)**: When any\n  mandatory input (**Project ID**, **VM name**, **region\/zone**, or **public vs.\n  private networking**) is missing from the user's prompt, ask for all missing\n  inputs directly in your first reply (explaining regional latency benefits and\n  recommending private networking) **without running `gcloud config list`,\n  `gcloud --version`, or any shell discovery commands first**.\n- **PUBLIC IP REMEDIATION CHECKLIST**: Whenever a user requests a public IP or\n  direct internet SSH exposure:\n  1. Warn clearly about public internet scanners and SSH\/RDP brute-force risks.\n  2. Recommend **both** **Identity-Aware Proxy (IAP) TCP forwarding**\n     (`35.235.240.0\/20`, `roles\/iap.tunnelResourceAccessor`) for SSH\/RDP **and**\n     **Cloud NAT** for outbound internet access with `--no-address`.\n  3. Include `--metadata=enable-oslogin=TRUE` and all three **Shielded VM**\n     flags (`--shielded-secure-boot`, `--shielded-vtpm`,\n     `--shielded-integrity-monitoring`) on virtualized VMs.\n  4. Recommend a **custom, least-privilege service account** instead of the\n     default Compute Engine service account.\n- **ACCURATE DAY-0 MUTABILITY WARNINGS**: Explain accurately that:\n  - **Disks**: Persistent Disks and Hyperdisks cannot shrink in-place, and\n    changing disk type requires creating a new disk from a snapshot and swapping\n    it on a stopped VM (`detach-disk` \/ `attach-disk --boot`) without\n    recreating the VM instance.\n  - **Networking & Renaming**: Stopped (`TERMINATED`) standalone IPv4 VMs can\n    migrate VPC\/subnet in-place (`gcloud compute instances network-interfaces\n    update`; only NIC count `nic1+` is fixed at creation) and can be renamed\n    in-place via `gcloud compute instances set-name` with `--new-name` and\n    `--zone`\n    (see [Rename a VM](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/rename-instance.md.txt)\n    and [Update instance properties](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/update-instance-properties.md.txt)).\n  - **True VM Recreation**: Properties requiring full **VM recreation** are\n    **zone**, **CPU architecture** (`x86_64` vs. `ARM64`), and\n    **Encrypted-Memory VM (AMD SEV-SNP or Intel TDX)** enablement.\n- **4TH-GEN & BARE METAL HARDWARE CONSTRAINTS**: Never pair `pd-*` disks with\n  4th-generation (`C4`, `N4`, `C4A`, `C4D`, `M4`, `X4`, `A4`, which require\n  `hyperdisk-balanced` and `nic-type=GVNIC`; `N4` supports `hyperdisk-balanced`\n  and `hyperdisk-throughput`, not `hyperdisk-extreme`) or bare metal (`-metal`)\n  instances. Whenever recommending or generating a bare metal (`-metal`)\n  configuration (`C3-metal`, `C4-metal`), **always explicitly state in your\n  reply** that: (1) `pd-*` disks are unsupported (`hyperdisk-balanced` is\n  mandatory), (2) `debian-13` is required because `debian-12` is unsupported on\n  `C3-metal`, `C4-metal`, and `X4`, (3)\n  `--network-interface=subnet={subnet},no-address,nic-type=IDPF` is required\n  without conflicting top-level `--subnet` or `--no-address` flags (because\n  `GVNIC` and `VIRTIO_NET` are unsupported on `-metal`), and (4)\n  `--maintenance-policy=TERMINATE`, `--metadata=enable-oslogin=TRUE`, and\n  `--no-shielded-secure-boot` (omitting `--shielded-vtpm`) are required.\n- **MANDATORY GPU & SPECIALIZED HARDWARE WARNINGS**: Whenever recommending or\n  generating a GPU (`G2`, `A3`, `A4`), bare metal (`-metal`), or\n  high-performance VM configuration (including in `\"Do not execute\"` or MCP JSON\n  comparisons), **always** explicitly include in your reply: (1) a warning about\n  **high GPU or dedicated-host hourly compute costs**, (2) a reminder to\n  **verify regional GPU\/CPU quota** in the target project, and (3) that **GPU\n  and bare metal instances do not support live migration**\n  (`--maintenance-policy=TERMINATE` is mandatory).\n- **HANDLE `ZONE_RESOURCE_POOL_EXHAUSTED`**: Explain that zonal capacity errors\n  are physical hardware shortages (not fixable via quota increases) and guide\n  users to alternate zones, alternate machine series, or reservations per\n  [Troubleshoot resource availability errors](https:\/\/docs.cloud.google.com\/compute\/docs\/troubleshooting\/troubleshooting-resource-availability.md.txt).\n- **FREE TIER ELIGIBILITY & BILLING ACCOUNT REQUIREMENT**: Whenever a user asks\n  about Google Cloud Free Tier eligibility for Compute Engine, always explicitly\n  state all four requirements in your reply: (1) only one non-preemptible\n  `e2-micro` instance per month is covered (`e2-small` and larger are billed),\n  (2) only in `us-west1`, `us-central1`, or `us-east1`, (3) up to 30 GB of\n  `pd-standard` Standard Persistent Disk (`pd-balanced` and `pd-ssd` are\n  billed), and (4) an **active billing account is still required on the Google\n  Cloud project** even for Free Tier usage.\n- **ALWAYS INCLUDE SAFE TEARDOWN COMMANDS**: Always provide\n  `gcloud compute instances delete {vm_name} --zone={zone} --delete-disks=all`\n  (omitting `--quiet` on all copy-pasteable manual `create` and `delete`\n  commands) so users can prevent orphaned compute and disk charges safely.\n- **MODE-AWARE CONFIRMATION**: Require explicit user confirmation before\n  executing provisioning in **Automated Execution** mode; in **Manual \/ `\"Do not\n  execute\"`** mode, prompt the user to review `{snake_case}` placeholders and\n  flags before running the command themselves rather than offering to execute\n  it.\n","use_cases":["Create a VM for development or testing","Provision a bare metal instance for high-performance computing","Configure a VM with specific hardware and networking settings"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/compute-vm-creation\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T13:58:41.000000Z","updated_at":"2026-11-17T05:10:29.000000Z","seo_title":"Provision Google Compute Engine VM","seo_description":"Provision a standalone Google Compute Engine VM or bare metal instance using gcloud CLI or MCP tools. Use when creating, configuring, or provisioning a new VM from user's","seo_keywords":["Provision Google Compute Engine VM","Create Compute Engine VM","Configure Compute Engine VM","Provision bare metal instance","Compute Engine VM setup"]}}