ui: vm selector: gracefully handle empty IDs in setValue function
An empty string is passed by the backup job window when using
selection mode 'all', would be converted to [""] and wrongly add an
entry with VMID 0 because the item "" could not be found in the store.
Reported in the community forum:
https://forum.proxmox.com/threads/130164/
Fixes: 7a5ca76a ("fix #4239: ui: show selected but non-existing vmids in backup edit") Suggested-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit 4a862f4f02c23e0bd7072a16bf6dd0ff02edf0e6) Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
For Fedora 38 the systemd shared object files used to check the systemd
version are located at /usr/lib64/systemd or /usr/lib/systemd.
Therefore, include /usr/lib64/systemd in the list of directories to
check.
Further, Fedora 38 adds a fc38 postfix to the filename, so expand the
regex to cover that as well.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Commit 114e5f2c ("pve7to8: sync over from stable-7 branch")
accidentally got rid of the correct value 0 here and also the new TODO
message to improve the situation. But the TODO is actually easy,
because there already is the $upgraded variable. Just rely on that
instead of hard-coding and forgetting about it again.
Stoiko Ivanov [Wed, 21 Jun 2023 17:35:57 +0000 (19:35 +0200)]
pve7to8: add check for systemd-boot presence where needed
since the package won't get installed for systems upgraded from 7 to 8
we warn users who need systemd-boot - to be able to initialize new
ESPs - that they need to install it
The check for package installation is based on existance of the
changelog, since the package information used in pve7to8 comes from
the API-modules, which limit it to the pve-relevant packages.
tested in VMs with uefi and legacy mode, with existing
proxmox-boot-uuids both with and w/o systemd-boot being installed
Fiona Ebner [Wed, 21 Jun 2023 16:19:47 +0000 (18:19 +0200)]
pve7to8: enable noout before upgrade
Just like 3b776617 ("pve6to7: enable noout before upgrade") last time,
it should be enabled in the stable branch to ensure users see the
warning before upgrade.
Fiona Ebner [Wed, 21 Jun 2023 15:02:01 +0000 (17:02 +0200)]
pve7to8: avoid confusing warning about required setting 'storage' for vzdump
It's required in the schema for notes-template and protected, but when
parsing vzdump.conf, it shouldn't matter whether the storage parameter
is set or not.
The warning is ugly and users might interpret it as something that
needs to be acted upon for the upgrade:
parse error in '/etc/vzdump.conf' - 'storage': missing property - 'notes-template' requires this property\nmissing property - 'protected' requires this property
Friedrich Weber [Thu, 15 Jun 2023 13:22:31 +0000 (15:22 +0200)]
pve7to8: content-dirs check: skip paths that cannot be resolved
The current inequality check for content-dirs does not correctly
handle the case in which `abs_path` returns undef. This can result in
confusing warnings:
storage [...] uses directory for multiple content types [...]
Fix this by skipping paths for which `abs_path` returns undef. This
matches the behavior of the actual content-dirs check in PVE 8 [0].
Thomas Lamprecht [Mon, 12 Jun 2023 15:07:00 +0000 (17:07 +0200)]
pve7to8: nvidia vGPU: downgrad report for active service to warning
While it would be a failure now (and I thus have recommended Dominik
to use a fail here), we cannot really predict how this
evolves. If NVIDIA fixes the issue in newer driver/tooling we cannot
detect this and telling users to ignore a failure can lead to them
getting condition on that and start ignoring any failure.
So, let's ignore my initial error-level hunch and use a warning,
which is quite prominent too.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 12 Jun 2023 15:05:36 +0000 (17:05 +0200)]
pve7to8: nvidia vGPU: suppress stderr from unit check
Avoid a error message like "Failed to get unit file state for
nvidia-vgpu-mgr.service: No such file or directory" on systems that
don't have that service.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Mon, 12 Jun 2023 10:00:53 +0000 (12:00 +0200)]
pve7to8: add check for nvidia-vgpu-mgr
Currently the nvidia vgpu host driver (15.2) does not support kernels >
6.0 and thus will not work with bookworm based releases for now.
Fail when the service is running, and warn if it only exists, but is
disabled/stopped (in case a user installed it sometime but did not need
it and disabled it).
In any case, link to the known issues section in the upgrade guide
(which we can update to contain up-to-date information).
Christian Ebner [Mon, 12 Jun 2023 10:31:13 +0000 (12:31 +0200)]
pve7to8: Improve systemd unified cgroupv2 support check
Checking /lib/systemd if it is present and a directory is not enough, as
the shared object file used to check the version might nevertheless be
located at /usr/lib/systemd, or under /usr/lib/x86_64-linux-gnu/systemd.
So check also the latter paths, if the former returned no match.
Further, Arch Linux appends the minor version and release version to the
filename, so include that in the regex as well.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Thomas Lamprecht [Mon, 12 Jun 2023 14:28:49 +0000 (16:28 +0200)]
pve7to8: make check for correct running kernel more resilient
users can have the 6.2 kernel already installed, so this check needs
to cope with that.
The last non-bpo version on bullseye releases was 6.2.11-2-pve and
the first release for bookworm was 6.2.16-1-pve, so use a regex that
matches the bookworm one and newer, but fails with any tilde
characters, which must be used for any 6.2 update in bullseye from
now on to ensure correct upgrades.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Friedrich Weber [Wed, 7 Jun 2023 09:39:13 +0000 (11:39 +0200)]
pve7to8: warn if storage uses a directory for multiple content types
Using a directory for multiple content types will throw an error in
PVE 8 (see 5f4b5bd1 in pve-storage). Hence, detect this in pve7to8 for
active storages and warn if needed.
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
This can lead to unnecessary warnings of multiple detected versions.
Therefore, extract the version, e.g. 'ceph version 17.2.6', and the
commit hash. Use the simplified version for the version checks and show
an info line when the commit is different instead of a warning.
If the commit hashes are the only difference, we are likely in the
middle of the upgrade.
Thomas Lamprecht [Wed, 31 May 2023 14:29:36 +0000 (16:29 +0200)]
pve7to8: add minimal ceph version check
note that this is only checked in the hyper-converged use-case,
otherwise we don't really care what ceph client version is in use, as
that cannot really break much w.r.t. the upgrade (i.e., packaging
dependencies) itself.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 31 May 2023 08:19:27 +0000 (10:19 +0200)]
pve7to8: update check for free space to >= 5 GB
As for persistent storage we normally use GB not GiB nowadays (e.g.,
in the Web UI), as 2^30 is bigger than 10^9, rounding up to 5 GB
should be fine; it's really safer to have a bit more free space as
minimally required in some minimal setups.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 31 May 2023 07:10:41 +0000 (09:10 +0200)]
revert expanding repoid to 16 chars
This partially reverts commit 0e77456f ("expand repoid to 16 chars
and avoid querying git for it twice") to use 8 characters to avoid
any change for this format in the (soon old) stable release
Keep the rest of the changes though, they do make sense.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 29 May 2023 13:44:22 +0000 (15:44 +0200)]
d/control: apt-transport-https as separate package is gone
just keep the versioned apt dependency, that alone ensures it and apt
1.5 got released on 24 Sep 2017, so just keep it for (or to avoid)
the real messed up installations
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 29 May 2023 13:41:35 +0000 (15:41 +0200)]
d/postinst: fix version format for apt auth config migration check
The mistake wasn't that bad, as we mostly checked for the migration
to often, i.e., for any update to the 7.2-X releases, not just until
7.2-11 was crossed (but with 7.3-X the check worked again as
indented).
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 29 May 2023 12:44:24 +0000 (14:44 +0200)]
expand repoid to 16 chars and avoid querying git for it twice
i.e., just reuse GITVERSION, and FWIW, the current ID length git
auto chooses is 9 chars, suggesting that 8 really was getting to
small. With 16 we got now 64 bits, that's plenty for the next few
years.
Document the format also (roughly) in the API schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Sun, 28 May 2023 17:19:53 +0000 (19:19 +0200)]
mobile ui: statically import widget toolkit
as loading the whole wtk breaks the mobile ui and is
- not always trivial to fix
- a sisyphean task (in the future)
- we don't check this often, so breakage is likely to go unnoticed
I.e., just much simple to freeze this also in time..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
As reported in the community forum[0], as opposed to VM/LXC creation,
there is no validation for the name in the clone dialog. Use the same
validation as the guest creation wizards do to catch errors early,
before sending the API request.
ui: utils: monitor_ceph_installed: avoid setting nodename to localhost
If a user is accessing the Ceph panel via Datacenter -> Ceph, then the
install & config wizard might be shown. The nodename that is passed to
the wizard will decide the ID of the initial MON and MGR services.
Therefore, don't fall back to 'localhost' but the actual name of the
node to which we are connected to. The result will be that the first MON
and MGR will have the expected ID instead of 'localhost'.
Thomas Lamprecht [Sat, 22 Apr 2023 07:47:29 +0000 (09:47 +0200)]
proxy: cleanup getting index method
- improve variable definition/use locality
- avoid some if's for some (mostly boolean) assignments, just use an
expression
As long as we don't go overboard with code golfing it to extremely
terse, shorter code is always more readable, especially if
definition/use happens not dozens of lines apart.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>