it took me a while to get this lab working through the console. I fix my issue just by setting the metadata "lab-logs-bucket" directly at the VM level when creating it rather than at the GCE service level.
But the documentation says for the metadata set at the GCE service level "All instances in this project inherit these key-value pairs".
Are any special permissions required ? But it shouldn’t because it says the VM inherit these metadata…
Or is the URL to access these metadata different than "http://metadata.google.internal/computeMetadata/v1/instance/attributes/" ?
I don’t understand what I did wrong.
Thank you in advance
This is an interesting question. When you’re using project-wide metadata, things are slightly different.
Following Mattias, let’s break this down, and look at the elements of the situation:
When you’re using the URL
http://metadata.google.internal/computeMetadata/v1/instance/attributes/lab-logs-bucket, you can break that path down into a logical sentence, like "I need the
lab-logs-bucket attribute from the list of
attributes from this
v1 of the
computeMetadata". When we set the metadata for an instance, this path works. But not when we use the project-wide metadata. If the information is not populating automatically, do we need to use a different URL?
Check out Google’s Storing and retrieving instance metadata for the full information, and the final answer
I know this isn’t the direct answer, but hope this helps you find the answer is just within your grasp