gcloud compute global-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] [--rollout-conflict-behavior=ROLLOUT_CONFLICT_BEHAVIOR] [--rollout-custom-plan=ROLLOUT_CUSTOM_PLAN] [--rollout-predefined-plan=ROLLOUT_PREDEFINED_PLAN] [--version=KEY=VALUE,[KEY=VALUE,…]] [GCLOUD_WIDE_FLAG …]
gcloud compute global-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 --rollout-predefined-plan=slow_rollout --priority=1000NAME--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--rollout-conflict-behavior=ROLLOUT_CONFLICT_BEHAVIORThe possible values are:
"": The zonal policy value is used in case of a conflict. This is
the default behavior.
overwrite: The global policy overwrites the zonal policy.
--rollout-conflict-behavior to overwrite
and want to revert to the default behavior, use the update command and omit the
--rollout-conflict-behavior flag.
--rollout-custom-plan=ROLLOUT_CUSTOM_PLAN--rollout-predefined-plan=ROLLOUT_PREDEFINED_PLANOne of either --rollout-predefined-plan or --rollout-custom-plan must be specified, but not both.
ROLLOUT_PREDEFINED_PLAN must be one of:
fast_rollout, slow_rollout.
--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.--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 global-vm-extension-policies creategcloud beta compute global-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.