gcloud compute instance-groups managed update-autoscaling

NAME
gcloud compute instance-groups managed update-autoscaling - update autoscaling parameters of a managed instance group
SYNOPSIS
gcloud compute instance-groups managed update-autoscalingNAME[--cpu-utilization-predictive-method=CPU_UTILIZATION_PREDICTIVE_METHOD][--max-num-replicas=MAX_NUM_REPLICAS][--min-num-replicas=MIN_NUM_REPLICAS][--mode=MODE][--clear-scale-in-control    |--scale-in-control=[max-scaled-in-replicas=MAX-SCALED-IN-REPLICAS],[max-scaled-in-replicas-percent=MAX-SCALED-IN-REPLICAS-PERCENT],[time-window=TIME-WINDOW]][--disable-schedule=SCHEDULE_NAME    |--enable-schedule=SCHEDULE_NAME    |--remove-schedule=SCHEDULE_NAME    |--set-schedule=SCHEDULE_NAME    |--update-schedule=SCHEDULE_NAME][--region=REGION    |--zone=ZONE][--schedule-cron=CRON_EXPRESSION--schedule-description=DESCRIPTION--schedule-duration-sec=DURATION--schedule-min-required-replicas=MIN_REQUIRED_REPLICAS--schedule-time-zone=TIME_ZONE][GCLOUD_WIDE_FLAG]
DESCRIPTION
gcloud compute instance-groups managed update-autoscaling updatesautoscaling parameters of specified managed instance group.

Autoscalers can use one or more autoscaling signals. Information on usingmultiple autoscaling signals can be found here:https://cloud.google.com/compute/docs/autoscaler/multiple-signals

In contrast togcloudcompute instance-groups managed set-autoscaling, this commandonly updates specified fields. For instance:

gcloudcomputeinstance-groupsmanagedupdate-autoscaling--modeonly-scale-out

would change themode field of the autoscaler policy, but leave therest of the settings intact.

EXAMPLES
To update an existing instance group:
gcloudcomputeinstance-groupsmanagedupdate-autoscaling--mode=only-scale-out
POSITIONAL ARGUMENTS
NAME
Name of the managed instance group to operate on.
FLAGS
--cpu-utilization-predictive-method=CPU_UTILIZATION_PREDICTIVE_METHOD
Indicates whether to use a predictive algorithm when scaling based on CPU.CPU_UTILIZATION_PREDICTIVE_METHOD must be one of:
none
(Default) No predictions are made when calculating the number of VM instances.
optimize-availability
Predictive autoscaling predicts the future values of the scaling metric andscales the group in advance to ensure that new VM instances are ready in time tocover the predicted peak.
--max-num-replicas=MAX_NUM_REPLICAS
Maximum number of replicas Autoscaler can set.
--min-num-replicas=MIN_NUM_REPLICAS
Minimum number of replicas Autoscaler can set.
--mode=MODE
Set the mode of an autoscaler for a managed instance group.

You can turn off or restrict a group's autoscaler activities without affectingyour autoscaler configuration. The autoscaler configuration persists while theactivities are turned off or restricted, and the activities resume when theautoscaler is turned on again or when the restrictions are lifted.

MODE must be one of:

off
Turns off autoscaling, while keeping the new configuration.
on
Permits autoscaling to scale out and in (default for new autoscalers).
only-scale-out
Permits autoscaling to scale only out and not in.
only-up
(DEPRECATED) Permits autoscaling to scale only out and not in.

Valueonly-up is deprecated. Use--mode only-scale-outinstead.

At most one of these can be specified:
--clear-scale-in-control
If specified, the scale-in-control field will be cleared. Using this flag willremove any configuration set by--scale-in-control flag.
--scale-in-control=[max-scaled-in-replicas=MAX-SCALED-IN-REPLICAS],[max-scaled-in-replicas-percent=MAX-SCALED-IN-REPLICAS-PERCENT],[time-window=TIME-WINDOW]
Configuration that allows slower scale in so that even if Autoscaler recommendsan abrupt scale in of a managed instance group, it will be throttled asspecified by the parameters.
max-scaled-in-replicas
Maximum allowed number of VMs that can be deducted from the peak recommendationduring the window. Possibly all these VMs can be deleted at once so theapplication needs to be prepared to lose that many VMs in one step. Mutuallyexclusive with 'max-scaled-in-replicas-percent'.
max-scaled-in-replicas-percent
Maximum allowed percent of VMs that can be deducted from the peak recommendationduring the window. Possibly all these VMs can be deleted at once so theapplication needs to be prepared to lose that many VMs in one step. Mutuallyexclusive with 'max-scaled-in-replicas'.
time-window
How long back autoscaling should look when computing recommendations. Theautoscaler will not resize below the maximum allowed deduction subtracted fromthe peak size observed in this period. Measured in seconds.
At most one of these can be specified:
--disable-schedule=SCHEDULE_NAME
Name of the scaling schedule to be disabled.

