gcloud compute images deprecate

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 deprecate is 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=2d

To 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.STATE must 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 newDEPRECATED resource 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-image or--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 asDELETED.

Note: This is only informational and the image will not be deleted unless youmanually delete it.

For example, specifying30d sets theplannedDELETED time 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.

This flag is mutually exclusive with--delete-on.

--delete-on=DELETE_ON
Specifies a date when the image should be marked asDELETED.

Note: 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 likeYYYY-MM-DDTHH:MM:SSZ. For example:2020-01-02T00:00:00Z for midnight on January 2, 2020 in UTC.

At most one of these can be specified:
--deprecate-in=DEPRECATE_IN
Specifies a time duration in which the image should be marked asDEPRECATED.

Note: 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, specifying30d sets theplannedDEPRECATED date 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.

--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 likeYYYY-MM-DDTHH:MM:SSZ. For example:2020-01-02T00:00:00Z for midnight on January 2, 2020 in UTC.

At most one of these can be specified:
--obsolete-in=OBSOLETE_IN
Specifies a time duration in which the image should be marked asOBSOLETE.

Note: 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, specifying30d sets theplannedOBSOLETE time 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-on=OBSOLETE_ON
Specifies a date when the image should be marked asOBSOLETE.

Note: 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 likeYYYY-MM-DDTHH:MM:SSZ. For example:2020-01-02T00:00:00Z for midnight on January 2, 2020 in UTC.

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 help for details.

NOTES
These variants are also available:
gcloudalphacomputeimagesdeprecate
gcloudbetacomputeimagesdeprecate

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.