- NAME
-
- gcloud compute instance-groups managed update-instances - immediately update selected instances in a Compute Engine managed instance group
- SYNOPSIS
-
-
gcloud compute instance-groups managed update-instances
NAME
(--all-instances
|--instances
=INSTANCE
,[INSTANCE
,…]) [--minimal-action
=MINIMAL_ACTION
; default="none"] [--most-disruptive-allowed-action
=MOST_DISRUPTIVE_ALLOWED_ACTION
; default="replace"] [--region
=REGION
|--zone
=ZONE
] [GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
-
When using a managed instance group, it's possible that your intended
specification for a VM is different from the current state of that VM. For
example, this can happen due to changes to the group's target instance template.
This command enables you to initiate the update process on the given set of
instances instantly, thus when your Managed Instance Group is stable you can be
sure that all the changes were applied.
gcloud compute instance-groups managed update-instances
allows you to specify the least and the most disruptive actions that can be performed while updating the instances. This way you can reduce the risk of rolling out too many changes at once. Possible actions are:none
,refresh
,restart
andreplace
. The level of disruption to the instance is ordered as:none
<refresh
<restart
<replace
.The command returns the operation status per instance, which might be
,FAIL
, orSUCCESS
.MEMBER_NOT_FOUND
is returned only for regional groups when the gcloud command-line tool wasn't able to resolve the zone from the instance name.MEMBER_NOT_FOUND
- EXAMPLES
-
To update instances
instance-1
,instance-2
inmy-group
, withminimal-action=none
andmost-disruptive-allowed-action=restart
, run:gcloud compute instance-groups managed update-instances my-group --instances=instance-1,instance2 --minimal-action=none --most-disruptive-allowed-action=restart
- POSITIONAL ARGUMENTS
-
NAME
- Name of the managed instance group to operate on.
- REQUIRED FLAGS
-
-
Exactly one of these must be specified:
--all-instances
- Update all instances in the group.
--instances
=INSTANCE
,[INSTANCE
,…]- Names of instances to update.
-
Exactly one of these must be specified:
- OPTIONAL FLAGS
-
--minimal-action
=MINIMAL_ACTION
; default="none"-
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 instance while updating. If the update requires a more disruptive
action than the one specified here, then the more disruptive action is
performed. If you omit this flag, the update uses the
value from the MIG's update policy, unless it is not set in which case the default isminimal-action
.replace
MINIMAL_ACTION
must be one of:none
- No action
refresh
- Apply the new configuration without stopping VMs, if possible. For example, use ``refresh`` to apply changes that only affect metadata or additional disks.
restart
- 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.
replace
- Replace old VMs according to the --replacement-method flag.
--most-disruptive-allowed-action
=MOST_DISRUPTIVE_ALLOWED_ACTION
; default="replace"-
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 instance while
updating. If the update requires a more disruptive action than the one specified
here, then the update fails and no changes are made. If you omit this flag, the
update uses the
value from the MIG's update policy, unless it is not set in which case the default ismost-disruptive-allowed-action
.replace
MOST_DISRUPTIVE_ALLOWED_ACTION
must be one of:none
- No action
refresh
- Apply the new configuration without stopping VMs, if possible. For example, use ``refresh`` to apply changes that only affect metadata or additional disks.
restart
- 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.
replace
- Replace old VMs according to the --replacement-method flag.
-
At most one of these can be specified:
--region
=REGION
-
Region of the managed instance group to operate on. If not specified, you might
be prompted to select a region (interactive mode only).
A list of regions can be fetched by running:
gcloud compute regions list
Overrides the default
compute/region
property value for this command invocation. --zone
=ZONE
-
Zone of the managed instance group to operate on. If not specified, you might be
prompted to select a zone (interactive mode only).
A list of zones can be fetched by running:
gcloud compute zones list
Overrides the default
compute/zone
property value for this command invocation.
- 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
$ gcloud help
for details. - NOTES
-
These variants are also available:
gcloud alpha compute instance-groups managed update-instances
gcloud beta compute instance-groups managed update-instances
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 2024-06-04 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"lastModified": "Last updated 2024-06-04 UTC.",
"confidential": False
}