gcloud compute resource-policies create workload-policy Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud compute resource-policies create workload-policy - create a Compute Engine workload resource policy
- SYNOPSIS
gcloud compute resource-policies create workload-policyNAME--type=TYPE[--description=DESCRIPTION][--region=REGION][--accelerator-topology=ACCELERATOR_TOPOLOGY|--max-topology-distance=MAX_TOPOLOGY_DISTANCE][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- Create a Compute Engine workload resource policy.
- EXAMPLES
- To create a workload policy:
gcloudcomputeresource-policiescreateworkload-policyNAME--type=TYPE - POSITIONAL ARGUMENTS
NAME- Name of the resource policy to operate on.
- REQUIRED FLAGS
--type=TYPE- Type of the workload policy defining the high-level intent of the cluster.
TYPEmust be one of:HIGH_AVAILABILITY- For workloads that aim to be highly available. Common examples are web / MLserving, or distributed database clusters. Compute Engine spreads VMs atbest-effort to improve reliability of the distributed infrastructure.
HIGH_THROUGHPUT- For high throughput distributed workloads eg. HPC or ML training. Compute Enginecollocates VMs at best-effort to reduce network latency between VMs.
- OPTIONAL FLAGS
--description=DESCRIPTION- An optional, textual description for the backend.
--region=REGION- Region of the resource policy to operate on. If not specified, you might beprompted to select a region (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
property:compute/regiongcloudconfigsetcompute/regionREGIONA list of regions can be fetched by running:
gcloudcomputeregionslistTo unset the property, run:
gcloudconfigunsetcompute/regionAlternatively, the region can be stored in the environment variable
.CLOUDSDK_COMPUTE_REGION - At most one of these can be specified:
--accelerator-topology=ACCELERATOR_TOPOLOGY- Specifies the topology of placement and interconnection performance required tocreate a slice of VMs with interconnected accelerators.
--max-topology-distance=MAX_TOPOLOGY_DISTANCE- Specifies the topology of placement and interconnection network performance ofthe group of VMs (MIG / Multi-MIGs).
MAX_TOPOLOGY_DISTANCEmust be one of:BLOCK- VMs are placed within the same block of capacity with improved latency comparedto Cluster.
CLUSTER- VMs are placed within the same cluster of capacity with improved latency betweenthem.
SUBBLOCK- Tightest collocation of VMs that provides minimized network latency. VMs areplaced within the same rack of capacity with improved latency compared to Block.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--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 helpfor details. - NOTES
- These variants are also available:
gcloudalphacomputeresource-policiescreateworkload-policygcloudbetacomputeresource-policiescreateworkload-policy
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-28 UTC.