- NAME
-
- gcloud alpha compute os-config os-upgrade - upgrade the instances OS version
- SYNOPSIS
-
-
gcloud alpha 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
-
(ALPHA)gcloud alpha 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 and files stored on Cloud Storage incur charges. See https://cloud.google.com/compute/docs/images/importing-virtual-disks#resource_cleanup.
- EXAMPLES
-
To upgrade a instance named
my-instancefrom windows-2008r2 to windows-2012r2, run:gcloud alpha compute os-config os-upgrade my-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, refer to 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 (only one 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 to their original state. Otherwise, the instance and any temporary resources are left in the intermediate state of the time of failure. This is useful for debugging.
--create-machine-backup-
When enabled, a machine image is created that backs up the original state of
your 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/is created and used. --timeout=TIMEOUT; default="2h"-
Maximum time an upgrade can last before it fails as "TIMEOUT". For example, if
you specify
2h, the process fails after 2 hours. See $ gcloud topic datetimes for information 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 might be prompted to select a zone (interactive mode only).compute/zoneTo avoid prompting when this flag is omitted, you can set the
property:compute/zonegcloud config set compute/zone ZONEA list of zones can be fetched by running:
gcloud compute zones listTo unset the property, run:
gcloud config unset compute/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 alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation-only early access
allowlist. This variant is also available:
gcloud beta compute os-config os-upgrade
gcloud alpha compute os-config os-upgrade
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.