Stay organized with collections Save and categorize content based on your preferences.
gcloud alpha compute instances set-machine-type
INSTANCE_NAME
[--machine-type
=MACHINE_TYPE
] [--zone
=ZONE
] [--custom-cpu
=CUSTOM_CPU
--custom-memory
=CUSTOM_MEMORY
: --custom-extensions
--custom-vm-type
=CUSTOM_VM_TYPE
] [GCLOUD_WIDE_FLAG …
]
(ALPHA)
gcloud alpha compute instances set-machine-type
lets you change the machine type of a virtual machine in the TERMINATED
state (that is, a virtual machine instance that has been stopped).
For example, if
is a example-instance
virtual machine currently in the g1-small
TERMINATED
state, running:
gcloud alpha compute instances set-machine-type example-instance --zone us-central1-b --machine-type n1-standard-4
will change the machine type to
, so that when you next start n1-standard-4
, it will be provisioned as an example-instance
instead of a n1-standard-4
.g1-small
See https://cloud.google.com/compute/docs/machine-types for more information on machine types.
n1-standard-4
, run:
gcloud alpha compute instances set-machine-type example-instance --zone=us-central1-b --machine-type=n1-standard-4
INSTANCE_NAME
--machine-type
=MACHINE_TYPE
--zone
=ZONE
gcloud
attempts to identify the appropriate zone by searching for resources in your currently active project. If the zone cannot be determined, gcloud
prompts you for a selection with all available Google Cloud Platform zones.
To avoid prompting when this flag is omitted, the user can set the
property:compute/zone
gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
gcloud compute zones list
To unset the property, run:
gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE
--custom-cpu
=CUSTOM_CPU
For some machine types, shared-core values can also be used. For example, for E2 machine types, you can specify micro
, small
, or medium
.
This flag argument must be specified if any of the other arguments in this group are specified.
--custom-memory
=CUSTOM_MEMORY
This flag argument must be specified if any of the other arguments in this group are specified.
--custom-extensions
--custom-vm-type
=CUSTOM_VM_TYPE
n1
. For more information about custom machine types, see: https://cloud.google.com/compute/docs/general-purpose-machines#custom_machine_types
--access-token-file
, --account
, --billing-project
, --configuration
, --flags-file
, --flatten
, --format
, --help
, --impersonate-service-account
, --log-http
, --project
, --quiet
, --trace-token
, --user-output-enabled
, --verbosity
.
Run $ gcloud help
for details.
gcloud compute instances set-machine-type
gcloud beta compute instances set-machine-type
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-07 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4