gcloud compute instance-groups managed set-autoscaling NAME --max-num-replicas=MAX_NUM_REPLICAS [--cool-down-period=COOL_DOWN_PERIOD] [--cpu-utilization-predictive-method=CPU_UTILIZATION_PREDICTIVE_METHOD] [--custom-metric-utilization=[metric=METRIC],[utilization-target=UTILIZATION-TARGET],[utilization-target-type=UTILIZATION-TARGET-TYPE]] [--description=DESCRIPTION] [--min-num-replicas=MIN_NUM_REPLICAS] [--mode=MODE] [--remove-stackdriver-metric=METRIC] [--scale-based-on-cpu] [--scale-based-on-load-balancing] [--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]] [--set-schedule=SCHEDULE_NAME] [--stabilization-period=STABILIZATION_PERIOD] [--stackdriver-metric-filter=FILTER] [--stackdriver-metric-single-instance-assignment=ASSIGNMENT] [--stackdriver-metric-utilization-target=TARGET] [--stackdriver-metric-utilization-target-type=TARGET_TYPE] [--target-cpu-utilization=TARGET_CPU_UTILIZATION] [--target-load-balancing-utilization=TARGET_LOAD_BALANCING_UTILIZATION] [--update-stackdriver-metric=METRIC] [--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 …]
gcloud compute instance-groups managed set-autoscaling sets
autoscaling parameters of specified managed instance group.
Autoscalers can use one or more autoscaling signals. Information on using
multiple autoscaling signals can be found here: https://cloud.google.com/compute/docs/autoscaler/multiple-signals
NAME--max-num-replicas=MAX_NUM_REPLICAS--cool-down-period=COOL_DOWN_PERIOD--cpu-utilization-predictive-method=CPU_UTILIZATION_PREDICTIVE_METHODCPU_UTILIZATION_PREDICTIVE_METHOD must be one of:
noneoptimize-availability--custom-metric-utilization=[metric=METRIC],[utilization-target=UTILIZATION-TARGET],[utilization-target-type=UTILIZATION-TARGET-TYPE]metricutilization-targetutilization-target-type--update-stackdriver-metric.
--description=DESCRIPTION--min-num-replicas=MIN_NUM_REPLICAS--mode=MODEYou can turn off or restrict a group's autoscaler activities without affecting your autoscaler configuration. The autoscaler configuration persists while the activities are turned off or restricted, and the activities resume when the autoscaler is turned on again or when the restrictions are lifted.
MODE must be one of:
offononly-scale-outonly-uponly-up is deprecated. Use --mode only-scale-out
instead.
--remove-stackdriver-metric=METRIC--scale-based-on-cpu--scale-based-on-load-balancing--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]max-scaled-in-replicasmax-scaled-in-replicas-percenttime-window--set-schedule=SCHEDULE_NAME--stabilization-period=STABILIZATION_PERIOD--stackdriver-metric-filter=FILTER--stackdriver-metric-single-instance-assignment=ASSIGNMENT-stackdriver-metric-utilization-target-type,
-stackdriver-metric-utilization-target-type, and
--custom-metric-utilization.
--stackdriver-metric-utilization-target=TARGET--stackdriver-metric-utilization-target-type.
Mutually exclusive with
--stackdriver-metric-single-instance-assignment and
--custom-metric-utilization.
--stackdriver-metric-utilization-target-type=TARGET_TYPE--stackdriver-metric-utilization-target. Mutually
exclusive with --stackdriver-metric-single-instance-assignment and
--custom-metric-utilization. TARGET_TYPE
must be one of: delta-per-minute, delta-per-second,
gauge.
--target-cpu-utilization=TARGET_CPU_UTILIZATION--target-load-balancing-utilization=TARGET_LOAD_BALANCING_UTILIZATION--update-stackdriver-metric=METRIC--stackdriver-metric-single-instance-assignment or
--stackdriver-metric-utilization-target and
--stackdriver-metric-utilization-target-type. Mutually exclusive
with --custom-metric-utilization.
--region=REGIONA list of regions can be fetched by running:
gcloud compute regions listcompute/region property value for this
command invocation.
--zone=ZONEA list of zones can be fetched by running:
gcloud compute zones listcompute/zone property value for this command
invocation.
--schedule-cron=CRON_EXPRESSION--schedule-description=DESCRIPTION--schedule-duration-sec=DURATION--schedule-min-required-replicas=MIN_REQUIRED_REPLICASAutoscaler provides at least this number of instances when the scaling schedule is active. A managed instance group can have more VMs if there are other scaling schedules 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 instance limits which are always in effect. Autoscaler does not create more than the maximum number of instances configured for a group.--schedule-time-zone=TIME_ZONEIt should be provided as a name from the IANA tz database (for example Europe/Paris or UTC). It automatically adjusts for daylight savings time (DST). If no time zone is provided, UTC is used as a default.
See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the list of valid timezones.--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.
gcloud alpha compute instance-groups managed set-autoscalinggcloud beta compute instance-groups managed set-autoscalinggcloud preview compute instance-groups managed set-autoscaling
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 2026-05-27 UTC.