Stay organized with collections Save and categorize content based on your preferences.
gcloud alpha compute instances update
INSTANCE_NAME
[--[no-]deletion-protection
] [--[no-]enable-display-device
] [--[no-]graceful-shutdown
] [--graceful-shutdown-max-duration
=GRACEFUL_SHUTDOWN_MAX_DURATION
] [--min-cpu-platform
=PLATFORM
] [--partner-metadata
=[NAMESPACE
/KEY
=VALUE
,…]] [--partner-metadata-from-file
=LOCAL_FILE_PATH
] [--[no-]shielded-integrity-monitoring
] [--shielded-learn-integrity-policy
] [--[no-]shielded-secure-boot
] [--[no-]shielded-vtpm
] [--update-labels
=[KEY
=VALUE
,…]] [--zone
=ZONE
] [--clear-labels
| --remove-labels
=[KEY
,…]] [--clear-node-affinities
| --node
=NODE
| --node-affinity-file
=PATH_TO_FILE
| --node-group
=NODE_GROUP
] [GCLOUD_WIDE_FLAG …
]
(ALPHA)
gcloud alpha compute instances update
updates labels and requested CPU Platform for a Compute Engine virtual machine.
gcloud alpha compute instances update example-instance --zone=us-central1-a --update-labels=k0=value1,k1=value2 --remove-labels=k3
Labels can be used to identify the instance. To list instances with the 'k1:value2' label, run:
gcloud alpha compute instances list --filter='labels.k1:value2'
To list only the labels when describing a resource, use --format to filter the result:
gcloud alpha compute instances describe example-instance --format="default(labels)"
INSTANCE_NAME
--[no-]deletion-protection
--deletion-protection
to enable and --no-deletion-protection
to disable.
--[no-]enable-display-device
--enable-display-device
to enable and --no-enable-display-device
to disable.
--[no-]graceful-shutdown
--graceful-shutdown
to enable and --no-graceful-shutdown
to disable.
--graceful-shutdown-max-duration
=GRACEFUL_SHUTDOWN_MAX_DURATION
--min-cpu-platform
=PLATFORM
gcloud alpha compute zones describe ZONE --format="value(availableCpuPlatforms)"
Default setting is "AUTOMATIC".
CPU platform selection is available only in selected zones.
You can find more information on-line: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform
--partner-metadata
=[NAMESPACE
/KEY
=VALUE
,…]
--partner-metadata-from-file
=LOCAL_FILE_PATH
--[no-]shielded-integrity-monitoring
gcloud compute instances update --shielded-learn-integrity-policy
. On Shielded VM instances, integrity monitoring is enabled by default. For information about how to modify Shielded VM options, see https://cloud.google.com/compute/docs/instances/modifying-shielded-vm. For information about monitoring integrity on Shielded VM instances, see https://cloud.google.com/compute/docs/instances/integrity-monitoring." Changes to this setting with the update command only take effect after stopping and starting the instance. Use --shielded-integrity-monitoring
to enable and --no-shielded-integrity-monitoring
to disable.
--shielded-learn-integrity-policy
--[no-]shielded-secure-boot
--shielded-secure-boot
to enable and --no-shielded-secure-boot
to disable.
--[no-]shielded-vtpm
--shielded-vtpm
to enable and --no-shielded-vtpm
to disable.
--update-labels
=[KEY
=VALUE
,…]
Keys must start with a lowercase character and contain only hyphens (-
), underscores (_
), lowercase characters, and numbers. Values must contain only hyphens (-
), underscores (_
), lowercase characters, and numbers.
--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
--clear-labels
--update-labels
is also specified then --clear-labels
is applied first.
For example, to remove all labels:
gcloud alpha compute instances update --clear-labels
To remove all existing labels and create two new labels,
and foo
:baz
gcloud alpha compute instances update --clear-labels --update-labels foo=bar,baz=qux
--remove-labels
=[KEY
,…]
--update-labels
is also specified then --update-labels
is applied first.
At most one of these can be specified:
--clear-node-affinities
--node
=NODE
--node-affinity-file
=PATH_TO_FILE
The file should contain a list of a JSON/YAML objects. For an example, see https://cloud.google.com/compute/docs/nodes/provisioning-sole-tenant-vms#configure_node_affinity_labels. The following list describes the fields:
key
operator
IN
: Requires Compute Engine to seek for matched nodes. NOT_IN
: Requires Compute Engine to avoid certain nodes.
values
Use a full or relative path to a local file containing the value of node_affinity_file.
--node-group
=NODE_GROUP
--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 update
gcloud beta compute instances update
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