0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 18:42:58 +00:00
terraform-provider-proxmox/docs/resources/virtual_environment_cluster_options.md
Sven Greb 2eb36f4134
feat(cluster): Extend the available attributes for the proxmox_virtual_environment_cluster_options resource (#1241)
This commit implements the `next-id` and `notify` PVE API cluster
options.

The `next-id` attribute allows to control the range for the next free
VM ID. It is implemented as object and can be used in the
`proxmox_virtual_environment_cluster_options` resource and can be used
like this:

```terraform
resource "proxmox_virtual_environment_cluster_options" "options" {
  next_id = {
    lower = 200
    upper = 299
  }
}
```

Note that the minimum and maximum values are unfortunately not
documented in the PVE API explorer but can be found in the web UI where
the form fields have validations!

The `notify` PVE API attribute is also an object that has all the PVE
API fields:

```terraform
resource "proxmox_virtual_environment_cluster_options" "options" {
  notify = {
    ha_fencing_mode            = "never"
    ha_fencing_target          = "default-matcher"
    package_updates            = "always"
    package_updates_target     = "default-matcher"
    package_replication        = "always"
    package_replication_target = "default-matcher"
  }
}
```terraform

Note that the "fencing" attribute names have been adjusted to better
reflect their meaning since they are scoped to the Proxmox VE HA fencing
feature [1]. All attributes with the `_target` suffix are names for the
Proxmox VE notifications matchers [2].

[1]: https://pve.proxmox.com/wiki/Fencing
[2]: https://pve.proxmox.com/pve-docs/chapter-notifications.html#notification_matchers

---------

Signed-off-by: Sven Greb <development@svengreb.de>
2024-04-29 20:08:44 -04:00

4.9 KiB

layout title parent subcategory description
page proxmox_virtual_environment_cluster_options Resources Virtual Environment Manages Proxmox VE Cluster Datacenter options.

Resource: proxmox_virtual_environment_cluster_options

Manages Proxmox VE Cluster Datacenter options.

Example Usage

resource "proxmox_virtual_environment_cluster_options" "options" {
  language                  = "en"
  keyboard                  = "pl"
  email_from                = "ged@gont.earthsea"
  bandwidth_limit_migration = 555555
  bandwidth_limit_default   = 666666
  max_workers               = 5
  migration_cidr            = "10.0.0.0/8"
  migration_type            = "secure"
  next_id = {
    lower = 100
    upper = 999999999
  }
  notify = {
    ha_fencing_mode            = "never"
    ha_fencing_target          = "default-matcher"
    package_updates            = "always"
    package_updates_target     = "default-matcher"
    package_replication        = "always"
    package_replication_target = "default-matcher"
  }
}

Schema

Optional

  • bandwidth_limit_clone (Number) Clone I/O bandwidth limit in KiB/s.
  • bandwidth_limit_default (Number) Default I/O bandwidth limit in KiB/s.
  • bandwidth_limit_migration (Number) Migration I/O bandwidth limit in KiB/s.
  • bandwidth_limit_move (Number) Move I/O bandwidth limit in KiB/s.
  • bandwidth_limit_restore (Number) Restore I/O bandwidth limit in KiB/s.
  • console (String) Select the default Console viewer. Must be applet | vv| html5 | xtermjs. You can either use the builtin java applet (VNC; deprecated and maps to html5), an external virt-viewer compatible application (SPICE), an HTML5 based vnc viewer (noVNC), or an HTML5 based console client (xtermjs). If the selected viewer is not available (e.g. SPICE not activated for the VM), the fallback is noVNC.
  • crs_ha (String) Cluster resource scheduling setting for HA. Must be static | basic (default is basic).
  • crs_ha_rebalance_on_start (Boolean) Cluster resource scheduling setting for HA rebalance on start.
  • description (String) Datacenter description. Shown in the web-interface datacenter notes panel. This is saved as comment inside the configuration file.
  • email_from (String) email address to send notification from (default is root@$hostname).
  • ha_shutdown_policy (String) Cluster wide HA shutdown policy (). Must be freeze | failover | migrate | conditional (default is conditional).
  • http_proxy (String) Specify external http proxy which is used for downloads (example: http://username:password@host:port/).
  • keyboard (String) Default keyboard layout for vnc server. Must be de | de-ch | da | en-gb | en-us | es | fi | fr | fr-be | fr-ca | fr-ch | hu | is | it | ja | lt | mk | nl | no | pl | pt | pt-br | sv | sl | tr.
  • language (String) Default GUI language. Must be ca | da | de | en | es | eu | fa | fr | he | it | ja | nb | nn | pl | pt_BR | ru | sl | sv | tr | zh_CN | zh_TW.
  • mac_prefix (String) Prefix for autogenerated MAC addresses.
  • max_workers (Number) Defines how many workers (per node) are maximal started on actions like 'stopall VMs' or task from the ha-manager.
  • migration_cidr (String) Cluster wide migration network CIDR.
  • migration_type (String) Cluster wide migration type. Must be secure | unsecure (default is secure).
  • next_id (Attributes) The ranges for the next free VM ID auto-selection pool. (see below for nested schema)
  • notify (Attributes) Cluster-wide notification settings. (see below for nested schema)

Read-Only

  • id (String) The unique identifier of this resource.

Nested Schema for next_id

Optional:

  • lower (Number) The minimum number for the next free VM ID. Must be higher or equal to 100
  • upper (Number) The maximum number for the next free VM ID. Must be less or equal to 999999999

Nested Schema for notify

Optional:

  • ha_fencing_mode (String) Cluster-wide notification settings for the HA fencing mode. Must be always | never.
  • ha_fencing_target (String) Cluster-wide notification settings for the HA fencing target.
  • package_updates (String) Cluster-wide notification settings for package updates. Must be auto | always | never.
  • package_updates_target (String) Cluster-wide notification settings for the package updates target.
  • replication (String) Cluster-wide notification settings for replication. Must be always | never.
  • replication_target (String) Cluster-wide notification settings for the replication target.

Import

Import is supported using the following syntax:

#!/usr/bin/env sh
# Cluster options are global and can be imported using e.g.:
terraform import proxmox_virtual_environment_cluster_options.options cluster