gcloud compute zone-vm-extension-policies create NAME --extensions=EXTENSION_NAME,[…] [--config=KEY=VALUE,[KEY=VALUE,…]] [--config-from-file=KEY=FILE_PATH,[…]] [--description=DESCRIPTION] [--inclusion-labels=INCLUSION_LABELS] [--priority=PRIORITY; default=1000] [--version=KEY=VALUE,[KEY=VALUE,…]] [--zone=ZONE] [GCLOUD_WIDE_FLAG …]
gcloud compute zone-vm-extension-policies create test-policy-name --description="test policy" --extensions=extension1,extension2 --version=extension1=version1,extension2=version2 --config=extension1="config1",extension2="config2" --inclusion-labels=env=prod --inclusion-labels=env=preprod,workload=load-test --priority=1000Available extensions: ops-agent google-cloud-sap-extension google-cloud-workload-extension
NAME--extensions=EXTENSION_NAME,[…]--config=KEY=VALUE,[KEY=VALUE,…]E.g. --config=filestore='filestore config',ops-agent='ops agent config'
Raises: ArgumentTypeError: If the extension name is not specified in the --extensions flag.--config-from-file=KEY=FILE_PATH,[…]--description=DESCRIPTION--inclusion-labels=INCLUSION_LABELSThe expected format for a single selector is "key1=value1,key2=value2". A VM is selected if it has ALL the inclusion labels.
When the option is specified multiple times, it assumes a logical OR between the selectors.
For example, if the inclusion labels are ["env=prod,workload=frontend", "workload=backend"], the following VMs will be selected:
--priority=PRIORITY; default=1000--version=KEY=VALUE,[KEY=VALUE,…]E.g. --version=filestore=123ABC,ops-agent=456DEF
Raises: ArgumentTypeError: If the extension name is not specified in the --extensions flag.--zone=ZONEcompute/zone property isn't set, you might
be prompted to select a zone (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
property:
compute/zone
gcloud config set compute/zone ZONEA list of zones can be fetched by running:
gcloud compute zones listTo unset the property, run:
gcloud config unset compute/zoneCLOUDSDK_COMPUTE_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 zone-vm-extension-policies creategcloud beta compute zone-vm-extension-policies create
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.