HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/help/man/man1/gcloud_compute_instances_update.1
.TH "GCLOUD_COMPUTE_INSTANCES_UPDATE" 1



.SH "NAME"
.HP
gcloud compute instances update \- update a Compute Engine virtual machine



.SH "SYNOPSIS"
.HP
\f5gcloud compute instances update\fR \fIINSTANCE_NAME\fR [\fB\-\-[no\-]deletion\-protection\fR] [\fB\-\-[no\-]enable\-display\-device\fR] [\fB\-\-min\-cpu\-platform\fR=\fIPLATFORM\fR] [\fB\-\-[no\-]shielded\-integrity\-monitoring\fR] [\fB\-\-shielded\-learn\-integrity\-policy\fR] [\fB\-\-[no\-]shielded\-secure\-boot\fR] [\fB\-\-[no\-]shielded\-vtpm\fR] [\fB\-\-update\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-zone\fR=\fIZONE\fR] [\fB\-\-clear\-labels\fR\ |\ \fB\-\-remove\-labels\fR=[\fIKEY\fR,...]] [\fB\-\-clear\-node\-affinities\fR\ |\ \fB\-\-node\fR=\fINODE\fR\ |\ \fB\-\-node\-affinity\-file\fR=\fIPATH_TO_FILE\fR\ |\ \fB\-\-node\-group\fR=\fINODE_GROUP\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fBgcloud compute instances update\fR updates labels and requested CPU Platform
for a Compute Engine virtual machine.



.SH "EXAMPLES"

To modify the instance 'example\-instance' in 'us\-central1\-a' by adding labels
\'k0', with value 'value1' and label 'k1' with value 'value2' and removing
labels with key 'k3', run:

.RS 2m
$ gcloud compute instances update example\-instance \e
    \-\-zone=us\-central1\-a \-\-update\-labels=k0=value1,k1=value2 \e
    \-\-remove\-labels=k3
.RE

Labels can be used to identify the instance. To list instances with the
\'k1:value2' label, run:

.RS 2m
$ gcloud compute instances list \-\-filter='labels.k1:value2'
.RE

To list only the labels when describing a resource, use \-\-format to filter the
result:

.RS 2m
$ gcloud compute instances describe example\-instance \e
    \-\-format="default(labels)"
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
\fIINSTANCE_NAME\fR

Name of the instance to update. For details on valid instance names, refer to
the criteria documented under the field 'name' at:
https://cloud.google.com/compute/docs/reference/rest/v1/instances


.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-[no\-]deletion\-protection\fR

Enables deletion protection for the instance. Use \fB\-\-deletion\-protection\fR
to enable and \fB\-\-no\-deletion\-protection\fR to disable.

.TP 2m
\fB\-\-[no\-]enable\-display\-device\fR

Enable a display device on VM instances. Use \fB\-\-enable\-display\-device\fR
to enable and \fB\-\-no\-enable\-display\-device\fR to disable.

.TP 2m
\fB\-\-min\-cpu\-platform\fR=\fIPLATFORM\fR

When specified, the VM will be scheduled on host with specified CPU architecture
or a newer one. To list available CPU platforms in given zone, run:

.RS 2m
$ gcloud compute zones describe ZONE \e
  \-\-format="value(availableCpuPlatforms)"
.RE

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

.TP 2m
\fB\-\-[no\-]shielded\-integrity\-monitoring\fR

Enables monitoring and attestation of the boot integrity of the instance. The
attestation is performed against the integrity policy baseline. This baseline is
initially derived from the implicitly trusted boot image when the instance is
created. This baseline can be updated by using \f5gcloud compute instances
update \-\-shielded\-learn\-integrity\-policy\fR. 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 \fB\-\-shielded\-integrity\-monitoring\fR to enable
and \fB\-\-no\-shielded\-integrity\-monitoring\fR to disable.

.TP 2m
\fB\-\-shielded\-learn\-integrity\-policy\fR

Causes the instance to re\-learn the integrity policy baseline using the current
instance configuration. Use this flag after any planned boot\-specific changes
in the instance configuration, like kernel updates or kernel driver
installation.

.TP 2m
\fB\-\-[no\-]shielded\-secure\-boot\fR

The instance boots with secure boot enabled. On Shielded VM instances, Secure
Boot is not enabled by default. For information about how to modify Shielded VM
options, see
https://cloud.google.com/compute/docs/instances/modifying\-shielded\-vm. Changes
to this setting with the update command only take effect after stopping and
starting the instance. Use \fB\-\-shielded\-secure\-boot\fR to enable and
\fB\-\-no\-shielded\-secure\-boot\fR to disable.

.TP 2m
\fB\-\-[no\-]shielded\-vtpm\fR

The instance boots with the TPM (Trusted Platform Module) enabled. A TPM is a
hardware module that can be used for different security operations such as
remote attestation, encryption, and sealing of keys. On Shielded VM instances,
vTPM is enabled by default. For information about how to modify Shielded VM
options, see
https://cloud.google.com/compute/docs/instances/modifying\-shielded\-vm. Changes
to this setting with the update command only take effect after stopping and
starting the instance. Use \fB\-\-shielded\-vtpm\fR to enable and
\fB\-\-no\-shielded\-vtpm\fR to disable.

.TP 2m
\fB\-\-update\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]

