easygcloud

Delete a VM from the wrong zone, update the default zone, and recreate it

command

gcloud compute instances delete web-server --zone=us-east1-b && gcloud config set compute/zone us-central1-a && gcloud compute instances create web-server

Command breakdown

Part of the Google Cloud CLI (gcloud) — Compute Engine category.

gcloudcomputeinstancesdeleteweb-server--zone=us-east1-b&&gcloudconfigsetcompute/zoneus-central1-a&&gcloudcomputeinstancescreateweb-server
FlagPurpose
--zoneSet to: us-east1-b

Test your recall — not just your reading.

Practice with interactive quiz →