Enforce 20GiB minimum vm_size

This commit is contained in:
2026-01-02 16:18:14 +01:00
parent 396d802dc3
commit 65ef8cb1ca
2 changed files with 14 additions and 13 deletions

View File

@@ -173,7 +173,7 @@ These are prompted by default via `vars_prompt` in `main.yml`, but can be suppli
| Variable | Description | Example Value | | Variable | Description | Example Value |
| ----------- | --------------------------------- | ------------- | | ----------- | --------------------------------- | ------------- |
| `vm_id` | Unique identifier for the VM. | `101` | | `vm_id` | Unique identifier for the VM. | `101` |
| `vm_size` | Disk size allocated in GB. | `20` | | `vm_size` | Disk size allocated in GB (min 20). | `20` |
| `vm_memory` | Amount of memory in MB. | `2048` | | `vm_memory` | Amount of memory in MB. | `2048` |
| `vm_cpus` | Number of CPU cores (virtual installs). | `4` | | `vm_cpus` | Number of CPU cores (virtual installs). | `4` |
| `vm_ballo` | Ballooning memory size (optional).| `2048` | | `vm_ballo` | Ballooning memory size (optional).| `2048` |

View File

@@ -52,10 +52,7 @@
install_type == "physical" install_type == "physical"
or ( or (
vm_size is defined vm_size is defined
and ( and (vm_size | int) >= 20
(filesystem == "btrfs" and (vm_size | int) >= 10)
or (filesystem != "btrfs" and (vm_size | int) >= 20)
)
) )
) )
- >- - >-
@@ -64,7 +61,10 @@
or ( or (
vm_size is defined vm_size is defined
and vm_memory is defined and vm_memory is defined
and filesystem is defined
and ( and (
filesystem != "btrfs"
or (
(vm_size | float) (vm_size | float)
>= ( >= (
(vm_memory | float / 1024 >= 16.0) (vm_memory | float / 1024 >= 16.0)
@@ -72,7 +72,8 @@
(vm_memory | float / 2048), (vm_memory | float / 2048),
[vm_memory | float / 1024, 4.0] | max [vm_memory | float / 1024, 4.0] | max
) )
+ 16 + 5.5
)
) )
) )
) )