Rohith
Rohith

Reputation: 1167

GCP : gcloud :List all instances along with their tag names

I am executing the below command to get the list of all instances in a GCP project, but this doesn't display the tags attached to the VMs..! FYI..

gcloud compute instances list

Could you please help here..!

Regards, Rohith

Upvotes: 10

Views: 17531

Answers (1)

Akash Kashyap
Akash Kashyap

Reputation: 296

Get the detailed output using gcloud topic formats:

gcloud compute instances list --format=json

Or

gcloud compute instances list --format='table(name,status,tags.list())'

Upvotes: 14

Related Questions