Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 224
Rohith Avatar asked Jun 20 '18 11:06

Rohith


1 Answers

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())'
like image 182
Akash Kashyap Avatar answered Oct 25 '22 03:10

Akash Kashyap