- NAME
- 
- gcloud compute instance-groups managed instance-configs update - update per-instance config of a managed instance group
 
- SYNOPSIS
- 
- 
gcloud compute instance-groups managed instance-configs updateNAME--instance=INSTANCE[--instance-update-minimal-action=INSTANCE_UPDATE_MINIMAL_ACTION; default="none"] [--remove-stateful-disks=DEVICE_NAME,[DEVICE_NAME,…]] [--remove-stateful-external-ips=KEY,[KEY,…]] [--remove-stateful-internal-ips=KEY,[KEY,…]] [--remove-stateful-metadata=KEY,[KEY,…]] [--stateful-disk=[auto-delete=AUTO-DELETE],[device-name=DEVICE-NAME],[mode=MODE],[source=SOURCE]] [--stateful-external-ip=[address=ADDRESS],[auto-delete=AUTO-DELETE],[interface-name=INTERFACE-NAME]] [--stateful-internal-ip=[address=ADDRESS],[auto-delete=AUTO-DELETE],[interface-name=INTERFACE-NAME]] [--stateful-metadata=KEY=VALUE,[KEY=VALUE,…]] [--no-update-instance] [--region=REGION|--zone=ZONE] [GCLOUD_WIDE_FLAG …]
 
- 
- DESCRIPTION
- 
gcloud compute instance-groups managed instance-configs updateupdates the per-instance config of an instance controlled by a Compute Engine managed instance group. The command lets you change the list of instance-specific stateful resources, that is, the list of resources that are preserved during instance restarts and recreations.Changes are applied immediately to the corresponding instances, by performing the necessary action (for example, REFRESH), unless overridden by providing the --no-update-instance
- EXAMPLES
- 
To updates the stateful disk my-disk-3sourcemy-disk1my-disk2my-keymy-valuemy-instancegcloud compute instance-groups managed instance-configs update my-group --region=europe-west4 --instance=my-instance --stateful-disk=device-name=my-disk-3,source=projects/my-project/zones/us-central1-a/disks/my-disk-3 --remove-stateful-disks=my-disk-1,my-disk-2 --stateful-metadata='my-key=my-value'If my-disk-3my-disk-3my-instancemy-disk-1my-disk-2To update a per-instance configuration with a stateful internal IP 192.168.0.10my-instancegcloud compute instance-groups managed instance-configs update my-group --region=europe-west4 --instance=my-instance --stateful-internal-ip=address=192.168.0.10,interface-name=nic0To update a per-instance configuration to remove a stateful external IP that's defined in network interface nic0, on instance my-instance, run: gcloud compute instance-groups managed instance-configs update my-group --region=europe-west4 --instance=my-instance --remove-stateful-internal-ips=nic0
- POSITIONAL ARGUMENTS
- 
- NAME
- Name of the managed instance group to update per-instance config for.
 
- REQUIRED FLAGS
- 
- --instance=- INSTANCE
- URI/name of an existing instance in the managed instance group.
 
- OPTIONAL FLAGS
- 
- --instance-update-minimal-action=- INSTANCE_UPDATE_MINIMAL_ACTION; default="none"
- 
Perform at least this action on the instance while updating, if
--update-instanceis set totrue.INSTANCE_UPDATE_MINIMAL_ACTIONmust 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.
 
- --remove-stateful-disks=- DEVICE_NAME,[- DEVICE_NAME,…]
- Remove stateful configuration for the specified disks from the instance's configuration.
- --remove-stateful-external-ips=- KEY,[- KEY,…]
- List of all stateful IP network interface names to remove from the instance's per-instance configuration.
- --remove-stateful-internal-ips=- KEY,[- KEY,…]
- List of all stateful IP network interface names to remove from the instance's per-instance configuration.
- --remove-stateful-metadata=- KEY,[- KEY,…]
- Remove stateful configuration for the specified metadata keys from the instance's configuration.
- --stateful-disk=[- auto-delete=- AUTO-DELETE],[- device-name=- DEVICE-NAME],[- mode=- MODE],[- source=- SOURCE]
- 
Disks considered stateful by the instance group. Managed instance groups
preserve and reattach stateful disks on VM autohealing, update, and recreate
events.
You can also attach and preserve disks, not defined in the group's instance template, to a given instance. The same disk can be attached to more than one instance but only in read-only mode. Use this argument multiple times to update multiple disks. If stateful disk with given device-nameexists in current instance configuration, its properties will be replaced by the newly provided ones. In other case new stateful disk definition will be added to the instance configuration.- device-name
- Name under which disk is or will be attached.
- source
- 
Optional argument used to specify the URI of an existing persistent disk to
attach under specified device-name.
- mode
- 
Specifies the mode of the disk to attach. Supported options are rofor read-only andrwfor read-write. If omitted when source is specified,rwis used as a default.modecan only be specified ifsourceis given.
- auto-delete
- 
(Optional) Specifies the auto deletion policy of the stateful disk. The
following options are available:
- 
never
- 
on-permanent-instance-deletion
 
