I have a machine image called client-template, so that the output of
gcloud compute machine-images list is:
NAME: client-template
STATUS: READY
However, my attempt to delete this image:
gcloud compute images delete client-template
results in the error:
ERROR: (gcloud.beta.compute.images.delete) Could not fetch resource:
- The resource 'projects/myproject/global/images/client-template' was not found
I see that it is trying to find the image in global/images/, whereas when I use this image to create an instance, I have to use global/machineImages/. I tried to specify the name along with the path on the command line, but it does not match the regular expression for the names of the images. The documentation does not seem to provide any hint.
The command is part of an automation script, so I cannot just remove the image using the web interface.
So, how do I fix my command to delete this machine image?
Hi,
Above you reference "gcloud compute images delete client-template", have you tried "gcloud compute machine-images delete client-template".
Best,
Alex