gcloud_alpha_compute_instance-groups_managed_instance-configs_update (1)
NAME
- gcloud alpha compute instance-groups managed instance-configs update - update per instance config of a managed instance group
SYNOPSIS
-
gcloud alpha compute instance-groups managed instance-configs update NAME --instance=INSTANCE [--force-instance-update] [--remove-stateful-disks=DEVICE_NAME,[DEVICE_NAME,...]] [--remove-stateful-metadata=KEY,[KEY,...]] [--update-stateful-disk=[device-name=DEVICE-NAME],[mode=MODE],[source=SOURCE]] [--update-stateful-metadata=KEY=VALUE,[KEY=VALUE,...]] [--region=REGION | --zone=ZONE] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) gcloud alpha compute instance-groups managed instance-configs
For example:
-
$ gcloud alpha compute instance-groups managed instance-configs \
update example-group --instance=example-instance \
--update-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
will update stateful disk my-disk-3 to the new one pointed by source (or add if my-disk-3 did not exist in the instance config); it will also remove my-disk-1 and my-disk-2 from the instance config overrides - they will not be preserved anymore during next restart or recreation of the instance.
POSITIONAL ARGUMENTS
-
- NAME
-
Name of the managed instance group to update per instance config for.
REQUIRED FLAGS
-
- --instance=INSTANCE
-
URI to existing or non existing instance.
Name - last part of URI - will be preserved for existing per instance configs.
For zonal managed instance groups there is no need to specify the whole URI to the instance - for this case instance name can be applied instead of URI.
OPTIONAL FLAGS
-
- --force-instance-update
-
The changes will be applied immediately to the instances. If this flag is not
provided, the changes will be applied once the instances are restarted or
recreated.
Example: let's say we have an instance with a disk attached to it and an override for the disk. If we decide to delete the override and provide this flag, this will instantly recreate the instance and detach the disk from it. Similarly if we have attached new disk or changed its definition - with this flag it will instantly recreate instance with newly applied overrides.
If we omit this flag, the instance will continue to exist with no overrides changes applied until it gets restarted or recreated either manually or by autohealer or updater.
- --remove-stateful-disks=DEVICE_NAME,[DEVICE_NAME,...]
-
List all device names which should be removed from current instance config.
- --remove-stateful-metadata=KEY,[KEY,...]
-
List all stateful metadata keys which should be removed from current instance
config.
- --update-stateful-disk=[device-name=DEVICE-NAME],[mode=MODE],[source=SOURCE]
-
Disks considered stateful by the instance group. Usually, the managed instance
group deletes disks when deleting instances; however, in the case of stateful
disks, these disks are detached from the deleted instance and attached to new
instances the managed instance group creates.
Besides preserving disks already attached to the instance by specifying only device names, user have an option to attach (and preserve) other existing persistent disk(s) to the given instance.
The same disk can be attached to many instances but only in read-only mode.
Use this argument multiple times to update multiple disks.
If stateful disk with given device-name exists in current instance config, its properties will be replaced by the newly provided ones. In other case new stateful disk definition will be added to the instance config.
-
- device-name
-
Name under which disk is or will be attached.
- source
-
Optional argument used to specify URI of existing persistent disk to attach
under specified device-name.
- mode
-
Specifies the mode of the disk to attach. Supported options are ro for
read-only and rw for read-write. If omitted when source is specified,
rw is used as a default.
-
- --update-stateful-metadata=KEY=VALUE,[KEY=VALUE,...]
-
Additional metadata to be made available to the guest operating system on top of
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 have priority over the metadata defined in the instance template. It means that stateful metadata defined for the keys already existing in the instance template override their values.
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., --update-stateful-metadata key-1=value-1,key-2=value-2,key-3=value-3.
If stateful metadata with the given key exists in current instance config, its value will be overridden with the newly provided one. If the key does not exist in the current instance config, a new key/value pair will be added.
-
At most one of these may be specified:
-
- --region=REGION
-
Region of the managed instance group to update per instance config for. If not
specified, you may be prompted to select a region.
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 update per instance config for. If not
specified, you may be prompted to select a zone.
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: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support