gcloud compute images deprecate Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud compute images deprecate - manage deprecation status of Compute Engine images
- SYNOPSIS
gcloud compute images deprecateIMAGE_NAME--state=STATE[--replacement=REPLACEMENT][--delete-in=DELETE_IN|--delete-on=DELETE_ON][--deprecate-in=DEPRECATE_IN|--deprecate-on=DEPRECATE_ON][--obsolete-in=OBSOLETE_IN|--obsolete-on=OBSOLETE_ON][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
gcloud compute images deprecateis used to deprecate images.- EXAMPLES
- To deprecate an image called 'IMAGE' immediately, mark it as obsolete in oneday, and mark it as deleted in two days, use:
gcloudcomputeimagesdeprecateIMAGE--state=DEPRECATED--obsolete-in=1d--delete-in=2dTo un-deprecate an image called 'IMAGE' and clear times for deprecated,obsoleted, and deleted, use:
gcloudcomputeimagesdeprecateIMAGE--state=ACTIVE - POSITIONAL ARGUMENTS
IMAGE_NAME- Name of the disk image to operate on.
- REQUIRED FLAGS
--state=STATE- The deprecation state to set on the image.
STATEmust beone of:ACTIVE- The image is currently supported.
DELETED- New uses result in an error. Setting this state will not automatically deletethe image. You must still make a request to delete the image to remove it fromthe image list.
DEPRECATED- Operations which create a new
DEPRECATEDresource returnsuccessfully, but with a warning indicating that the image is deprecated andrecommending its replacement. OBSOLETE- New uses result in an error.
- OPTIONAL FLAGS
--replacement=REPLACEMENT- Specifies a Compute Engine image as a replacement for the image being phasedout. Users of the deprecated image will be advised to switch to thisreplacement. For example,
--replacement example-imageor--replacement projects/google/global/images/example-image.This flag value is purely informational and is not validated in any way.
- At most one of these can be specified:
--delete-in=DELETE_IN- Specifies a time duration in which the image should be marked as
.DELETEDNote: This is only informational and the image will not be deleted unless youmanually delete it.
For example, specifying
sets theplanned30dtime to 30 days from thecurrent system time, but does not delete the image. You must manually delete theimage in 30 days. See $gcloudtopic datetimes for information on duration formats.DELETEDThis flag is mutually exclusive with
--delete-on. --delete-on=DELETE_ON- Specifies a date when the image should be marked as
.DELETEDNote: This is only informational and the image will not be deleted unless youmanually delete it.
This flag is mutually exclusive with
--delete-in.The date and time specified must be valid RFC 3339 full-date or date-time. Fortimes in UTC, this looks like
. For example:2020-01-02T00:00:00Z for midnight on January 2, 2020 in UTC.YYYY-MM-DDTHH:MM:SSZ
- At most one of these can be specified:
--deprecate-in=DEPRECATE_IN- Specifies a time duration in which the image should be marked as
.DEPRECATEDNote: This is only informational and the image will not be deprecated unless youmanually deprecate it.
This flag is mutually exclusive with
--deprecate-on.For example, specifying
sets theplanned30ddate to 30 days from thecurrent system time, but does not deprecate the image. You must manuallydeprecate the image in 30 days. See $gcloud topic datetimes forinformation on duration formats.DEPRECATED --deprecate-on=DEPRECATE_ON- Specifies a date when the image should be marked as DEPRECATED.
Note: This is only informational and the image will not be deprecated unless youmanually deprecate it.
This flag is mutually exclusive with
--deprecate-in.The date and time specified must be valid RFC 3339 full-date or date-time. Fortimes in UTC, this looks like
. For example:2020-01-02T00:00:00Z for midnight on January 2, 2020 in UTC.YYYY-MM-DDTHH:MM:SSZ
- At most one of these can be specified:
--obsolete-in=OBSOLETE_IN- Specifies a time duration in which the image should be marked as
.OBSOLETENote: This is only informational and the image will not be obsoleted unless youmanually obsolete it.
This flag is mutually exclusive with
--obsolete-on.For example, specifying
sets theplanned30dtime to 30 days from thecurrent system time, but does not obsolete the image. You must manually obsoletethe image in 30 days. See $gcloud topic datetimes forinformation on duration formats.OBSOLETE --obsolete-on=OBSOLETE_ON- Specifies a date when the image should be marked as
.OBSOLETENote: This is only informational and the image will not be obsoleted unless youmanually obsolete it.
This flag is mutually exclusive with
--obsolete-in.The date and time specified must be valid RFC 3339 full-date or date-time. Fortimes in UTC, this looks like
. For example:2020-01-02T00:00:00Z for midnight on January 2, 2020 in UTC.YYYY-MM-DDTHH:MM:SSZ
- 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
- These variants are also available:
gcloudalphacomputeimagesdeprecategcloudbetacomputeimagesdeprecate
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.