0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00

fix(docs): document specifics of "ballooning device" in the `vm.memor… (#1550)

fix(docs): document specifics of "ballooning device" in the `vm.memory` block

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2024-09-23 20:12:20 -04:00 committed by GitHub
parent 40373922fc
commit 0b29ae281e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,6 +35,16 @@ resource "proxmox_virtual_environment_vm" "ubuntu_vm" {
down_delay = "60"
}
cpu {
cores = 2
type = "x86-64-v2-AES" # recommended for modern CPUs
}
memory {
dedicated = 2048
floating = 2048 # set equal to dedicated to enable ballooning
}
disk {
datastore_id = "local-lvm"
file_id = proxmox_virtual_environment_download_file.latest_ubuntu_22_jammy_qcow2_img.id
@ -405,17 +415,16 @@ output "ubuntu_vm_public_key" {
- `pc` - Standard PC (i440FX + PIIX, 1996).
- `q35` - Standard PC (Q35 + ICH9, 2009).
- `memory` - (Optional) The memory configuration.
- `dedicated` - (Optional) The dedicated memory in megabytes (defaults
to `512`).
- `floating` - (Optional) The floating memory in megabytes (defaults
to `0`).
- `dedicated` - (Optional) The dedicated memory in megabytes (defaults to `512`).
- `floating` - (Optional) The floating memory in megabytes. The default is `0`, which disables "ballooning device" for the VM.
Please note that Proxmox has ballooning enabled by default. To enable it, set `floating` to the same value as `dedicated`.
See [Proxmox documentation](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_memory) section 10.2.6 for more information.
- `shared` - (Optional) The shared memory in megabytes (defaults to `0`).
- `hugepages` - (Optional) Enable/disable hugepages memory (defaults to disable).
- `2` - 2MB hugepages.
- `1024` - 1GB hugepages.
- `any` - Any hugepages.
- `keep_hugepages` - (Optional) Keep hugepages memory after the VM is stopped (defaults
to `false`).
- `keep_hugepages` - (Optional) Keep hugepages memory after the VM is stopped (defaults to `false`).
Settings `hugepages` and `keep_hugepages` are only allowed for `root@pam` authenticated user.
And required `cpu.numa` to be enabled.
@ -545,7 +554,7 @@ output "ubuntu_vm_public_key" {
- `vmware` - VMware Compatible.
- `clipboard` - (Optional) Enable VNC clipboard by setting to `vnc`. See the [Proxmox documentation](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_virtual_machines_settings) section 10.2.8 for more information.
- `vm_id` - (Optional) The VM identifier.
- `hook_script_file_id` - (Optional) The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute).
- `hook_script_file_id` - (Optional) The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute).
## Attribute Reference
@ -690,14 +699,13 @@ resource "proxmox_virtual_environment_vm" "data_user_vm" {
## Example: Disk pass-through
You can attach another physical disk from the PVE host to a VM.
You can attach another physical disk from the PVE host to a VM.
This is done by setting the `path_in_datastore` to the path of the block device on the host.
~> **Experimental** Please test your configuration first in an environment where you can tolerate the potential data loss.
~> Do *not* attach the same disk to more than one VM as it may cause data corruption.
```hcl
resource "proxmox_virtual_environment_vm" "test_vm" {
...
@ -718,7 +726,6 @@ resource "proxmox_virtual_environment_vm" "test_vm" {
}
```
## Import
Instances can be imported using the `node_name` and the `vm_id`, e.g.,