1 Answers
Hi,
Nevermind. In the scenario described in the question I was actually logged out of "myhappyvm" instance. I saw that I still have to be ssh-ed into the actual VM to view the metadata shown in the video. I thought that the metadata can be queried by the Cloud Shell too.
I have manually set the project metadata via command: gcloud compute project-info add-metadata –metadata google-compute-default-region=us-west2,google-compute-default-zone=us-west2-b. When I use the curl command to view the project specific metadata that I have set it comes empty – curl "http://metadata.google.internal/computeMetadata/v1/project/attributes/" -H "Metadata-Flavor: Google". What I have understood after reading documentation for nearly an hour is that the curl command can be used to query only instance specific metadata and not project metadata. So, the only way to get the project metadata is run – gcloud compute project-info describe. Please confirm if my understanding is correct. Thanks.