* feat(vm): add RNG device support This commit adds support for configuring the Random Number Generator (RNG) device for virtual machines in both the VM resource and datasource. The implementation includes: - New schema and model for RNG configuration - Support for setting RNG source, max_bytes, and period - Updated documentation for RNG configuration - Test cases for RNG configuration - Integration with VM creation, update, and read operations --------- Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
7.8 KiB
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
cdrom
(Attributes Map) The CD-ROM configuration. The key is the interface of the CD-ROM, could be one ofideN
,sataN
,scsiN
, where N is the index of the interface. Note thatq35
machine type only supportside0
andide2
of IDE interfaces. (see below for nested schema)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.rng
(Attributes) Configure the RNG (Random Number Generator) device. The RNG device provides entropy to guests to ensure good quality random numbers for guest applications that require them. Can only be set byroot@pam.
See the Proxmox documentation for more information. (see below for nested schema)stop_on_destroy
(Boolean) Set to true to stop (rather than shutdown) the VM on destroy (defaults tofalse
).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)vga
(Attributes) Configure the VGA Hardware. If you want to use high resolution modes (>= 1280x1024x16) you may need to increase the vga memory option. Since QEMU 2.9 the default VGA display type isstd
for all OS types besides some Windows versions (XP and older) which usecirrus
. Theqxl
option enables the SPICE display server. For win* OS you can select how many independent displays you want, Linux guests can add displays themself. You can also run without any graphic card, using a serial device as terminal. See the Proxmox documentation section 10.2.8 for more information and available configuration parameters. (see below for nested schema)
Nested Schema for cdrom
Optional:
file_id
(String) The file ID of the CD-ROM, orcdrom|none
. Defaults tonone
to leave the CD-ROM empty. Usecdrom
to connect to the physical drive.
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 VM’s 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 to0-3
) means that the VM’s vCPUs are run on the first four CPU cores. Settingaffinity
is only allowed forroot@pam
authenticated user.architecture
(String) The CPU architecture<aarch64 | x86_64>
(defaults to the host). Settingaffinity
is only allowed forroot@pam
authenticated user.cores
(Number) The number of CPU cores per socket (defaults to1
).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 to0
).limit
(Number) Limit of CPU usage (defaults to0
which means no limit).numa
(Boolean) Enable NUMA (defaults tofalse
).sockets
(Number) The number of CPU sockets (defaults to1
).type
(String) Emulated CPU type, it's recommended to usex86-64-v2-AES
or higher (defaults tokvm64
). 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 rng
Optional:
max_bytes
(Number) Maximum bytes of entropy allowed to get injected into the guest every period. Use 0 to disable limiting (potentially dangerous).period
(Number) Period in milliseconds to limit entropy injection to the guest. Use 0 to disable limiting (potentially dangerous).source
(String) The file on the host to gather entropy from. In most cases,/dev/urandom
should be preferred over/dev/random
to avoid entropy-starvation issues on the host.
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).
Nested Schema for vga
Optional:
clipboard
(String) Enable a specific clipboard. If not set, depending on the display type the SPICE one will be added. Currently onlyvnc
is available. Migration with VNC clipboard is not supported by Proxmox.memory
(Number) The VGA memory in megabytes (4-512 MB). Has no effect with serial display.type
(String) The VGA type (defaults tostd
).