---
title: "POST /projects/{project}/zones/{zone}/vmExtensionPolicies"
method: POST
path: "/projects/{project}/zones/{zone}/vmExtensionPolicies"
tags: ["zoneVmExtensionPolicies"]
---

# POST /projects/{project}/zones/{zone}/vmExtensionPolicies

`POST /projects/{project}/zones/{zone}/vmExtensionPolicies`

Creates a new zone-level VM extension policy within a project.

## Path parameters

- `project` string, required
- `zone` string, required

## Query parameters

- `requestId` string

## Request body

- VmExtensionPolicy — Represents a VM extension policy.
  - `instanceSelectors` VmExtensionPolicyInstanceSelector[] — Optional. Selectors to target VMs for this policy. VMs are selected if they match *any* of the provided selectors (logical OR). If this list is empty, the policy applies to all VMs.
    - `labelSelector` VmExtensionPolicyLabelSelector — A LabelSelector is applied to a VM only if it matches all the specified labels.
      - `inclusionLabels` object — Optional. A map of key-value pairs representing VM labels. VMs must have all of the labels specified in this map to be selected (logical AND). e.g. If the `inclusion_labels` are {("key1", "value1"), ("key2", "value2")}, the VM labels must contain both ("key1", "value1") and ("key2", "value2") to be selected. If the VM labels are ("key1", "value1") and ("something", "else"), it will not be selected. If the map is empty, it's considered a match.
  - `kind` string — Output only. [Output Only] Type of the resource. Alwayscompute#vmExtensionPolicy.
  - `globalResourceLink` string — Optional. Output only. [Output Only] Link to the global policy that manages this zone policy, if applicable.
  - `updateTimestamp` string — Output only. [Output Only] Update timestamp inRFC3339 text format.
  - `name` string — Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
  - `creationTimestamp` string — Output only. [Output Only] Creation timestamp inRFC3339 text format.
  - `extensionPolicies` object — Required. A map of extension names (for example, "ops-agent") to their corresponding policy configurations.
  - `managedByGlobal` boolean — Optional. Output only. [Output Only] Indicates if this policy is managed by a global policy.
  - `state` 'ACTIVE' | 'DELETING' | 'STATE_UNSPECIFIED' — Optional. Output only. [Output Only] Current state of the policy: ACTIVE or DELETING.
  - `description` string — An optional description of this resource.
  - `selfLink` string — Output only. [Output Only] Server-defined fully-qualified URL for this resource.
  - `priority` integer — Optional. Priority of this policy. Used to resolve conflicts when multiple policies apply to the same extension. The policy priority is an integer from 0 to 65535, inclusive. Lower integers indicate higher priorities. If you do not specify a priority when creating a rule, it is assigned a priority of 1000. If priorities are equal, the policy with the most recent creation timestamp takes precedence.
  - `id` string, uint64 — Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
  - `selfLinkWithId` string — Output only. [Output Only] Server-defined URL for this resource's resource id.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/compute.md) · [All operations](https://skmtc.net/google/apis/compute/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/compute/versions/6120ed8969d4/schema)
