Machine image older than 2 hours for specific Instance

Can we have gcloud command which will list the machine image based on VM names and time duration.

Solved Solved
1 1 185
1 ACCEPTED SOLUTION

Hello @gcloudLearning,

Welcome to Google Cloud Community!

Upon further checking, the feature you wanted is not yet supported. You may submit your query as a Feature Request in the Public Issue Tracker. However, for feature requests there is no guarantee of any time frame for updates or that the requested feature will be implemented. You can use the ff gcloud commands instead.

To list all images in your project in table form, run:

gcloud compute images list 

To list the names of images older than 1 year from oldest to newest (-P1Y is an ISO8601 duration)

gcloud compute images list --format="value(NAME)" --filter="creationTimestamp < -P1Y" 

This document might also be helpful for you.

Thanks!

View solution in original post

1 REPLY 1

Hello @gcloudLearning,

Welcome to Google Cloud Community!

Upon further checking, the feature you wanted is not yet supported. You may submit your query as a Feature Request in the Public Issue Tracker. However, for feature requests there is no guarantee of any time frame for updates or that the requested feature will be implemented. You can use the ff gcloud commands instead.

To list all images in your project in table form, run:

gcloud compute images list 

To list the names of images older than 1 year from oldest to newest (-P1Y is an ISO8601 duration)

gcloud compute images list --format="value(NAME)" --filter="creationTimestamp < -P1Y" 

This document might also be helpful for you.

Thanks!

Top Labels in this Space