Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Metadata Keys usage in startup script

How metadata keys work? Do they look for exact word in the startup script and replace? Are there any restrictions on metadata names allowed?

1 Answers

Metadata in a GCE instance is stored as key:value pairs, same for startup script. Think of it like a huge sidecar JSON file with many entries, and startup script is one of them. When an instance boots up, this specific key for startup script will be inspected and sent to the guest OS for execution. You have a limit of 256 KB in terms of text content for the startup script if it is defined directly on a GCE instance’s metadata (to go over this limit, use a script stored in a GCS bucket).

General limits of metadata in GCE can be found in this article: About VM metadata – Limits

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?