Stay organized with collections Save and categorize content based on your preferences.
gcloud compute instances set-scheduling
INSTANCE_NAME
[--clear-min-node-cpu
] [--host-error-timeout-seconds
=HOST_ERROR_TIMEOUT_SECONDS
] [--local-ssd-recovery-timeout
=LOCAL_SSD_RECOVERY_TIMEOUT
] [--maintenance-policy
=MAINTENANCE_POLICY
] [--min-node-cpu
=MIN_NODE_CPU
] [--[no-]preemptible
] [--provisioning-model
=PROVISIONING_MODEL
] [--[no-]restart-on-failure
] [--zone
=ZONE
] [--clear-discard-local-ssds-at-termination-timestamp
| --discard-local-ssds-at-termination-timestamp
=DISCARD_LOCAL_SSDS_AT_TERMINATION_TIMESTAMP
] [--clear-instance-termination-action
| --instance-termination-action
=INSTANCE_TERMINATION_ACTION
] [--clear-max-run-duration
| --max-run-duration
=MAX_RUN_DURATION
] [--clear-node-affinities
| --node
=NODE
| --node-affinity-file
=PATH_TO_FILE
| --node-group
=NODE_GROUP
] [--clear-termination-time
| --termination-time
=TERMINATION_TIME
] [GCLOUD_WIDE_FLAG …
]
$gcloud compute instances set-scheduling
is used to update scheduling options for VM instances. You can only call this method on a VM instance that is stopped (a VM instance in a TERMINATED
state).
gcloud compute instances set-scheduling example-instance --maintenance-policy=TERMINATE --zone=us-central1-b
INSTANCE_NAME
--clear-min-node-cpu
--host-error-timeout-seconds
=HOST_ERROR_TIMEOUT_SECONDS
--local-ssd-recovery-timeout
=LOCAL_SSD_RECOVERY_TIMEOUT
--maintenance-policy
=MAINTENANCE_POLICY
MAINTENANCE_POLICY
must be one of:
MIGRATE
TERMINATE
--min-node-cpu
=MIN_NODE_CPU
--[no-]preemptible
--preemptible
to enable and --no-preemptible
to disable.
--provisioning-model
=PROVISIONING_MODEL
PROVISIONING_MODEL
must be one of:
RESERVATION_BOUND
SPOT
STANDARD
--[no-]restart-on-failure
--restart-on-failure
to enable and --no-restart-on-failure
to disable.
--zone
=ZONE
gcloud
attempts to identify the appropriate zone by searching for resources in your currently active project. If the zone cannot be determined, gcloud
prompts you for a selection with all available Google Cloud Platform zones.
To avoid prompting when this flag is omitted, the user can set the
property:compute/zone
gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
gcloud compute zones list
To unset the property, run:
gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE
At most one of these can be specified:
--clear-discard-local-ssds-at-termination-timestamp
--discard-local-ssds-at-termination-timestamp
=DISCARD_LOCAL_SSDS_AT_TERMINATION_TIMESTAMP
true
and only allowed for VMs that have one or more local SSDs, use --instance-termination-action=STOP, and use either --max-run-duration or --termination-time.
This flag indicates the value that you want Compute Engine to use for the --discard-local-ssd
flag in the automatic gcloud compute instances stop
command. This flag only supports the true
value, which discards local SSD data when automatically stopping this VM during its terminationTimestamp
.
For more information about the --discard-local-ssd
flag, see https://cloud.google.com/compute/docs/disks/local-ssd#stop_instance.
At most one of these can be specified:
--clear-instance-termination-action
--instance-termination-action
=INSTANCE_TERMINATION_ACTION
INSTANCE_TERMINATION_ACTION
must be one of:
DELETE
STOP
At most one of these can be specified:
--clear-max-run-duration
--max-run-duration
=MAX_RUN_DURATION
30m
for a duration of 30 minutes or specify 1d2h3m4s
for a duration of 1 day, 2 hours, 3 minutes, and 4 seconds. Alternatively, to specify a timestamp, use --termination-time instead.
If neither --max-run-duration nor --termination-time is specified (default), the VM instance runs until prompted by a user action or system event. If either is specified, the VM instance is scheduled to be automatically terminated at the VM's termination timestamp (terminationTimestamp
) using the action specified by --instance-termination-action.
Note: The terminationTimestamp
is removed whenever the VM is stopped or suspended and redefined whenever the VM is rerun. For --max-run-duration specifically, the terminationTimestamp
is the sum of MAX_RUN_DURATION and the time when the VM last entered the RUNNING
state, which changes whenever the VM is rerun.
At most one of these can be specified:
--clear-node-affinities
--node
=NODE
--node-affinity-file
=PATH_TO_FILE
The file should contain a list of a JSON/YAML objects. For an example, see https://cloud.google.com/compute/docs/nodes/provisioning-sole-tenant-vms#configure_node_affinity_labels. The following list describes the fields:
key
operator
IN
: Requires Compute Engine to seek for matched nodes. NOT_IN
: Requires Compute Engine to avoid certain nodes.
values
Use a full or relative path to a local file containing the value of node_affinity_file.
--node-group
=NODE_GROUP
At most one of these can be specified:
--clear-termination-time
--termination-time
=TERMINATION_TIME
If neither --termination-time nor --max-run-duration is specified (default), the VM instance runs until prompted by a user action or system event. If either is specified, the VM instance is scheduled to be automatically terminated at the VM's termination timestamp (terminationTimestamp
) using the action specified by --instance-termination-action.
Note: The terminationTimestamp
is removed whenever the VM is stopped or suspended and redefined whenever the VM is rerun. For --termination-time specifically, the terminationTimestamp
remains the same whenever the VM is rerun, but any requests to rerun the VM fail if the specified timestamp is in the past.
--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 instances set-scheduling
gcloud beta compute instances set-scheduling
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-07 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4