Improve the root lv size calculations, still not perfect on bigger disk

and ram sizes
This commit is contained in:
Sandwich 2024-10-31 20:07:40 +01:00
parent c6f1686db8
commit cbe238f4d5

View File

@ -45,22 +45,23 @@
loop: loop:
- lv: root - lv: root
size: >- size: >-
{{ ((cis | lower == 'true') | ternary( {{ (
(((vm_size | float - ((vm_memory | float / 1024 >= 16.0) | ternary( (vm_size | float -
((vm_memory | float / 1024 >= 16.0) | ternary(
(vm_memory | float / 2048) | int, (vm_memory | float / 2048) | int,
[vm_memory | float / 1024, 4.0] | max [vm_memory | float / 1024, 4.0] | max
)) - 0.5 - 7.5) > 12.0) | ternary( )) - 0.5 -
(cis | bool | ternary(0, 7.5))
) > 12.0
) | ternary(
(vm_size | float * 0.4) | round(0, 'ceil'), (vm_size | float * 0.4) | round(0, 'ceil'),
vm_size | float - ((vm_memory | float / 1024 >= 16.0) | ternary( vm_size | float -
((vm_memory | float / 1024 >= 16.0) | ternary(
(vm_memory | float / 2048) | int, (vm_memory | float / 2048) | int,
[vm_memory | float / 1024, 4.0] | max [vm_memory | float / 1024, 4.0] | max
)) - 0.5 - 7.5 )) - 0.5 -
)), (cis | bool | ternary(7.5, 0))
vm_size | float - ((vm_memory | float / 1024 >= 16.0) | ternary( ) | string + 'G' }}
(vm_memory | float / 2048) | int,
[vm_memory | float / 1024, 4.0] | max
)) - 0.5
)) | string + 'G' }}
- lv: swap - lv: swap
size: >- size: >-