List of label KEY=VALUE pairs to update. If a label exists, its value is
modified. Otherwise, a new label is created.

Keys must start with a lowercase character and contain only hyphens (\f5\-\fR),
underscores (\f5_\fR), lowercase characters, and numbers. Values must contain
only hyphens (\f5\-\fR), underscores (\f5_\fR), lowercase characters, and
numbers.

.TP 2m
\fB\-\-zone\fR=\fIZONE\fR

Zone of the instance to update. If not specified, you might be prompted to
select a zone (interactive mode only). \f5gcloud\fR attempts to identify the
appropriate zone by searching for resources in your currently active project. If
the zone cannot be determined, \f5gcloud\fR 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
\f5\fIcompute/zone\fR\fR property:

.RS 2m
$ gcloud config set compute/zone ZONE
.RE

A list of zones can be fetched by running:

.RS 2m
$ gcloud compute zones list
.RE

To unset the property, run:

.RS 2m
$ gcloud config unset compute/zone
.RE

Alternatively, the zone can be stored in the environment variable
\f5\fICLOUDSDK_COMPUTE_ZONE\fR\fR.

.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-clear\-labels\fR

Remove all labels. If \f5\-\-update\-labels\fR is also specified then
\f5\-\-clear\-labels\fR is applied first.

For example, to remove all labels:

.RS 2m
$ gcloud compute instances update \-\-clear\-labels
.RE

To remove all existing labels and create two new labels, \f5\fIfoo\fR\fR and
\f5\fIbaz\fR\fR:

.RS 2m
$ gcloud compute instances update \-\-clear\-labels \e
  \-\-update\-labels foo=bar,baz=qux
.RE

.TP 2m
\fB\-\-remove\-labels\fR=[\fIKEY\fR,...]

List of label keys to remove. If a label does not exist it is silently ignored.
If \f5\-\-update\-labels\fR is also specified then \f5\-\-update\-labels\fR is
applied first.

.RE
.sp
.TP 2m

Sole Tenancy.

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-clear\-node\-affinities\fR

Removes the node affinities field from the instance. If specified, the instance
node settings will be cleared. The instance will not be scheduled onto a
sole\-tenant node.

.TP 2m
\fB\-\-node\fR=\fINODE\fR

The name of the node to schedule this instance on.

.TP 2m
\fB\-\-node\-affinity\-file\fR=\fIPATH_TO_FILE\fR

The JSON/YAML file containing the configuration of desired nodes onto which this
instance could be scheduled. These rules filter the nodes according to their
node affinity labels. A node's affinity labels come from the node template of
the group the node is in.

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:

.RS 2m
.TP 2m
\fBkey\fR
Corresponds to the node affinity label keys of the Node resource.
.TP 2m
\fBoperator\fR
Specifies the node selection type. Must be one of: \f5IN\fR: Requires Compute
Engine to seek for matched nodes. \f5NOT_IN\fR: Requires Compute Engine to avoid
certain nodes.
.TP 2m
\fBvalues\fR
Optional. A list of values which correspond to the node affinity label values of
the Node resource.

Use a full or relative path to a local file containing the value of
node_affinity_file.

.RE
.sp
.TP 2m
\fB\-\-node\-group\fR=\fINODE_GROUP\fR

The name of the node group to schedule this instance on.


.RE
.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-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 \fB$ gcloud help\fR for details.



.SH "NOTES"

These variants are also available:

.RS 2m
$ gcloud alpha compute instances update
.RE

.RS 2m
$ gcloud beta compute instances update
.RE