File: //snap/google-cloud-cli/current/help/man/man1/gcloud_compute_instance-groups_managed_update.1
.TH "GCLOUD_COMPUTE_INSTANCE\-GROUPS_MANAGED_UPDATE" 1
.SH "NAME"
.HP
gcloud compute instance\-groups managed update \- update a Compute Engine managed instance group
.SH "SYNOPSIS"
.HP
\f5gcloud compute instance\-groups managed update\fR \fINAME\fR [\fB\-\-default\-action\-on\-vm\-failure\fR=\fIACTION_ON_VM_FAILURE\fR] [\fB\-\-description\fR=\fIDESCRIPTION\fR] [\fB\-\-[no\-]force\-update\-on\-repair\fR] [\fB\-\-instance\-redistribution\-type\fR=\fITYPE\fR] [\fB\-\-instance\-selection\fR=\fIname\fR=\fINAME\fR,\fImachine\-type\fR=\fIMACHINE_TYPE\fR[,\fImachine\-type\fR=\fIMACHINE_TYPE\fR...][,\fIrank\fR=\fIRANK\fR]] [\fB\-\-instance\-selection\-machine\-types\fR=[\fIMACHINE_TYPE\fR,...]] [\fB\-\-list\-managed\-instances\-results\fR=\fIMODE\fR] [\fB\-\-remove\-instance\-selections\fR=[\fIINSTANCE_SELECTION_NAME\fR,...]] [\fB\-\-remove\-instance\-selections\-all\fR] [\fB\-\-remove\-stateful\-disks\fR=\fIDEVICE_NAME\fR,[\fIDEVICE_NAME\fR,...]] [\fB\-\-remove\-stateful\-external\-ips\fR=\fIINTERFACE_NAME\fR,[...]] [\fB\-\-remove\-stateful\-internal\-ips\fR=\fIINTERFACE_NAME\fR,[...]] [\fB\-\-size\fR=\fISIZE\fR] [\fB\-\-standby\-policy\-initial\-delay\fR=\fISTANDBY_POLICY_INITIAL_DELAY\fR] [\fB\-\-standby\-policy\-mode\fR=\fISTANDBY_POLICY_MODE\fR] [\fB\-\-stateful\-disk\fR=[\fIauto\-delete\fR=\fIAUTO\-DELETE\fR],[\fIdevice\-name\fR=\fIDEVICE\-NAME\fR]] [\fB\-\-stateful\-external\-ip\fR=[\fIenabled\fR],[\fIauto\-delete\fR=\fIAUTO\-DELETE\fR],[\fIinterface\-name\fR=\fIINTERFACE\-NAME\fR]] [\fB\-\-stateful\-internal\-ip\fR=[\fIenabled\fR],[\fIauto\-delete\fR=\fIAUTO\-DELETE\fR],[\fIinterface\-name\fR=\fIINTERFACE\-NAME\fR]] [\fB\-\-stopped\-size\fR=\fISTOPPED_SIZE\fR] [\fB\-\-suspended\-size\fR=\fISUSPENDED_SIZE\fR] [\fB\-\-target\-distribution\-shape\fR=\fISHAPE\fR] [\fB\-\-clear\-autohealing\fR\ |\ \fB\-\-initial\-delay\fR=\fIINITIAL_DELAY\fR\ \fB\-\-health\-check\fR=\fIHEALTH_CHECK\fR\ |\ \fB\-\-http\-health\-check\fR=\fIHTTP_HEALTH_CHECK\fR\ |\ \fB\-\-https\-health\-check\fR=\fIHTTPS_HEALTH_CHECK\fR] [\fB\-\-region\fR=\fIREGION\fR\ |\ \fB\-\-zone\fR=\fIZONE\fR] [\fB\-\-remove\-workload\-policy\fR\ |\ \fB\-\-workload\-policy\fR=\fIWORKLOAD_POLICY\fR] [\fB\-\-update\-policy\-max\-surge\fR=\fIMAX_SURGE\fR\ \fB\-\-update\-policy\-max\-unavailable\fR=\fIMAX_UNAVAILABLE\fR\ \fB\-\-update\-policy\-minimal\-action\fR=\fIUPDATE_POLICY_MINIMAL_ACTION\fR\ \fB\-\-update\-policy\-most\-disruptive\-action\fR=\fIUPDATE_POLICY_MOST_DISRUPTIVE_ACTION\fR\ \fB\-\-update\-policy\-replacement\-method\fR=\fIUPDATE_POLICY_REPLACEMENT_METHOD\fR\ \fB\-\-update\-policy\-type\fR=\fIUPDATE_TYPE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Update a Compute Engine managed instance group.
\fBgcloud compute instance\-groups managed update\fR allows you to specify or
modify the description and group policies for an existing managed instance
group, including the group's update policy and optional autohealing and stateful
policies
The group's update policy defines how an updated VM configuration is applied to
existing VMs in the group. For more information, see [Applying new
configurations]
(https://cloud.google.com/compute/docs/instance\-groups/updating\-migs) to VMs
in a MIG.
A stateful policy defines which resources should be preserved across the group.
When instances in the group are recreated, stateful resources are preserved.
This command allows you to update stateful resources, specifically to add or
remove stateful disks.
When updating the autohealing policy, you can specify the health check, initial
delay, or both. If either field is unspecified, its value won't be modified. If
\f5\-\-health\-check\fR is specified, the health check monitors the health of
your application. Whenever the health check signal for an instance becomes
\f5UNHEALTHY\fR, the autohealer recreates the instance.
If no health check exists, instance autohealing is triggered only by instance
status: if an instance is not \f5RUNNING\fR, the group recreates it.
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
\fINAME\fR
Name of the managed instance group to update.
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-default\-action\-on\-vm\-failure\fR=\fIACTION_ON_VM_FAILURE\fR
Specifies the action that a MIG performs on a failed or an unhealthy VM. A VM is
marked as unhealthy when the application running on that VM fails a health
check. By default, the value of the flag is set to \f5\fIrepair\fR\fR.
\fIACTION_ON_VM_FAILURE\fR must be one of:
.RS 2m
.TP 2m
\fBdo\-nothing\fR
MIG does not repair a failed or an unhealthy VM.
.TP 2m
\fBrepair\fR
MIG automatically repairs a failed or an unhealthy VM.
.RE
.sp
.TP 2m
\fB\-\-description\fR=\fIDESCRIPTION\fR
An optional description for this group. To clear the description, set the value
to an empty string.
.TP 2m
\fB\-\-[no\-]force\-update\-on\-repair\fR
Specifies whether to apply the group's latest configuration when repairing a VM.
If you updated the group's instance template or per\-instance configurations
after the VM was created, then these changes are applied when VM is repaired. If
this flag is disabled with \f5\fI\-no\-force\-update\-on\-repair\fR\fR, then
updates are applied in accordance with the group's update policy type. By
default, this flag is disabled. Use \fB\-\-force\-update\-on\-repair\fR to
enable and \fB\-\-no\-force\-update\-on\-repair\fR to disable.
.TP 2m
\fB\-\-instance\-redistribution\-type\fR=\fITYPE\fR
Specifies the type of the instance redistribution policy. An instance
redistribution type lets you enable or disable automatic instance redistribution
across zones to meet the group's target distribution shape.
An instance redistribution type can be specified only for a non\-autoscaled
regional managed instance group. By default it is set to \f5\fIproactive\fR\fR.
\fITYPE\fR must be one of:
.RS 2m
.TP 2m
\fBnone\fR
The managed instance group does not redistribute instances across zones.
.TP 2m
\fBproactive\fR
The managed instance group proactively redistributes instances to meet its
target distribution.
.RE
.sp
.TP 2m
\fB\-\-instance\-selection\fR=\fIname\fR=\fINAME\fR,\fImachine\-type\fR=\fIMACHINE_TYPE\fR[,\fImachine\-type\fR=\fIMACHINE_TYPE\fR...][,\fIrank\fR=\fIRANK\fR]
Named selection of machine types with an optional rank. For example,
\f5\-\-instance\-selection="name=instance\-selection\-1,machine\-type=e2\-standard\-8,machine\-type=t2d\-standard\-8,rank=0"\fR
.TP 2m
\fB\-\-instance\-selection\-machine\-types\fR=[\fIMACHINE_TYPE\fR,...]
Machine types that are used to create VMs in the managed instance group. If not
provided, the machine type specified in the instance template is used.
.TP 2m
\fB\-\-list\-managed\-instances\-results\fR=\fIMODE\fR
Pagination behavior for the group's listManagedInstances API method. This flag
does not affect the group's gcloud or console list\-instances behavior. By
default it is set to \f5\fIpageless\fR\fR. \fIMODE\fR must be one of:
.RS 2m
.TP 2m
\fBpageless\fR
Pagination is disabled for the group's listManagedInstances API method.
maxResults and pageToken query parameters are ignored and all instances are
returned in a single response.
.TP 2m
\fBpaginated\fR
Pagination is enabled for the group's listManagedInstances API method.
maxResults and pageToken query parameters are respected.
.RE
.sp
.TP 2m
\fB\-\-remove\-instance\-selections\fR=[\fIINSTANCE_SELECTION_NAME\fR,...]
Remove specific instance selections from the instance flexibility policy.
.TP 2m
\fB\-\-remove\-instance\-selections\-all\fR
Remove all instance selections from the instance flexibility policy.
.TP 2m
\fB\-\-remove\-stateful\-disks\fR=\fIDEVICE_NAME\fR,[\fIDEVICE_NAME\fR,...]
Remove stateful configuration for the specified disks.
.TP 2m
\fB\-\-remove\-stateful\-external\-ips\fR=\fIINTERFACE_NAME\fR,[...]
Remove stateful configuration for the specified interfaces for external IPs.
.TP 2m
\fB\-\-remove\-stateful\-internal\-ips\fR=\fIINTERFACE_NAME\fR,[...]
Remove stateful configuration for the specified interfaces for internal IPs.
.TP 2m
\fB\-\-size\fR=\fISIZE\fR
Target number of running instances in managed instance group.
.TP 2m
\fB\-\-standby\-policy\-initial\-delay\fR=\fISTANDBY_POLICY_INITIAL_DELAY\fR
Specifies the number of seconds that the MIG should wait before suspending or
stopping a VM. The initial delay gives the initialization script the time to
prepare your VM for a quick scale out.
.TP 2m
\fB\-\-standby\-policy\-mode\fR=\fISTANDBY_POLICY_MODE\fR
Defines how a MIG resumes or starts VMs from a standby pool when the group
scales out. The default mode is \f5\fImanual\fR\fR. \fISTANDBY_POLICY_MODE\fR
must be one of:
.RS 2m
.TP 2m
\fBmanual\fR
MIG does not automatically resume or start VMs in the standby pool when the
group scales out.
.TP 2m
\fBscale\-out\-pool\fR
MIG automatically resumes or starts VMs in the standby pool when the group
scales out, and replenishes the standby pool afterwards.
.RE
.sp
.TP 2m
\fB\-\-stateful\-disk\fR=[\fIauto\-delete\fR=\fIAUTO\-DELETE\fR],[\fIdevice\-name\fR=\fIDEVICE\-NAME\fR]
Disks considered stateful by the instance group. Managed instance groups
preserve and reattach stateful disks on VM autohealing, update, and recreate
events.
Use this argument multiple times to update more disks.
If a stateful disk with the given device name already exists in the current
instance configuration, its properties will be replaced by the newly provided
ones. Otherwise, a new stateful disk definition will be added to the instance
configuration.
.RS 2m
.TP 2m
\fBdevice\-name\fR
(Required) Device name of the disk to mark stateful.
.TP 2m
\fBauto\-delete\fR
(Optional) Specifies the auto deletion policy of the stateful disk. The
following options are available:
.RS 2m
.IP "\(bu" 2m
\f5\fInever\fR\fR: (Default) Never delete this disk. Instead, detach the disk
when its instance is deleted.
.IP "\(bu" 2m
\f5\fIon\-permanent\-instance\-deletion\fR\fR: Delete the stateful disk when the
instance that it's attached to is permanently deleted from the group; for
example, when the instance is deleted manually or when the group size is
decreased.
.RE
.sp
.RE
.sp
.TP 2m
\fB\-\-stateful\-external\-ip\fR=[\fIenabled\fR],[\fIauto\-delete\fR=\fIAUTO\-DELETE\fR],[\fIinterface\-name\fR=\fIINTERFACE\-NAME\fR]
Managed instance groups preserve stateful IPs on VM autohealing, update, and
recreate events.
Use this argument multiple times to update more IPs.
If a stateful external IP with the given interface name already exists in the
current instance configuration, its properties are replaced by the newly
provided ones. Otherwise, a new stateful external IP definition is added to the
instance configuration.
At least one of the following is required:
.RS 2m
.TP 2m
\fBenabled\fR
Marks the IP address as stateful. The network interface named \f5\fInic0\fR\fR
is assumed by default when \f5\fIinterface\-name\fR\fR is not specified. This
flag can be omitted when \f5\fIinterface\-name\fR\fR is provided explicitly.
.TP 2m
\fBinterface\-name\fR
Marks the IP address from this network interface as stateful. This flag can be
omitted when \f5\fIenabled\fR\fR is provided.
Additional arguments:
.TP 2m
\fBauto\-delete\fR
(Optional) Prescribes what should happen to an associated static Address
resource when a VM instance is permanently deleted. Regardless of the value of
the delete rule, stateful IP addresses are always preserved on instance
autohealing, update, and recreation operations. The following options are
available:
.RS 2m
.IP "\(bu" 2m
\f5\fInever\fR\fR: (Default) Never delete the static IP address. Instead,
unassign the address when its instance is permanently deleted and keep the
address reserved.
.IP "\(bu" 2m
\f5\fIon\-permanent\-instance\-deletion\fR\fR: Delete the static IP address
reservation when the instance that it's assigned to is permanently deleted from
the instance group; for example, when the instance is deleted manually or when
the group size is decreased.
.RE
.sp
.RE
.sp
.TP 2m
\fB\-\-stateful\-internal\-ip\fR=[\fIenabled\fR],[\fIauto\-delete\fR=\fIAUTO\-DELETE\fR],[\fIinterface\-name\fR=\fIINTERFACE\-NAME\fR]
Managed instance groups preserve stateful IPs on VM autohealing, update, and
recreate events.
Use this argument multiple times to update more IPs.
If a stateful internal IP with the given interface name already exists in the
current instance configuration, its properties are replaced by the newly
provided ones. Otherwise, a new stateful internal IP definition is added to the
instance configuration.
At least one of the following is required:
.RS 2m
.TP 2m
\fBenabled\fR
Marks the IP address as stateful. The network interface named \f5\fInic0\fR\fR
is assumed by default when \f5\fIinterface\-name\fR\fR is not specified. This
flag can be omitted when \f5\fIinterface\-name\fR\fR is provided explicitly.
.TP 2m
\fBinterface\-name\fR
Marks the IP address from this network interface as stateful. This flag can be
omitted when \f5\fIenabled\fR\fR is provided.
Additional arguments:
.TP 2m
\fBauto\-delete\fR
(Optional) Prescribes what should happen to an associated static Address
resource when a VM instance is permanently deleted. Regardless of the value of
the delete rule, stateful IP addresses are always preserved on instance
autohealing, update, and recreation operations. The following options are
available:
.RS 2m
.IP "\(bu" 2m
\f5\fInever\fR\fR: (Default) Never delete the static IP address. Instead,
unassign the address when its instance is permanently deleted and keep the
address reserved.
.IP "\(bu" 2m
\f5\fIon\-permanent\-instance\-deletion\fR\fR: Delete the static IP address
reservation when the instance that it's assigned to is permanently deleted from
the instance group; for example, when the instance is deleted manually or when
the group size is decreased.
.RE
.sp
.RE
.sp
.TP 2m
\fB\-\-stopped\-size\fR=\fISTOPPED_SIZE\fR
Specifies the target size of stopped VMs in the group.
.TP 2m
\fB\-\-suspended\-size\fR=\fISUSPENDED_SIZE\fR
Specifies the target size of suspended VMs in the group.
.TP 2m
\fB\-\-target\-distribution\-shape\fR=\fISHAPE\fR
Specifies how a regional managed instance group distributes its instances across
zones within the region. The default shape is \f5\fIeven\fR\fR. \fISHAPE\fR must
be one of:
.RS 2m
.TP 2m
\fBany\fR
The group picks zones for creating VM instances to fulfill the requested number
of VMs within present resource constraints and to maximize utilization of unused
zonal reservations. Recommended for batch workloads that do not require high
availability.
.TP 2m
\fBany\-single\-zone\fR
The group schedules all instances within a single zone. The zone is chosen based
on hardware support, current resources availability, and matching reservations.
The group might not be able to create the requested number of VMs in case of
zonal resource availability constraints. Recommended for workloads requiring
extensive communication between VMs.
.TP 2m
\fBbalanced\fR
The group prioritizes acquisition of resources, scheduling VMs in zones where
resources are available while distributing VMs as evenly as possible across
selected zones to minimize the impact of zonal failure. Recommended for highly
available serving or batch workloads that do not require autoscaling.
.TP 2m
\fBeven\fR
The group schedules VM instance creation and deletion to achieve and maintain an
even number of managed instances across the selected zones. The distribution is
even when the number of managed instances does not differ by more than 1 between
any two zones. Recommended for highly available serving workloads.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-clear\-autohealing\fR
Clears all autohealing policy fields for the managed instance group.
.TP 2m
\fB\-\-initial\-delay\fR=\fIINITIAL_DELAY\fR
Specifies the number of seconds that a new VM takes to initialize and run its
startup script. During a VM's initial delay period, the MIG ignores unsuccessful
health checks because the VM might be in the startup process. This prevents the
MIG from prematurely recreating a VM. If the health check receives a healthy
response during the initial delay, it indicates that the startup process is
complete and the VM is ready. The value of initial delay must be between 0 and
3600 seconds. The default value is 0. See $ gcloud topic datetimes for
information on duration formats.
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-health\-check\fR=\fIHEALTH_CHECK\fR
Name of the health check to operate on.
.TP 2m
\fB\-\-http\-health\-check\fR=\fIHTTP_HEALTH_CHECK\fR
(DEPRECATED) HTTP health check object used for autohealing instances in this
group.
HttpHealthCheck is deprecated. Use \-\-health\-check instead.
.TP 2m
\fB\-\-https\-health\-check\fR=\fIHTTPS_HEALTH_CHECK\fR
(DEPRECATED) HTTPS health check object used for autohealing instances in this
group.
HttpsHealthCheck is deprecated. Use \-\-health\-check instead.
.RE
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-region\fR=\fIREGION\fR
Region of the managed instance group to update. If not specified, you might be
prompted to select a region (interactive mode only).
A list of regions can be fetched by running:
.RS 2m
$ gcloud compute regions list
.RE
Overrides the default \fBcompute/region\fR property value for this command
invocation.
.TP 2m
\fB\-\-zone\fR=\fIZONE\fR
Zone of the managed instance group to update. If not specified, you might be
prompted to select a zone (interactive mode only).
A list of zones can be fetched by running:
.RS 2m
$ gcloud compute zones list
.RE
Overrides the default \fBcompute/zone\fR property value for this command
invocation.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-remove\-workload\-policy\fR
Detaches the workload policy from the managed instance group.
.TP 2m
\fB\-\-workload\-policy\fR=\fIWORKLOAD_POLICY\fR
Specifies the workload policy for the managed instance group. It can be a full
or partial URL to a resource policy containing the workload policy.
.RE
.sp
.TP 2m
Parameters for setting update policy for this managed instance group.
.RS 2m
.TP 2m
\fB\-\-update\-policy\-max\-surge\fR=\fIMAX_SURGE\fR
Maximum additional number of VMs that can be created during the update process.
This can be a fixed number (e.g. 5) or a percentage of size to the managed
instance group (e.g. 10%).
.TP 2m
\fB\-\-update\-policy\-max\-unavailable\fR=\fIMAX_UNAVAILABLE\fR
Maximum number of VMs that can be unavailable during the update process. This
can be a fixed number (e.g. 5) or a percentage of size to the managed instance
group (e.g. 10%). Defaults to the number of zones in which the managed instance
group operates.
.TP 2m
\fB\-\-update\-policy\-minimal\-action\fR=\fIUPDATE_POLICY_MINIMAL_ACTION\fR
Use this flag to minimize disruption as much as possible or to apply a more
disruptive action than is strictly necessary. The MIG performs at least this
action on each VM while updating. If the update requires a more disruptive
action than the one specified here, then the more disruptive action is
performed. \fIUPDATE_POLICY_MINIMAL_ACTION\fR must be one of:
.RS 2m
.TP 2m
\fBnone\fR
No action
.TP 2m
\fBrefresh\fR
Apply the new configuration without stopping VMs, if possible. For example, use
``refresh`` to apply changes that only affect metadata or additional disks.
.TP 2m
\fBrestart\fR
Apply the new configuration without replacing VMs, if possible. For example,
stopping VMs and starting them again is sufficient to apply changes to machine
type.
.TP 2m
\fBreplace\fR
Replace old VMs according to the \-\-update\-policy\-replacement\-method flag.
.RE
.sp
.TP 2m
\fB\-\-update\-policy\-most\-disruptive\-action\fR=\fIUPDATE_POLICY_MOST_DISRUPTIVE_ACTION\fR
Use this flag to prevent an update if it requires more disruption than you can
afford. At most, the MIG performs the specified action on each VM while
updating. If the update requires a more disruptive action than the one specified
here, then the update fails and no changes are made.
\fIUPDATE_POLICY_MOST_DISRUPTIVE_ACTION\fR must be one of:
.RS 2m
.TP 2m
\fBnone\fR
No action
.TP 2m
\fBrefresh\fR
Apply the new configuration without stopping VMs, if possible. For example, use
``refresh`` to apply changes that only affect metadata or additional disks.
.TP 2m
\fBrestart\fR
Apply the new configuration without replacing VMs, if possible. For example,
stopping VMs and starting them again is sufficient to apply changes to machine
type.
.TP 2m
\fBreplace\fR
Replace old VMs according to the \-\-update\-policy\-replacement\-method flag.
.RE
.sp
.TP 2m
\fB\-\-update\-policy\-replacement\-method\fR=\fIUPDATE_POLICY_REPLACEMENT_METHOD\fR
Type of replacement method. Specifies what action will be taken to update VMs.
\fIUPDATE_POLICY_REPLACEMENT_METHOD\fR must be one of:
.RS 2m
.TP 2m
\fBrecreate\fR
Recreate VMs and preserve the VM names. The VM IDs and creation timestamps might
change.
.TP 2m
\fBsubstitute\fR
Delete old VMs and create VMs with new names.
.RE
.sp
.TP 2m
\fB\-\-update\-policy\-type\fR=\fIUPDATE_TYPE\fR
Specifies the type of update process. You can specify either ``proactive`` so
that the managed instance group proactively executes actions in order to bring
VMs to their target versions or ``opportunistic`` so that no action is
proactively executed but the update will be performed as part of other actions.
\fIUPDATE_TYPE\fR must be one of:
.RS 2m
.TP 2m
\fBopportunistic\fR
Do not proactively replace VMs. Create new VMs and delete old ones on resizes of
the group and when you target specific VMs to be updated or recreated.
.TP 2m
\fBproactive\fR
Replace VMs proactively.
.RE
.sp
.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 instance\-groups managed update
.RE
.RS 2m
$ gcloud beta compute instance\-groups managed update
.RE