- 
 
- --stateful-external-ip=[- address=- ADDRESS],[- auto-delete=- AUTO-DELETE],[- interface-name=- INTERFACE-NAME]
- 
Managed instance groups preserve stateful IPs on VM autohealing, update, and
recreate events.
You can preserve the IP address that's specified in a network interface for a specific managed instance, even if that network interface is not defined in the group's instance template. Use this argument multiple times to update multiple IPs. If a stateful IP with the given network interface name exists in the current per-instance configuration, its properties are replaced by the newly provided ones. Otherwise, a new stateful IP definition is added to the per-instance configuration. - interface-name
- 
(Optional) Network interface name. If omitted, the default network interface
named nic0
- address
- 
(Optional) Static IP address to assign to the instance in one of the following
formats:
+ Address: URL of a static IP address reservation. For example: projects/example-project/regions/us-east1/addresses/example-ip-name+ Literal: For example: 130.211.181.55If the provided IP address is not yet reserved, the managed instance group automatically creates the corresponding IP address reservation. If the provided IP address is reserved, the group assigns the reservation to the instance. The addressIf omitted, the currently configured address remains unchanged. 
- auto-delete
- 
(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:
- 
never
- 
on-permanent-instance-deletion
 
- 
 
- --stateful-internal-ip=[- address=- ADDRESS],[- auto-delete=- AUTO-DELETE],[- interface-name=- INTERFACE-NAME]
- 
Managed instance groups preserve stateful IPs on VM autohealing, update, and
recreate events.
You can preserve the IP address that's specified in a network interface for a specific managed instance, even if that network interface is not defined in the group's instance template. Use this argument multiple times to update multiple IPs. If a stateful IP with the given network interface name exists in the current per-instance configuration, its properties are replaced by the newly provided ones. Otherwise, a new stateful IP definition is added to the per-instance configuration. - interface-name
- 
(Optional) Network interface name. If omitted, the default network interface
named nic0
- address
- 
(Optional) Static IP address to assign to the instance in one of the following
formats:
+ Address: URL of a static IP address reservation. For example: projects/example-project/regions/us-east1/addresses/example-ip-name+ Literal: For example: 130.211.181.55If the provided IP address is not yet reserved, the managed instance group automatically creates the corresponding IP address reservation. If the provided IP address is reserved, the group assigns the reservation to the instance. The addressIf omitted, the currently configured address remains unchanged. 
- auto-delete
- 
(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:
- 
never
- 
on-permanent-instance-deletion
 
- 
 
- --stateful-metadata=- KEY=- VALUE,[- KEY=- VALUE,…]
- 
Additional metadata to be made available to the guest operating system in
addition to the metadata defined in the instance template.
Stateful metadata may be used to define a key/value pair specific for the one given instance to differentiate it from the other instances in the managed instance group. Stateful metadata key/value pairs are preserved on instance recreation, autohealing, updates, and any other lifecycle transitions of the instance. Stateful metadata have priority over the metadata defined in the instance template. This means that stateful metadata that is defined for a key that already exists in the instance template overrides the instance template value. Each metadata entry is a key/value pair separated by an equals sign. Metadata keys must be unique and less than 128 bytes in length. Multiple entries can be passed to this flag, e.g., --stateful-metadata key-1=value-1,key-2=value-2,key-3=value-3If stateful metadata with the given key exists in current instance configuration, its value will be overridden with the newly provided one. If the key does not exist in the current instance configuration, a new key/value pair will be added. 
- --update-instance
- 
Apply the configuration changes immediately to the instance. If you disable this
flag, the managed instance group will apply the configuration update when you
next recreate or update the instance.
Example: say you have an instance with a disk attached to it and you created a stateful configuration for the disk. If you decide to delete the stateful configuration for the disk and you provide this flag, the group immediately refreshes the instance and removes the stateful configuration for the disk. Similarly if you have attached a new disk or changed its definition, with this flag the group immediately refreshes the instance with the new configuration. Enabled by default, use --no-update-instanceto disable.
- 
At most one of these can be specified:
- --region=- REGION
- 
Region of the managed instance group to update per-instance config for. 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 listOverrides the default compute/regionproperty value for this command invocation.
- --zone=- ZONE
- 
Zone of the managed instance group to update per-instance config for. 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 listOverrides the default compute/zoneproperty 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 helpfor details.
- NOTES
- 
These variants are also available:
gcloud alpha compute instance-groups managed instance-configs updategcloud beta compute instance-groups managed instance-configs update
      gcloud compute instance-groups managed instance-configs 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.