Commit Graph

17 Commits

Author SHA1 Message Date
Christoph Heiss
54c76175f0 run env: always return proper value for default zfs max arc size
In preparation for fixing #6285 [0].

`0` means to just skip writing the module parameter. But (especially)
with the upcoming change in ZFS 2.3 - which makes the size basically
that of the system memory minus 1 GiB - we want to always write some
value.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=6285

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2025-04-04 14:55:05 +02:00
Christoph Heiss
c21d13c084 run env: provide default ZFS ARC maximum size value
This can be then used by the Rust parts directly, without having to
duplicate the calculation.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2025-04-04 10:34:55 +02:00
Thomas Lamprecht
f357ae3d07 run env: always reduce max ARC size for systems with low memory
Reduce the maximum ARC size to 10% of total memory instead of the
default 50% not only for PVE, but always if the system has less than 2
GiB, or less than 4 GiB for PMG, i.e. less than the recommended
minimum memory we document.

We might want to fine-tune this further in the future, e.g. so that
PMG and PDM won't use 50% of memory even if they got more memory
installed. As they both are not IO-heavy, thus a big ARC won't gain
one that much, but as memory is mainly used for the base system there,
unlike PVE where it's mainly for virtual guests, it might make sense
to use something like 25% there for a better trade-of. Anyway, that's
something that needs closer evaluation, so not relevant for now.

Adapt the tests accordingly.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 16:54:43 +01:00
Thomas Lamprecht
91be6a71d5 run env: always leave 1 GiB for system when clamping ZFS ARC size
To not allow the max ARC size to be the same as the total memory size.
Note that 1 GiB is often still not enough for a fully working system,
but for one, this can only happen if the user manually overrides ARC
max, and for another, it's only a general crude safety net to allow
the basic system to boot so that one can correct this if it's a
problem as for some products, like PBS or PDM, the base system's RSS
usage might be below 1 GiB, and we are not doing product-aware stuff
here.

Adapt the tests accordingly.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 16:54:43 +01:00
Christoph Heiss
17f3ff2268 add preliminary pdm support
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-16 20:39:33 +01:00
Christoph Heiss
5241b6c45f low-level: stdio: fix: make progress text properly optional
.. such that receivers can differentiate between these two cases more
clearly.

Sometimes, the `progress` sub does not get passed a text (on purpose!),
just updating the progress ratio. This would cause log messages to be
written out which could indicate missing text and look rather weird.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-25 23:21:51 +01:00
Christoph Heiss
9a1494bad8 test: add test for kernel commandline parsing
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 13:30:20 +01:00
Christoph Heiss
a2c01db295 test: ui2-stdio: fix multi-process testing
Previously, if something failed in the child, the overall test would
still be successful and exit with `0`.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-10 19:45:50 +01:00
Christoph Heiss
5443b7049e proxmox: add zfs module for retrieving importable zpool info
Will be used for prompting the user to rename existing "rpool" ZFS
pools, similar to what we do for an existing LVM "pve" volume group.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
 [ TL: added a bit context for what this will be used and merge in the
   tests into this preparatory commit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-16 17:51:10 +02:00
Thomas Lamprecht
928de50626 tests: code-style and error handling fixes for ui2stdio
use modern calling style, avoid duplicate use of Test::More module,
handle fork error more visible, handle pipe creation errors and do
that all in one commit as it's just a test and I don't care.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-24 18:27:48 +01:00
Christoph Heiss
a054ca6760 test: add tests for UI^2 stdio protocol
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-02-24 18:00:17 +01:00
Christoph Heiss
f6bea065f7 fix #5230: sys: net: properly escape FQDN regex
Due to interpolation, the \. sequence must be double-escaped.
Previously, this would result in a non-escaped dot, thus matching much
more liberally than it should.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
 [ TL: fix bug # reference in code comments ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-23 17:28:54 +01:00
Christoph Heiss
1a5665378b sys: net: do not allow overlong FQDNs as per RFCs and Debian spec
Debian limits labels to 63 characters each and the total length to 253
characters [0].

[0] https://manpages.debian.org/stable/manpages/hostname.7.en.html

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-02-23 16:40:04 +01:00
Christoph Heiss
93892c0188 proxinstall: avoid open-coding FQDN sanity check
.. by moving it into its own subroutine. Makes the whole thing quite a
bit neater and easier to maintain.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-02-23 16:40:04 +01:00
Christoph Heiss
7a95f3873f sys: command: handle EINTR in run_command()
Previously, the I/O loop would continue endlessly until the subprocess
exited.
This explicit handling allows run_command() to be used with e.g.
alarm().

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-02-23 14:19:56 +01:00
Christoph Heiss
152bbef439 sys: command: factor out kill() + waitpid() from run_command()
This moves the kill() + waitpid() combo into a separate subroutine,
avoiding open-coding that sequence. wait_for_process() also handles
properly unkillable process (e.g. in D-state) and avoids completely
locking up the installer in such cases. See [0].

For the latter case, a timeout exists (with a default of 5 seconds) in
which to wait for the process to exit after sending an optional
TERM/KILL signal.

Also while at it, add a few basic tests for run_command().

[0] https://lists.proxmox.com/pipermail/pve-devel/2024-February/061697.html

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-02-23 14:19:56 +01:00
Christoph Heiss
9a0d66cb36 test: add tests for zfs_arc_max calculations
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00