gcloud compute project-zonal-metadata add --metadata=KEY=VALUE,[KEY=VALUE,…] --zone=ZONE [GCLOUD_WIDE_FLAG …]
gcloud compute project-zonal-metadata add is used to add or update
project zonal metadata for your VM instances. Project zonal metadata values
propagate to all VMs within the specified zone. Every VM has access to a
metadata server that you can use to query the configured project zonal metadata
values. To set metadata for individual instances, use gcloud compute
instances add-metadata. For information about metadata, see https://cloud.google.com/compute/docs/metadata.
Only the metadata keys that you provide in the command get mutated. All other
existing metadata entries remain the same.
us-central1-a for the project
my-gcp-project, run:
gcloud compute project-zonal-metadata add --metadata=key=value --zone=us-central1-a --project=my-gcp-project--metadata=KEY=VALUE,[KEY=VALUE,…]--zone=ZONE--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha compute project-zonal-metadata addgcloud beta compute project-zonal-metadata addgcloud preview compute project-zonal-metadata add
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.