When a scaling schedule is disabled its configuration persists but the scalingschedule itself never becomes active. If you disable a scaling schedule that iscurrently active the disabled scaling schedule stops being effective immediatelyafter it moves into DISABLED state. If there is no need to maintain capacity,the autoscaler starts removing instances after the usual stabilization periodand after scale-in controls (if configured). For more information, seeDelaysin scaling in andScale-incontrols. This ensures you don't accidentally lose capacity immediatelyafter the scaling schedule ends.

--enable-schedule=SCHEDULE_NAME
Name of the scaling schedule to be enabled.

See --disable-schedule for details.

--remove-schedule=SCHEDULE_NAME
Name of the scaling schedule to be removed.

Be careful with this action as scaling schedule deletion cannot be undone.

You can delete any schedule regardless of its status. If you delete a scalingschedule that is currently active, the deleted scaling schedule stops beingeffective immediately after it is deleted. If there is no need to maintaincapacity, the autoscaler starts removing instances after the usual stabilizationperiod and after scale-in controls (if configured). For more information, seeDelaysin scaling in andScale-incontrols. This ensures you don't accidentally lose capacity immediatelyafter the scaling schedule ends.

--set-schedule=SCHEDULE_NAME
A unique name for the scaling schedule to be configured.
--update-schedule=SCHEDULE_NAME
Name of the scaling schedule to be updated.
At most one of these can be specified:
--region=REGION
Region of the managed instance group to operate on. If not specified, you mightbe prompted to select a region (interactive mode only).

A list of regions can be fetched by running:

gcloudcomputeregionslist

Overrides the defaultcompute/region property value for thiscommand invocation.

--zone=ZONE
Zone of the managed instance group to operate on. If not specified, you might beprompted to select a zone (interactive mode only).

A list of zones can be fetched by running:

gcloudcomputezoneslist

Overrides the defaultcompute/zone property value for this commandinvocation.

--schedule-cron=CRON_EXPRESSION
Start time of the scaling schedule in cron format.

This is when the autoscaler starts creating new VMs, if the group's current sizeis less than the minimum required instances. Set the start time to allow enoughtime for new VMs to boot and initialize. For example if your workload takes 10minutes from VM creation to start serving then set the start time 10 minutesearlier than the time you need VMs to be ready.

--schedule-description=DESCRIPTION
A verbose description of the scaling schedule.
--schedule-duration-sec=DURATION
How long should the scaling schedule be active, measured in seconds.

Minimum duration is 5 minutes. A scaling schedule is active from its start timeand for its configured duration. During this time, the autoscaler scales thegroup to have at least as many VMs as defined by the minimum required instances.After the configured duration, if there is no need to maintain capacity, theautoscaler starts removing instances after the usual stabilization period andafter scale-in controls (if configured). For more information, seeDelaysin scaling in andScale-incontrols. This ensures you don't accidentally lose capacity immediatelyafter the scaling schedule ends.

--schedule-min-required-replicas=MIN_REQUIRED_REPLICAS
How many VMs the autoscaler should provision for the duration of this scalingschedule.

Autoscaler provides at least this number of instances when the scaling scheduleis active. A managed instance group can have more VMs if there are other scalingschedules active with more required instances or if another signal (for example,scaling based on CPU) requires more instances to meet its target.

This configuration does not change autoscaling minimum and maximum instancelimits which are always in effect. Autoscaler does not create more than themaximum number of instances configured for a group.

--schedule-time-zone=TIME_ZONE
Name of the timezone that the scaling schedule's start time is in.

It should be provided as a name from the IANA tz database (for exampleEurope/Paris or UTC). It automatically adjusts for daylight savings time (DST).If no time zone is provided, UTC is used as a default.

Seehttps://en.wikipedia.org/wiki/List_of_tz_database_time_zonesfor the list of valid timezones.

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:
gcloudalphacomputeinstance-groupsmanagedupdate-autoscaling
gcloudbetacomputeinstance-groupsmanagedupdate-autoscaling

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.