0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00
terraform-provider-proxmox/docs/resources/virtual_environment_vm2.md
Pavel Boldyrev e3dd31f55e
chore(vm2): add datasource implementation (#1318)
* chore(vm2): add datasource implementation

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-22 02:06:41 +00:00

5.1 KiB
Raw Blame History

layout title parent subcategory description
page proxmox_virtual_environment_vm2 Resources Virtual Environment This is an experimental implementation of a Proxmox VM resource using Plugin Framework.It is a Proof of Concept, highly experimental and will change in future. It does not support all features of the Proxmox API for VMs and MUST NOT be used in production.

Resource: proxmox_virtual_environment_vm2

!> DO NOT USE This is an experimental implementation of a Proxmox VM resource using Plugin Framework.

It is a Proof of Concept, highly experimental and will change in future. It does not support all features of the Proxmox API for VMs and MUST NOT be used in production.

-> Many attributes are marked as optional and computed in the schema, hence you may seem added to the plan with "(known after apply)" status, even if they are not set in the configuration. This is done to support the clone operation, when a VM is created from an existing VM or template, and the source attributes are copied to the clone.

Computed attributes allow the provider to set those attributes without user input. The attributes are also marked as optional to allow the practitioner to set (or overwrite) them if needed.

Schema

Required

  • node_name (String) The name of the node where the VM is provisioned.

Optional

  • clone (Attributes) The cloning configuration. (see below for nested schema)
  • cpu (Attributes) The CPU configuration. (see below for nested schema)
  • description (String) The description of the VM.
  • id (Number) The unique identifier of the VM in the Proxmox cluster.
  • name (String) The name of the VM. Doesn't have to be unique.
  • tags (Set of String) The tags assigned to the VM.
  • template (Boolean) Set to true to create a VM template.
  • timeouts (Attributes) (see below for nested schema)

Nested Schema for clone

Required:

  • id (Number) The ID of the VM to clone.

Optional:

  • retries (Number) The number of retries to perform when cloning the VM (default: 3).

Nested Schema for cpu

Optional:

  • affinity (String) The CPU cores that are used to run the VMs vCPU. The value is a list of CPU IDs, separated by commas. The CPU IDs are zero-based. For example, 0,1,2,3 (which also can be shortened to 0-3) means that the VMs vCPUs are run on the first four CPU cores. Setting affinity is only allowed for root@pam authenticated user.
  • architecture (String) The CPU architecture <aarch64 | x86_64> (defaults to the host). Setting affinity is only allowed for root@pam authenticated user.
  • cores (Number) The number of CPU cores per socket (defaults to 1).
  • flags (Set of String) Set of additional CPU flags. Use +FLAG to enable, -FLAG to disable a flag. Custom CPU models can specify any flag supported by QEMU/KVM, VM-specific flags must be from the following set for security reasons: pcid, spec-ctrl, ibpb, ssbd, virt-ssbd, amd-ssbd, amd-no-ssb, pdpe1gb, md-clear, hv-tlbflush, hv-evmcs, aes.
  • hotplugged (Number) The number of hotplugged vCPUs (defaults to 0).
  • limit (Number) Limit of CPU usage (defaults to 0 which means no limit).
  • numa (Boolean) Enable NUMA (defaults to false).
  • sockets (Number) The number of CPU sockets (defaults to 1).
  • type (String) Emulated CPU type, it's recommended to use x86-64-v2-AES or higher (defaults to kvm64). See https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_virtual_machines_settings for more information.
  • units (Number) CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs.

Nested Schema for timeouts

Optional:

  • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
  • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
  • read (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
  • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).