gcloud beta compute os-config os-upgrade Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta compute os-config os-upgrade - upgrade the instances OS version
- SYNOPSIS
gcloud beta compute os-config os-upgradeINSTANCE_NAME--source-os=SOURCE_OS--target-os=TARGET_OS[--async][--auto-rollback][--no-create-machine-backup][--log-location=LOG_LOCATION][--timeout=TIMEOUT; default="2h"][--zone=ZONE][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)gcloud beta compute os-config os-upgradeupgrades the instance's OS version.OS Upgrade involves:
- Create a snapshot and/or machine image for the instance.
- Create an install media disk and attach it to the instance.
- Upgrade the OS version.
- Cleanup install media disk after upgrade.
Virtual instances, snapshots, machine images, and disks in Compute Engine andfiles stored on Cloud Storage incur charges. Seehttps://cloud.google.com/compute/docs/images/importing-virtual-disks#resource_cleanup.
- EXAMPLES
- To upgrade a instance named
my-instancefrom windows-2008r2 towindows-2012r2, run:gcloudbetacomputeos-configos-upgrademy-instance--source-os=windows-2008r2--target-os=windows-2012r2 - POSITIONAL ARGUMENTS
INSTANCE_NAME- Name of the instance to os-upgrade. For details on valid instance names, referto the criteria documented under the field 'name' at:https://cloud.google.com/compute/docs/reference/rest/v1/instances
- REQUIRED FLAGS
--source-os=SOURCE_OS- OS version of the source instance to upgrade.
SOURCE_OSmust be (only one value is supported):windows-2008r2. --target-os=TARGET_OS- Version of the OS after upgrade.
TARGET_OSmust be (onlyone value is supported):windows-2012r2.
- OPTIONAL FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
--auto-rollback- When auto rollback is enabled, the instance and its resources are restored totheir original state. Otherwise, the instance and any temporary resources areleft in the intermediate state of the time of failure. This is useful fordebugging.
--create-machine-backup- When enabled, a machine image is created that backs up the original state ofyour instance. Enabled by default, use
--no-create-machine-backupto disable. --log-location=LOG_LOCATION- Directory in Cloud Storage to hold build logs. If not set,
gs://<project num>.cloudbuild-logs.googleusercontent.com/iscreated and used. --timeout=TIMEOUT; default="2h"- Maximum time an upgrade can last before it fails as "TIMEOUT". For example, ifyou specify
2h, the process fails after 2 hours. See $gcloud topic datetimes forinformation about duration formats.This timeout option has a maximum value of 24 hours.
--zone=ZONE- Zone of the instance to os-upgrade. If not specified and the
property isn't set, you mightbe prompted to select a zone (interactive mode only).compute/zoneTo avoid prompting when this flag is omitted, you can set the
property:compute/zonegcloudconfigsetcompute/zoneZONEA list of zones can be fetched by running:
gcloudcomputezoneslistTo unset the property, run:
gcloudconfigunsetcompute/zoneAlternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE
- 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
- This command is currently in beta and might change without notice. This variantis also available:
gcloudalphacomputeos-configos-upgrade
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.