VmExtensionPolicy

Represents a VM extension policy.

JSON representation
{
  "kind": string,
  "id": string,
  "creationTimestamp": string,
  "updateTimestamp": string,
  "name": string,
  "description": string,
  "selfLink": string,
  "selfLinkWithId": string,
  "extensionPolicies": {
    string: {
      object (ExtensionPolicy)
    },
    ...
  },
  "instanceSelectors": [
    {
      object (InstanceSelector)
    }
  ],
  "priority": integer,
  "managedByGlobal": boolean,
  "globalResourceLink": string,
  "state": enum (State)
}
Fields
kind

string

[Output Only] Type of the resource. Always

compute#vmExtensionPolicy

.

id

string (uint64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

updateTimestamp

string

[Output Only] Update timestamp in RFC3339 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 with RFC1035. 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.

description

string

An optional description of this resource.

extensionPolicies

map (key: string, value: object (ExtensionPolicy))

Required. A map of extension names (for example, "ops-agent") to their corresponding policy configurations.

instanceSelectors[]

object (InstanceSelector)

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.

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.

managedByGlobal

boolean

Optional. [Output Only] Indicates if this policy is managed by a global policy.

state

enum (State)

Optional. [Output Only] Current state of the policy: ACTIVE or DELETING.

ExtensionPolicy

Configuration for a specific VM extension.

JSON representation
{
  "pinnedVersion": string,

  // Union field config can be only one of the following:
  "stringConfig": string
  // End of list of possible types for union field config.
}
Fields
pinnedVersion

string

Optional. The specific version of the extension to install. If not set, the latest version is used.

Union field config. Additional configuration data passed to the extension on each VM start. config can be only one of the following:
stringConfig

string

Optional. String-based configuration data for the extension.

InstanceSelector

Defines how to select VMs to apply a zone VM extension policy.

JSON representation
{

  // Union field selector_type can be only one of the following:
  "labelSelector": {
    object (LabelSelector)
  }
  // End of list of possible types for union field selector_type.
}
Fields
Union field selector_type. Currently, only the LabelSelector is supported. selector_type can be only one of the following:
labelSelector

object (LabelSelector)

Optional. LabelSelector selects VMs based on their labels.

LabelSelector

A LabelSelector is applied to a VM only if it matches all the specified labels.

JSON representation
{
  "inclusionLabels": {
    string: string,
    ...
  }
}
Fields
inclusionLabels

map (key: string, value: string)

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 inclusionLabels 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.

State

Enums
STATE_UNSPECIFIED Default value. Do not use.
ACTIVE The policy is active and applied to matching VMs. Newly created VMs that match the policy will also receive the extension policy.
DELETING The policy is in the process of being deleted. After the extension is removed from all matching VMs, the policy will be deleted.