Compute Engine VM Creation

Compute Engine VM Creation

Guides an AI agent through planning and provisioning standalone Google Compute Engine VMs and bare metal instances with gcloud or MCP tools, from sizing to security defaults.

Skill files3 files

references/

SKILL.md446 lines
1
---
2
name: compute-vm-creation
3
description: >-
4
Guides the planning, configuration, and provisioning of standalone Google
5
Compute Engine virtual machines (VMs) and bare metal (-metal) instances using
6
gcloud CLI commands or direct MCP tool execution. Use ONLY when the user wants
7
to create, configure, or provision a new standalone Compute Engine VM or bare
8
metal instance from conversational intents (hardware sizing, region selection,
9
OS image, networking, security defaults). DO NOT read or use for Google
10
Kubernetes Engine (GKE) Autopilot or Standard clusters, Kubernetes node pools
11
or Pods, container orchestration, managing existing VMs, Managed Instance
12
Groups (MIGs), or Instance Templates.
13
metadata:
14
version: "1.1.0"
15
category: Compute
16
---
17
18
# Compute Engine VM Creation
19
20
This skill provides an interactive, intent-based experience for provisioning
21
standalone Google Compute Engine VM and bare metal (`-metal`) instances. It
22
supports users ranging from beginners asking to "create a VM" to cloud engineers
23
requiring customized infrastructure, mapping natural language intents to secure
24
Compute Engine configurations grounded in the Golden Path.
25
26
> **MCP Tools:** `list_instances`, `create_instance`, `get_instance_basic_info`,
27
> `delete_instance`, `get_zone_operation`, `list_machine_types`,
28
> `list_accelerator_types`, `list_images`
29
30
## Usage Attribution
31
32
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
33
MUST read and follow the instructions in
34
[Usage Attribution](references/attribution.md). Never include attribution
35
environment variables or `User-Agent` tags in generated scripts, Terraform, or
36
copy-pasteable commands shown to the user.
37
38
---
39
40
## Prerequisites
41
42
Ensure the following setup requirements are met before provisioning instances.
43
Any host modifications (such as installing or updating the `gcloud` CLI,
44
installing or configuring the Google Compute Engine MCP server, or modifying
45
local environment configuration) must be explicitly approved by the user before
46
execution.
47
48
- **Cloud SDK Installation**: Verify `gcloud` is installed (`gcloud --version`,
49
Google Cloud SDK >= 480.0.0) only when executing live CLI commands. If
50
missing or outdated, ask the user for explicit approval before installing or
51
updating via
52
[Install the gcloud CLI](https://docs.cloud.google.com/sdk/docs/install-sdk.md.txt).
53
- **Compute Engine MCP Server**: For direct MCP tool execution
54
(`list_instances`, `create_instance`, `get_instance_basic_info`,
55
`delete_instance`, `get_zone_operation`, `list_machine_types`,
56
`list_accelerator_types`, `list_images`), check whether the Compute Engine MCP
57
tools are loaded in your active tool declarations, or ask the user for
58
approval to configure the server following
59
[Use the Compute Engine MCP server](https://docs.cloud.google.com/compute/docs/use-compute-engine-mcp.md.txt).
60
- **Billing Account**: Confirm the target Google Cloud project has an active
61
billing account linked (required even when using
62
[Google Cloud Free Tier](https://docs.cloud.google.com/free/docs/free-cloud-features.md.txt)
63
resources).
64
- **Authentication**: Authenticate your environment for CLI execution
65
(`gcloud auth login`), application/MCP SDKs
66
(`gcloud auth application-default login`), or service account credentials
67
(`GOOGLE_APPLICATION_CREDENTIALS`).
68
- **Project Selection & API Enablement**: Set the target project and enable the
69
Compute Engine API:
70
```bash
71
gcloud config set project {project_id}
72
gcloud services enable compute.googleapis.com
73
```
74
- **Required IAM Roles**:
75
- **Caller Roles**: `roles/compute.instanceAdmin.v1` (to create and manage
76
instances), `roles/iam.serviceAccountUser` (to attach
77
`{custom_service_account}`), and `roles/mcp.toolUser` when invoking the
78
Compute Engine MCP server.
79
- **IAP SSH/RDP Access for Private (`--no-address`) VMs**: Connecting via
80
`gcloud compute ssh {vm_name} --zone={zone} --tunnel-through-iap` requires
81
`roles/iap.tunnelResourceAccessor` plus a VPC firewall rule allowing TCP
82
`22` (or `3389` for RDP) from IAP's forwarding range `35.235.240.0/20` (see
83
[Use IAP for TCP forwarding](https://docs.cloud.google.com/iap/docs/using-tcp-forwarding.md.txt)).
84
- **Custom VM Service Account Setup**: Fresh projects only contain the default
85
Compute Engine service account. If `{custom_service_account}` does not yet
86
exist, create a dedicated least-privilege service account first (seeking
87
user approval before granting IAM bindings):
88
```bash
89
gcloud iam service-accounts create {sa_name} \
90
--project={project_id} \
91
--display-name="{sa_display_name}"
92
gcloud projects add-iam-policy-binding {project_id} \
93
--member="serviceAccount:{sa_name}@{project_id}.iam.gserviceaccount.com" \
94
--role="roles/logging.logWriter"
95
gcloud projects add-iam-policy-binding {project_id} \
96
--member="serviceAccount:{sa_name}@{project_id}.iam.gserviceaccount.com" \
97
--role="roles/monitoring.metricWriter"
98
```
99
100
---
101
102
## Workflow
103
104
1. **Determine Execution Method & MCP Capability Boundary**:
105
- **Fast Conversational Intake (No Shell Probing on Missing Inputs)**: When a
106
user asks to configure or create a VM without providing mandatory inputs
107
(`project_id`, `vm_name`, `region`/`zone`, or public vs. private
108
networking), **respond immediately after reading `SKILL.md` without running
109
`gcloud config list`, `gcloud --version`, or any shell commands**. Clarify
110
that you can either execute provisioning once confirmed (Automated
111
Execution) or provide copy-pasteable `gcloud` commands / JSON payloads
112
(Manual Execution), recommend a sizing tier, and ask for the missing inputs
113
in a single turn.
114
- **MCP vs. `gcloud` Routing Rule**: Compute Engine MCP discovery tools
115
(`list_instances`, `get_instance_basic_info`, `list_machine_types`,
116
`list_accelerator_types`, `list_images`, `get_zone_operation`) are ideal
117
for read-only inspection. However, MCP `create_instance`
118
(`McpCreateInstanceRequest`) accepts **only eight flat top-level fields**
119
(`project`, `zone`, `name`, bare `machineType`, `imageProject`,
120
`imageFamily`, `guestAccelerators`, `maintenancePolicy`) and hardcodes
121
`global/networks/default` without `--no-address`, custom subnets, custom
122
service accounts, Shielded VM flags, OS Login, Spot scheduling, or custom
123
disk sizes/types. **Route all hardened (`--no-address`, custom
124
`--subnet={subnet}`, `{custom_service_account}`, Shielded VM, OS Login),
125
Spot, custom-disk, 4th-gen Hyperdisk, and bare metal (`-metal`) creations
126
to `gcloud compute instances create` (or REST `instances.insert`)** rather
127
than dropping security guardrails to fit `create_instance`. Use MCP
128
`create_instance` only for default-VPC prototyping when default disk and
129
service-account settings are explicitly acceptable.
130
2. **Gather Mandatory Inputs**: **ALWAYS** ask the user for any missing inputs:
131
- **Project ID** (Ask directly if not provided in the prompt).
132
- **VM Name** (Offer a friendly default suggestion if unsure, e.g.,
133
`my-first-web-server`).
134
- **Region & Zone** (Explain *why* simply: *"Choosing a location closer to
135
you or your users reduces latency and makes things load faster."* Recommend
136
`us-central1` / `us-central1-a` if the user has no preference, and consult
137
[Regions and zones](https://docs.cloud.google.com/compute/docs/regions-zones.md.txt),
138
[GPU regions and zones](https://docs.cloud.google.com/compute/docs/regions-zones/gpu-regions-zones.md.txt),
139
or [Google Cloud locations](https://cloud.google.com/about/locations) only
140
when verifying non-default regional availability):
141
```bash
142
gcloud config set compute/region {region}
143
gcloud config set compute/zone {zone}
144
```
145
3. **Conversational Triage (Sizing, Generation & OS)**: Map the user's workload
146
to the **Intent-Based Sizing Tiers** and hardware generation defaults:
147
- **Default OS images**: Use `debian-12` (`debian-cloud`) for `E2`, `N2`,
148
`C3` virtualized, and `C2D`; use `debian-13` (`debian-cloud`) for 4th-gen
149
(`C4`, `N4`, `X4`) and bare metal (`c3-standard-192-metal`,
150
`c4-standard-288-metal`, where `debian-12` is unsupported); use
151
`debian-13-arm64` (or `debian-12-arm64`) for Google Axion Arm64 VMs
152
(`N4A`, `C4A`) and `debian-13-arm64` for Arm `C4A` bare metal
153
(`c4a-highmem-96-metal`, where `IDPF` requires Debian 13); and use
154
`common-cu129-ubuntu-2404-nvidia-580` (`deeplearning-platform-release`) for
155
`G2` GPUs. Consult
156
[Arm instances on Compute](https://docs.cloud.google.com/compute/docs/instances/arm-on-compute.md.txt),
157
[Operating system details](https://docs.cloud.google.com/compute/docs/images/os-details.md.txt),
158
and
159
[Bare metal instances](https://docs.cloud.google.com/compute/docs/instances/bare-metal-instances.md.txt)
160
only when selecting Arm64, non-default OS images, or bare metal SKUs.
161
- **Storage by generation**: Use `hyperdisk-balanced` on 4th-gen (`C4`, `N4`,
162
`N4A`, `C4A`, `C4D`, `M4`, `X4`, `A4`) and bare metal (`-metal`) instances
163
where `pd-*` disks are rejected (`N4` supports `hyperdisk-balanced` and
164
`hyperdisk-throughput`, `N4A` supports `hyperdisk-balanced`,
165
`hyperdisk-balanced-high-availability`, and `hyperdisk-throughput` —
166
neither supports `hyperdisk-extreme`, and `N4A` does not support Local
167
SSD; `C4A` also supports `hyperdisk-extreme` and optional `-lssd` Local
168
SSD; `H3` supports `pd-balanced` and `hyperdisk-balanced`). Consult the
169
*"Machine series support for Hyperdisk"* section of
170
[About Google Cloud Hyperdisk](https://docs.cloud.google.com/compute/docs/disks/hyperdisks.md.txt)
171
only for non-default disk types.
172
4. **Determine Network Accessibility & Subnet**: **ALWAYS** ask in plain,
173
non-technical language whether the VM needs to be reachable from the public
174
internet or kept private, noting that private networking (`--no-address`) is
175
the security best practice—even when hosting a website or web app. Use
176
`--subnet={subnet}` (verifying whether a custom/Shared VPC subnet or
177
`default` VPC exists, since many enterprise projects enforce
178
`constraints/compute.skipDefaultNetworkCreation`).
179
5. **Configure Security, OS Login & Service Accounts**: Enable IAM-governed SSH
180
via `--metadata=enable-oslogin=TRUE`, recommend a custom least-privilege
181
service account (`{custom_service_account}`), and enable Shielded VM flags
182
(`--shielded-secure-boot`, `--shielded-vtpm`,
183
`--shielded-integrity-monitoring`) on virtualized VMs (on standard x86
184
`-metal` bare metal instances, pass `--no-shielded-secure-boot` and omit
185
vTPM/integrity flags).
186
6. **Summarize & Confirm (Mode-Aware)**: Present a clear summary of the proposed
187
VM configuration, cost profile, and architectural warnings:
188
- **Automated Execution Mode**: **Always** ask for explicit user confirmation
189
before executing any mutating provisioning command or tool call (e.g.,
190
*"Would you like me to proceed with provisioning this configuration, or
191
adjust any settings first?"*).
192
- **Manual / `"Do not execute"` Mode**: Instruct the user to review and
193
substitute any `{snake_case}` placeholders (such as `{subnet}` or
194
`{custom_service_account}`) before running the command in their terminal;
195
do **not** offer to execute provisioning when tools are disconnected or
196
execution was forbidden.
197
7. **Execute or Deliver Payloads**:
198
- **Automated**: Execute `gcloud compute instances create` (prefixed with
199
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION` per
200
[Usage Attribution](references/attribution.md)) for hardened/Spot/4th-gen/
201
bare-metal configurations, or call MCP `create_instance` for default-VPC
202
prototyping, tracking progress via `get_zone_operation` and verifying via
203
`get_instance_basic_info`.
204
- **Manual**: Output formatted, copy-pasteable `gcloud` CLI commands (without
205
`--quiet` or attribution prefixes) or JSON payloads with clear
206
instructions.
207
8. **Verify, Deliver Next Steps & Teardown Guidance**: Provide post-provisioning
208
access steps (for example, via `--tunnel-through-iap` with `gcloud compute
209
ssh`) and **always** include teardown instructions (omitting `--quiet` so
210
interactive confirmation prevents accidental data loss; see
211
[Delete a VM](https://docs.cloud.google.com/compute/docs/instances/deleting-instance.md.txt)):
212
```bash
213
gcloud compute instances delete {vm_name} --zone={zone} --delete-disks=all
214
```
215
Remind the user to pass `--delete-disks=all` (or `--keep-disks=all` if
216
retaining data) so persistent disks are not orphaned.
217
218
---
219
220
## Intent-Based Sizing Tiers
221
222
If a user says "I want to create a VM" or is unsure of hardware specs, use this
223
table to recommend a tier. Point users to
224
[Google Cloud pricing](https://cloud.google.com/pricing) and
225
[Compute Engine pricing](https://cloud.google.com/compute/all-pricing) for
226
current regional rates (custom machine types across supported series carry a
227
small premium over predefined shapes; see
228
[Custom machine types](https://docs.cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type.md.txt))
229
rather than quoting hardcoded dollar figures or percentages.
230
231
| **Conversational Tier** | **Best For...** | **Underlying Machine** | **Boot Disk (Default)** | **Cost Profile** |
232
| --- | --- | --- | --- | --- |
233
| **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) |
234
| **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)) |
235
| **Powerhouse Tier** *(Heavy Processing & Arm64 Price-Performance)* | "I have heavy data pipelines," "I'm compiling large codebases," "I want Arm64 / Axion price-performance." | 3rd-gen General-purpose `c3-standard-4` or `n2-standard-4` (4th-gen `c4-standard-4` / `n4-standard-4` / Google Axion Arm64 `n4a-standard-4` [customizable up to 64 vCPUs] or `c4a-standard-4` [up to 72 vCPUs]; 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`/`N4A`/`C4A`) | **Premium** (Pay-as-you-go) |
236
| **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` / Arm Axion `c4a-highmem-96-metal` | 100 GB `pd-balanced` (`G2`) or 200 GB `hyperdisk-balanced` (`-metal` / 4th-gen `A4`) | **High** (Requires GPU or dedicated bare-metal CPU quota) |
237
238
> **Rule:** Default to the Standard Tier (`e2-standard-2` with a 30 GB
239
> `pd-balanced` boot disk) unless the user has specific requirements that other
240
> tiers or sizes satisfy. When a workload maps to a tier without an explicit
241
> vCPU/RAM count, **always use the baseline machine type listed in the table**
242
> (`e2-micro` or `e2-small` for Starter; `e2-standard-2` [or `e2-medium` /
243
> `e2-standard-4` when justified] for Standard; `c3-standard-4` or
244
> `n2-standard-4` for 3rd-gen Powerhouse, `c4-standard-4` / `n4-standard-4` for
245
> 4th-gen x86, `n4a-standard-4` for general-purpose Arm64 / Axion, or
246
> `c2d-standard-4` for Compute-optimized; `g2-standard-4` for L4 GPU) rather
247
> than upsizing to `-8` or `-16`.
248
249
---
250
251
## Conversational Guidelines (How to Talk to Users)
252
253
### 1. Early Fork: Establishing Execution Mode
254
255
At the start of an interactive session, state whether execution is automated
256
(provisioning after confirmation via `gcloud` / Compute Engine MCP) or guided
257
(outputting copy-pasteable `gcloud` commands or JSON payloads for Cloud Shell or
258
terminal)—**without running `gcloud config list` or shell commands while
259
mandatory inputs are still missing**.
260
261
### 2. Handling Simple Requests (e.g., "Create a VM" or "Host a Small Website")
262
263
Do not overwhelm beginners with block-storage IOPS or CPU architecture jargon,
264
and **do not run terminal commands before the user answers**. Clarify execution
265
mode, recommend the **Standard Tier (Golden Path)** baseline (`e2-standard-2` or
266
`e2-medium` with a **30 GB `pd-balanced` boot disk**), and **always** ask for
267
all four required inputs in your first response:
268
269
1. **Google Cloud Project ID**
270
2. **VM Name** (e.g., `my-first-web-server`)
271
3. **Region or Zone** (explaining that a location closer to users lowers network
272
latency and makes pages load faster; suggest `us-central1` / `us-central1-a`
273
if unsure)
274
4. **Public Internet vs. Private Networking** (in plain language: *"Does this VM
275
need to be reachable from the public internet, or should we keep it private?
276
Keeping it private is our default security best practice—even for websites,
277
please confirm which you prefer."*)
278
279
### 3. Clear Cost, Quota & Resource Availability Guidance
280
281
- Warn clearly before provisioning **Powerhouse**, **GPU**, or **Bare Metal**
282
instances that specialized hardware and large `pd-ssd` / Hyperdisk volumes
283
accumulate costs quickly (disks bill continuously while stopped) and require
284
sufficient regional CPU/GPU quota.
285
- If VM provisioning fails with `ZONE_RESOURCE_POOL_EXHAUSTED` (or
286
`ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS`), explain that this is a physical
287
zonal hardware supply shortage that **a project quota increase will not fix**.
288
Consult
289
[Troubleshoot resource availability errors](https://docs.cloud.google.com/compute/docs/troubleshooting/troubleshooting-resource-availability.md.txt)
290
and guide the user to try another zone in the region (e.g., `us-central1-b` or
291
`us-central1-c`), adjust machine series/size, or use Compute Engine
292
reservations.
293
294
---
295
296
## Best Practices & Hardening Rules
297
298
### Security & Networking
299
300
1. **Private-by-Default (`--no-address`)**: Default to `--no-address` on custom
301
or verified `--subnet={subnet}` subnets, using Cloud NAT for outbound egress
302
and Identity-Aware Proxy (IAP) TCP forwarding (`35.235.240.0/20`, TCP `22` /
303
`3389`, `roles/iap.tunnelResourceAccessor`; see
304
[Use IAP for TCP forwarding](https://docs.cloud.google.com/iap/docs/using-tcp-forwarding.md.txt))
305
for SSH/RDP.
306
2. **OS Login (`--metadata=enable-oslogin=TRUE`)**: Enable OS Login so SSH
307
access is tied to IAM roles rather than project-wide static SSH keys.
308
3. **Custom Service Accounts**: Never use the default Compute Engine service
309
account; attach `{custom_service_account}` with least-privilege IAM roles.
310
4. **Shielded VMs**: Enable `--shielded-secure-boot`, `--shielded-vtpm`, and
311
`--shielded-integrity-monitoring` on all virtualized VMs (omit vTPM/integrity
312
and set `--no-shielded-secure-boot` on standard x86 `-metal` bare metal).
313
314
### Cost Optimization & Reliability
315
316
1. **Right-Sizing & Free Tier Accuracy**: Use `e2-micro` (`us-west1`,
317
`us-central1`, or `us-east1` only, 1 non-preemptible instance/month, up to
318
30 GB `pd-standard`, with an active billing account still required on the
319
Google Cloud project; see
320
[Google Cloud Free Tier](https://docs.cloud.google.com/free/docs/free-cloud-features.md.txt))
321
for Free Tier eligibility, or `e2-medium` for light dev/test workloads.
322
2. **Spot VMs**: Offer Spot VMs (`--provisioning-model=SPOT`,
323
`--instance-termination-action=DELETE` [or `STOP`],
324
`--maintenance-policy=TERMINATE`, `--no-restart-on-failure`; see
325
[Create and use Spot VMs](https://docs.cloud.google.com/compute/docs/instances/create-use-spot.md.txt))
326
for stateless, fault-tolerant batch workloads to achieve significant
327
discounts compared to standard instances (see
328
[Compute Engine pricing](https://cloud.google.com/compute/all-pricing)).
329
3. **Storage & Host Maintenance**: Default 3rd-gen/E2 boot disks to
330
`pd-balanced` (`hyperdisk-balanced` on 4th-gen and `-metal`), and set
331
`--maintenance-policy=MIGRATE` on standard virtualized VMs (`TERMINATE` on
332
Spot, GPU, and `-metal` instances; see
333
[Handle GPU host maintenance events](https://docs.cloud.google.com/compute/docs/gpus/gpu-host-maintenance.md.txt)).
334
335
---
336
337
## Technical Reference Templates
338
339
Every row below summarizes the complete `gcloud compute instances create` flags
340
(with `{vm_name}`, `--project={project_id}`, and `--zone={zone}`) and 8-field
341
Compute Engine MCP `create_instance` schema for the five standard VM templates.
342
Consult [Technical Reference Templates](references/templates.md) when full
343
multi-line examples or additional template context are needed, and always read
344
[Usage Attribution](references/attribution.md) before executing any live
345
`gcloud`, REST API, or MCP command:
346
347
| **Template** | **Complete `gcloud compute instances create {vm_name} --project={project_id} --zone={zone}` Flags** | **MCP `create_instance` Routing & Schema** | **Required Warnings** |
348
| --- | --- | --- | --- |
349
| **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`. |
350
| **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**—Compute 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`. |
351
| **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`; for **Google Axion Arm64 `n4a-standard-4` / `c4a-standard-4`**, use `debian-13-arm64` [or `debian-12-arm64`], `nic-type=GVNIC`, and `hyperdisk-balanced`) | Default-VPC 3rd-gen prototyping only (`"machineType": "c3-standard-4"`); route custom-disk, 4th-gen Hyperdisk, Arm64 Axion, and private-subnet deploys to `gcloud`. | Warn about continuous `pd-ssd`/Hyperdisk storage billing, 4th-gen Hyperdisk requirement (`pd-*` rejected on `C4`/`N4`/`N4A`/`C4A`; `N4A` does not support `hyperdisk-extreme` or Local SSD), 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). |
352
| **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`). |
353
| **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` on standard x86 `-metal`; `c4a-highmem-96-metal` uses `debian-13-arm64` and supports `--shielded-vtpm`) | **CLI/REST only**—unsupported 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. |
354
355
---
356
357
## Instructions & Guardrails
358
359
- **EARLY EXECUTION FORK & MCP BOUNDARY**: Never pass unsupported REST fields
360
(`instance`, `disks`, `networkInterfaces`, `serviceAccounts`,
361
`shieldedInstanceConfig`, `scheduling`) or prefixed machine URIs
362
(`zones/{zone}/machineTypes/...`) to MCP `create_instance`, and always route
363
hardened (`--no-address`, custom subnet, custom SA, Shielded VM, OS Login),
364
Spot, custom-disk, 4th-gen, and `-metal` creations to
365
`gcloud compute instances create`.
366
- **FAST CONVERSATIONAL INTAKE (NO SHELL COMMANDS ON MISSING INPUTS)**: When any
367
mandatory input (**Project ID**, **VM name**, **region/zone**, or **public vs.
368
private networking**) is missing from the user's prompt, ask for all missing
369
inputs directly in your first reply (explaining regional latency benefits and
370
recommending private networking) **without running `gcloud config list`,
371
`gcloud --version`, or any shell discovery commands first**.
372
- **PUBLIC IP REMEDIATION CHECKLIST**: Whenever a user requests a public IP or
373
direct internet SSH exposure:
374
1. Warn clearly about public internet scanners and SSH/RDP brute-force risks.
375
2. Recommend **both** **Identity-Aware Proxy (IAP) TCP forwarding**
376
(`35.235.240.0/20`, `roles/iap.tunnelResourceAccessor`) for SSH/RDP **and**
377
**Cloud NAT** for outbound internet access with `--no-address`.
378
3. Include `--metadata=enable-oslogin=TRUE` and all three **Shielded VM**
379
flags (`--shielded-secure-boot`, `--shielded-vtpm`,
380
`--shielded-integrity-monitoring`) on virtualized VMs.
381
4. Recommend a **custom, least-privilege service account** instead of the
382
default Compute Engine service account.
383
- **ACCURATE DAY-0 MUTABILITY WARNINGS**: Explain accurately that:
384
- **Disks**: Persistent Disks and Hyperdisks cannot shrink in-place, and
385
changing disk type requires creating a new disk from a snapshot and swapping
386
it on a stopped VM (`detach-disk` / `attach-disk --boot`) without
387
recreating the VM instance.
388
- **Networking & Renaming**: Stopped (`TERMINATED`) standalone IPv4 VMs can
389
migrate VPC/subnet in-place (`gcloud compute instances network-interfaces
390
update`; only NIC count `nic1+` is fixed at creation) and can be renamed
391
in-place via `gcloud compute instances set-name` with `--new-name` and
392
`--zone`
393
(see [Rename a VM](https://docs.cloud.google.com/compute/docs/instances/rename-instance.md.txt)
394
and [Update instance properties](https://docs.cloud.google.com/compute/docs/instances/update-instance-properties.md.txt)).
395
- **True VM Recreation**: Properties requiring full **VM recreation** are
396
**zone**, **CPU architecture** (`x86_64` vs. `ARM64`), and
397
**Encrypted-Memory VM (AMD SEV-SNP or Intel TDX)** enablement.
398
- **4TH-GEN & BARE METAL HARDWARE CONSTRAINTS**: Never pair `pd-*` disks with
399
4th-generation (`C4`, `N4`, `N4A`, `C4A`, `C4D`, `M4`, `X4`, `A4`, which
400
require `hyperdisk-balanced` and `nic-type=GVNIC`; `N4` and `N4A` support
401
`hyperdisk-balanced` and `hyperdisk-throughput`, not `hyperdisk-extreme`, and
402
`N4A` does not support Local SSD; Google Axion Arm64 `N4A`/`C4A` require Arm64
403
images such as `debian-13-arm64` or `debian-12-arm64`, and switching CPU
404
architecture requires recreating the VM) or bare metal (`-metal`) instances.
405
Whenever recommending or generating a bare metal (`-metal`) configuration
406
(`C3-metal`, `C4-metal`, Arm Axion `c4a-highmem-96-metal`), **always
407
explicitly state in your reply** that: (1) `pd-*` disks are unsupported
408
(`hyperdisk-balanced` is mandatory), (2) `debian-13` (or `debian-13-arm64` for
409
`c4a-highmem-96-metal`) is required because `debian-12` lacks `IDPF` and is
410
unsupported on `C3-metal`, `C4-metal`, and `X4`, (3)
411
`--network-interface=subnet={subnet},no-address,nic-type=IDPF` is required
412
without conflicting top-level `--subnet` or `--no-address` flags (because
413
`GVNIC` and `VIRTIO_NET` are unsupported on `-metal`), and (4)
414
`--maintenance-policy=TERMINATE` and `--metadata=enable-oslogin=TRUE` are
415
required (pass `--no-shielded-secure-boot` and omit `--shielded-vtpm` on
416
standard x86 `-metal`; `c4a-highmem-96-metal` supports vTPM on bare metal).
417
- **MANDATORY GPU & SPECIALIZED HARDWARE WARNINGS**: Whenever recommending or
418
generating a GPU (`G2`, `A3`, `A4`), bare metal (`-metal`), or
419
high-performance VM configuration (including in `"Do not execute"` or MCP JSON
420
comparisons), **always** explicitly include in your reply: (1) a warning about
421
**high GPU or dedicated-host hourly compute costs**, (2) a reminder to
422
**verify regional GPU/CPU quota** in the target project, and (3) that **GPU
423
and bare metal instances do not support live migration**
424
(`--maintenance-policy=TERMINATE` is mandatory).
425
- **HANDLE `ZONE_RESOURCE_POOL_EXHAUSTED`**: Explain that zonal capacity errors
426
are physical hardware shortages (not fixable via quota increases) and guide
427
users to alternate zones, alternate machine series, or reservations per
428
[Troubleshoot resource availability errors](https://docs.cloud.google.com/compute/docs/troubleshooting/troubleshooting-resource-availability.md.txt).
429
- **FREE TIER ELIGIBILITY & BILLING ACCOUNT REQUIREMENT**: Whenever a user asks
430
about Google Cloud Free Tier eligibility for Compute Engine, always explicitly
431
state all four requirements in your reply: (1) only one non-preemptible
432
`e2-micro` instance per month is covered (`e2-small` and larger are billed),
433
(2) only in `us-west1`, `us-central1`, or `us-east1`, (3) up to 30 GB of
434
`pd-standard` Standard Persistent Disk (`pd-balanced` and `pd-ssd` are
435
billed), and (4) an **active billing account is still required on the Google
436
Cloud project** even for Free Tier usage.
437
- **ALWAYS INCLUDE SAFE TEARDOWN COMMANDS**: Always provide
438
`gcloud compute instances delete {vm_name} --zone={zone} --delete-disks=all`
439
(omitting `--quiet` on all copy-pasteable manual `create` and `delete`
440
commands) so users can prevent orphaned compute and disk charges safely.
441
- **MODE-AWARE CONFIRMATION**: Require explicit user confirmation before
442
executing provisioning in **Automated Execution** mode; in **Manual / `"Do not
443
execute"`** mode, prompt the user to review `{snake_case}` placeholders and
444
flags before running the command themselves rather than offering to execute
445
it.
446

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 11,558 prompts

More by @OpenSourceBuffGuy

See all
Airflow DAG Patterns prompt image

Airflow DAG Patterns

Teaches an AI coding agent to build production Apache Airflow DAGs with sound operators, sensors, dependencies, testing and deployment patterns for data pipelines.

agent-skill, airflow, data-engineering, python, best-practices, code-generation, workflow-automation, testing, deployment, debugging, for-developers, for-data-analysts, code, structured-output, advanced, long-form, backend, devops, scheduled-prompt, observability

Color Pop Interlocked Marker Type prompt image

Color Pop Interlocked Marker Type

Defines a JSON style system for playful two-word posters made of irregular interlocking hand-drawn colored letters with black contours and sparse doodles on warm paper.

image-prompt, json-prompt, template, placeholders, structured-output, poster, typography, doodle, illustration, vibrant-colors, text-rendering, vertical-format, widescreen, long-form, advanced, for-designers, for-artists, whimsical, graphic-design, cartoon

macOS Golden Gate Design prompt image

macOS Golden Gate Design

Guides an AI to design and build native macOS interfaces in SwiftUI or AppKit with flat panes, native toolbars and restrained glass, avoiding nested cards.

agent-skill, swiftui, swift, macos, ui-ux, design-systems, accessibility, best-practices, audit, figma, for-designers, for-developers, desktop-app, refactoring, code-review, long-form, advanced, style-guide, code

Reviews

Loading reviews…

Discussion

Loading comments…