gcloud compute images deprecate IMAGE_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 …]
gcloud compute images deprecate is used to deprecate images.
gcloud compute images deprecate IMAGE --state=DEPRECATED --obsolete-in=1d --delete-in=2dTo un-deprecate an image called 'IMAGE' and clear times for deprecated, obsoleted, and deleted, use:
gcloud compute images deprecate IMAGE --state=ACTIVEIMAGE_NAME--state=STATESTATE must be
one of:
ACTIVEDELETEDDEPRECATEDDEPRECATED resource return
successfully, but with a warning indicating that the image is deprecated and
recommending its replacement.
OBSOLETE--replacement=REPLACEMENT--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_INDELETED.
Note: This is only informational and the image will not be deleted unless you manually delete it.
For example, specifying sets the
planned 30d time to 30 days from the
current system time, but does not delete the image. You must manually delete the
image in 30 days. See $ gcloud
topic datetimes for information on duration formats.
DELETED
--delete-on.
--delete-on=DELETE_ONDELETED.
Note: This is only informational and the image will not be deleted unless you manually delete it.
This flag is mutually exclusive with --delete-in.
YYYY-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_INDEPRECATED.
Note: This is only informational and the image will not be deprecated unless you manually deprecate it.
This flag is mutually exclusive with --deprecate-on.
30d sets the
planned DEPRECATED date to 30 days from the
current system time, but does not deprecate the image. You must manually
deprecate the image in 30 days. See $ gcloud topic datetimes for
information on duration formats.
--deprecate-on=DEPRECATE_ONNote: This is only informational and the image will not be deprecated unless you manually deprecate it.
This flag is mutually exclusive with --deprecate-in.
YYYY-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_INOBSOLETE.
Note: This is only informational and the image will not be obsoleted unless you manually obsolete it.
This flag is mutually exclusive with --obsolete-on.
30d sets the
planned OBSOLETE time to 30 days from the
current system time, but does not obsolete the image. You must manually obsolete
the image in 30 days. See $ gcloud topic datetimes for
information on duration formats.
--obsolete-on=OBSOLETE_ONOBSOLETE.
Note: This is only informational and the image will not be obsoleted unless you manually obsolete it.
This flag is mutually exclusive with --obsolete-in.
YYYY-MM-DDTHH:MM:SSZ. For example:
2020-01-02T00:00:00Z for midnight on January 2, 2020 in UTC.
--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 images deprecategcloud beta compute images deprecategcloud preview compute images deprecate
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 2026-05-27 UTC.