/cloud-plugin:gcp-throwaway-vmfrom cloud-plugin
Creates throwaway GCE VMs in isolated projects for benchmarks and tests, with budget alerts, zone fallback, and guaranteed teardown via project deletion.
Ships in cloud-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Rent one or more Compute Engine VMs for a benchmark or test that needs a specific kernel, filesystem or core count, run it, and leave nothing billing afterwards. The numbered sections are the order that worked; the traps are the places it broke. Full scripts are in REFERENCE.md.
Create a dedicated project and delete it at the end. Project deletion is the teardown backstop: it removes any VM, disk, address or firewall rule you missed.
A=--account=<[email protected]>; P=<bench-project-id>
gcloud projects create "$P" "$A"
BA=$(gcloud billing projects describe <existing-project> "$A" --format='value(billingAccountName)')
gcloud billing projects link "$P" --billing-account="${BA#billingAccounts/}" "$A"
gcloud services enable compute.googleapis.com --project="$P" "$A"
Pass --account (and --project) on every command instead of
gcloud config set account or switching configurations. The active
configuration may belong to another account (e.g. work) and stays untouched;
confirm with gcloud config list at the end.
gcloud billing budgets create/delete need --billing-project=<p> pointing at
a project with billingbudgets.googleapis.com enabled. If that project is the
throwaway one and it is deleted first, budgets delete then fails with
SERVICE_DISABLED or PERMISSION_DENIED from every other project, and the
budget is orphaned on the billing account.
budgets list | grep whose list call failed is not proof
of deletion. Check the command's exit status and stderr
(agent-patterns-plugin:tool-result-traps).A new project's limits are lower than the regional numbers suggest:
gcloud compute project-info describe --project="$P" "$A" --format=json | jq '.quotas[] | select(.metric=="CPUS_ALL_REGIONS")'
gcloud compute regions describe europe-north1 --project="$P" "$A" --format=json | jq '.quotas[] | select(.metric=="CPUS" or .metric=="SSD_TOTAL_GB")'
Observed 2026-10 on a new personal project: CPUS_ALL_REGIONS 32, regional
CPUS 200, SSD_TOTAL_GB 500. The global 32 is the binding limit.
ZONE_RESOURCE_POOL_EXHAUSTED is routine for mid-size machine types (seen for
n2-standard-8 in europe-north1-a). Loop over the region's zones and stop at
the first success. Write the multi-step creation as a bash script, not a
one-liner: in zsh, set -- $var and $GC_FLAGS do not word-split
(tools-plugin:zsh-gotchas). See REFERENCE.md § Create.
A data disk created with
--create-disk=name=<vm>-data,size=100GB,type=pd-ssd,auto-delete=yes,device-name=data
appears in the guest as /dev/disk/by-id/google-data, a stable path for
mkfs/mount in the test script. auto-delete=yes removes it with the VM.
Image family (--image-project=ubuntu-os-cloud) | Boots (2026-10) |
|---|---|
ubuntu-2204-lts | 6.8.0-*-gcp |
ubuntu-2404-lts-amd64 | 7.0.0-*-gcp |
debian-11, ubuntu-2004 | retired, "not found" |
Check what exists before scripting:
gcloud compute images list --filter='family~ubuntu' --format='value(family)' | sort -u.
To test on an older kernel line (e.g. 5.15 on 22.04), install the GCP
flavour: linux-image-gcp-lts-22.04 gave 5.15.0-1120-gcp. The generic
linux-image-generic 5.15 panics at boot:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
GCP Ubuntu images boot without an initrd, and the generic kernel builds its
disk drivers as modules. Select the kernel with GRUB_DEFAULT=saved in
/etc/default/grub and every /etc/default/grub.d/*.cfg (read after
/etc/default/grub, so a value there overrides it), update-grub, then
grub-set-default "Advanced options for Ubuntu>Ubuntu, with Linux <ver>".
Script: REFERENCE.md § Older kernel.
Reboot as its own step and confirm: a reboot chained with && after the setup
script did not happen. Check uname -r and uptime -s afterwards. When the VM
never comes back, read the serial console; that is where the 5.15 panic showed:
gcloud compute instances get-serial-port-output <vm> --zone=<z> --project="$P" "$A" | grep -E 'Linux version|Kernel panic'
The first gcloud compute ssh after it generates a key can exit 255 while the
key propagates. Retry in an until loop with a bound rather than a fixed
sleep; use the same loop after a reboot (REFERENCE.md § Wait for SSH).
gcloud compute instances delete ... --quiet).instances, disks, addresses and snapshots lists are empty,
and that each list call exited 0.gcloud projects delete "$P" "$A" --quiet. The project then sits in
DELETE_REQUESTED for 30 days (gcloud projects describe "$P" "$A" --format='value(lifecycleState)').gcloud config list: active account and project unchanged.Distribution packages can be too old for the test: Ubuntu 22.04's apt
hyperfine is 1.12 and has no -N. Install a current one with
cargo install --locked hyperfine when the flag is needed.
Observed 2026-10 (filesystem benchmarks on two n2-standard-8 VMs with a
100 GB pd-ssd data disk each, ~1.5 h, personal account): the traps in this
skill come from that run. Cost was not measured.
| Context | Command |
|---|---|
| Machine types in a zone | gcloud compute machine-types list --zones=<z> --filter='name=n2-standard-8' --project="$P" "$A" --format='value(name)' |
| VM state | gcloud compute instances list --project="$P" "$A" --format='value(name,zone.basename(),status)' |
| Leftover resources | gcloud compute disks list --project="$P" "$A" --format='value(name)' (also addresses, snapshots) |
| Booted kernel | gcloud compute ssh <vm> --zone=<z> --project="$P" "$A" --command='uname -r; uptime -s' |
| Project state | gcloud projects describe "$P" "$A" --format='value(lifecycleState)' |
tools-plugin:zsh-gotchas: why the creation steps go in a bash scriptagent-patterns-plugin:tool-result-traps: an empty result from a failed list commandterraform-plugin:infrastructure-terraform: for VMs that outlive one test runWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub laurigates/claude-plugins --plugin cloud-pluginOther plugins' skills for the same job