api: ceph osd: drop unused variable and useless intermediate code
$raw isn't used anywhere here and probably just a left over from copy
pasting, and the "int cast ternary" can be avoided by just directly
casting to int when assigning the variable in the first place.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Hanreich [Mon, 4 Sep 2023 09:18:07 +0000 (11:18 +0200)]
api: ceph: improve reporting of ceph OSD memory usage
Currently we are using the MemoryCurrent property of the OSD service
to determine the used memory of a Ceph OSD. This includes, among other
things, the memory used by buffers [1]. Since BlueFS uses buffered
I/O, this can lead to extremely high values shown in the UI.
Instead we are now reading the PSS value from the proc filesystem,
which should more accurately reflect the amount of memory currently
used by the Ceph OSD.
Aaron and I decided on PSS over RSS, since this should give a better
idea of used memory - particularly when using a large amount of OSDs
on one host, since the OSDs share some of the pages.
ui: replication: backup: use renderEnabledIcon to render the enabled column
The new helper is available since proxmox-widget-toolkit version 3.6.1
which we can be sure to be available since a while in praxis, but
definitively by d/control constraints, since 51f54177 ("bump
proxmox-widget-toolkit dependency to 4.0.7")
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
[TL: add context since when this function is available ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Lukas Wagner [Fri, 25 Aug 2023 09:45:12 +0000 (11:45 +0200)]
vzdump: fix notifications for backing up VMs with 2+ disks to PBS
In some situations, such as backing up VMs with 2 or more disks to
PBS, we get passed the backup archive size as a string instead of
as an integer. This led to errors rendering the notification template
down the line.
This commit explicitly casts the data from the task table to an int.
It would be a good idea to actually hunt down the places that produced
the string instead of an integer, but as a quick fix and as a
safeguard against similar lurking errors this approach is fine, IMO.
Christian Ebner [Fri, 11 Aug 2023 10:46:54 +0000 (12:46 +0200)]
website: update external links to www.proxmox.com
During the redesign of www.proxmox.com the menu structure and therefore
some url changed. Update the external link in order to avoid an
unneccessary redirect
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Filip Schauer [Wed, 16 Aug 2023 09:54:57 +0000 (11:54 +0200)]
fix #4663: Prevent Web UI reload on cert order for other node
While it makes sense to reload the Web UI after ordering a certificate
for the same node, it is unnecessary to reload the Web UI when ordering
a certificate for a different node.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
Lukas Wagner [Thu, 3 Aug 2023 12:17:13 +0000 (14:17 +0200)]
api: notification: make the 'mail-to-root' target visible to any user
Since the target does not require Mapping.Use, it should also be
visible and testable by all users.
Short explanation why the 'mail-to-root' is exempt from priv checks:
To ensure backwards compatibility, the 'mail-to-root' target does not
require the `Mapping.Use` privs. This is needed due to the fact that
this target is used as a fallback in case no other target is
configured for an event. For instance, the /node/<name>/apt/update API
call only requires Sys.Modify for the node, but it can also send a
notification. If we were to require Mapping.Use, we could break the
apt/update API compat in the case that a notification shall be sent,
but without any configured notification target (which will then
default to 'mail-to-root').
Lukas Wagner [Thu, 3 Aug 2023 12:17:04 +0000 (14:17 +0200)]
ui: backup: allow to select notification target for jobs
This commit adds a possibility to choose between different options
for notifications for backup jobs:
- Notify via email, in the same manner as before
- Notify via an endpoint/group
If 'notify via mail' is selected, a text field where an email address
can be entered is displayed:
Notify: | Always notify v |
Notify via: | E-Mail v |
Send Mail to: | foo@example.com |
Compression: | ..... v |
If the other option is selected selected, a combo picker for selecting
a channel is displayed:
Notify: | Always notify v |
Notify via: | Endpoint/Group v |
Target: | endpoint-foo v |
Compression: | ..... v |
The code has also been adapted to use the newly introduced
'notification-policy' parameter, which replaces the 'mailnotification'
paramter for backup jobs. Some logic which automatically migrates from
'mailnotification' has been added.
The API call returns all entities that can be used as notification
targets (endpoints, groups). Only targets for which the user has
appropriate permissions are returned.
Lukas Wagner [Thu, 3 Aug 2023 12:17:00 +0000 (14:17 +0200)]
api: notification: add api routes for filters
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.
Lukas Wagner [Thu, 3 Aug 2023 12:16:59 +0000 (14:16 +0200)]
api: notification: add api routes for gotify endpoints
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.
Lukas Wagner [Thu, 3 Aug 2023 12:16:58 +0000 (14:16 +0200)]
api: notification: add api routes for sendmail endpoints
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.
Lukas Wagner [Thu, 3 Aug 2023 12:16:57 +0000 (14:16 +0200)]
api: notification: add api routes for groups
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.
Lukas Wagner [Thu, 3 Aug 2023 12:16:55 +0000 (14:16 +0200)]
api: replication: send notifications via new notification module
If the new 'target-replication' option in datacenter.cfg is set to a
notification target, we send notifications that way. If it is not set,
we continue send a notification to the default target (mail to
root@pam).
There is also a new 'replication' option. It controls whether to send
a notification at all.
Lukas Wagner [Thu, 3 Aug 2023 12:16:54 +0000 (14:16 +0200)]
api: apt: send notification via new notification module
... instead of using sendmail directly
If the new 'target-package-updates' is set, we send a notification to
this target. If not, we continue to send a mail to root@pam (if the
mail address is configured)
Lukas Wagner [Thu, 3 Aug 2023 12:16:52 +0000 (14:16 +0200)]
vzdump: send notifications via new notification module
... instead of using sendmail directly.
If the new 'notification-target' parameter is set,
we send the notification to this endpoint or group.
If 'mailto' is set, we add a temporary endpoint and a
temporary group containg both targets.
This commit also refactors the old 'sendmail' sub heavily:
- Use template-based notification text instead of endless
string concatenations
- Removing the old plaintext/HTML table rendering in favor of
the new template/property-based approach offered by the
`proxmox-notify` crate.
- Rename `sendmail` sub to `send_notification`
- Breaking out some of the code into helper subs, hopefully
reducing the spaghetti factor a bit
Philipp Hufnagl [Thu, 10 Aug 2023 10:09:02 +0000 (12:09 +0200)]
fix #474: ui: allow transfer from container/vms
A user can no see all vms/containers, even the ones that are already a
member of a pool. They can be transfered now after checking the newly
introduced "allow transfer" checkbox.
Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
Philipp Hufnagl [Thu, 10 Aug 2023 10:09:01 +0000 (12:09 +0200)]
fix #474: api: allow transfer from container/vms
When the newly introduced optional parameter "transfer" is set, the user
add a vm/container to a pool even if it is already in one. If so it will
be removed from the old pool
Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
Thomas Lamprecht [Tue, 25 Jul 2023 08:12:00 +0000 (10:12 +0200)]
ui: active directory realm: expose case-sensitive option
The case-sensitive option is not really something that should be CLI
only and is quite common for Microsoft AD setups, so add it to the UI
too as requested in the Forum [0], improving discoverability.
They need to have the same name as the target.
Took the opportunity to move the .PHONY right next to the target recipe,
so that mistakes like these are hopefully easier caught.
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.
Max Carrara [Wed, 5 Jul 2023 18:02:40 +0000 (20:02 +0200)]
fix #4364: pveceph: add confirmation dialogue for ceph installation
Displays a confirmation dialogue if the user didn't explicitly
provide a valid ceph version via the `--version` flag and if
stdout is connected to a tty.
Signed-off-by: Max Carrara <m.carrara@proxmox.com>
fix #4551: ui: use gettext on hardcoded byte units
Since some languages translate byte units like 'GiB' or write them in their
own script, this patch wraps units in the `gettext` function.
While most occurrences of byte strings can be translated within the
`format_size` function in `proxmox-widget-toolkit/src/Utils.js`, this patch
catches those instances that are not translated.
Dominik Csapak [Thu, 22 Jun 2023 12:15:12 +0000 (14:15 +0200)]
ui: migrate: fix disabled migrate button glitch
under certain circumstances, the migrate button stays disabled, even
when a valid target node was selected:
* the first node that gets autoselected (most likely the second)
is not a valid migration target
* the user changes to a migration target that is a valid one
if that happens, the migration button would stay disabled.
switching once to a non valid target and would enable the button.
To fix it, we have to do two things here:
'checkQemuPreconditions' is actually an async function that awaits an
api call and uses the result to set the 'migration.allowedNodes'
property
'checkMigratePreconditions' calls 'checkQemuPreconditions' and uses the
'migration.allowedNodes' property afterwards.
but since 'checkMigratePreconditions' is not async, that happens before
the api call can return the valid data and thus leaves it empty, making
all nodes valid in the selector. (thus the initial selected node is
valid)
instead make 'checkMigratePreconditions' also async and await the result
of 'checkQemuPreconditions'
this unearthed another issue, namely we access an object that is
possibly undefined (worked out before due to race conditions) so
fallback to an empty object.
and lastly, since we want the 'disallowedNodes' set before actually
checking the qemu preconditions, we move the setting of that on
the node selector above the qemu preconditions check
(this is the only place where we set it anyway, and the source does not
change, we probably could move that out of that function altogether)
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 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
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit 517abd0cd28a613598e2a3a8d5d8d057578c14b6) Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
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].
Fixes: ea0a4f1943ffafe94282afc800d5720db45df198 Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
(cherry picked from commit 20fb9aa3f15f9d3ef89bfc3784d72a791c55b757) Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Wed, 21 Jun 2023 10:05:09 +0000 (12:05 +0200)]
api: resource usb mapping: add missing proxyto_callback
i have added it to the pci api call, but forgot to add it for usb
otherwise adding a mapped usb device only works on the node where the
gui is connected to
Dominik Csapak [Wed, 21 Jun 2023 07:41:42 +0000 (09:41 +0200)]
ui: pci/usb mapping: rework mapping panel for better user experience
by removing the confusing buttons in the toolbar and adding them as
actions in an actioncolumn. There a only relevant actions are visible
and get a more expressive tooltip
with this, we now differentiate between 4 modes of the edit window:
* create a new mapping altogether
- shows all fields
* edit existing mapping on top level
- show only 'global' fields (comment, mdev), so no mappings
* add new host mapping
- shows nodeselector, mapping (and mdev, but disabled)
(informational only)
* edit existing host mapping
- show selected node (displayfield) mdev and mappings, but only
mappings are editable
we have to split the nodeselector into two fields, since the disabling
cbind does not pass through to the editconfig (and thus makes the form
invalid if we try that)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Wed, 21 Jun 2023 07:41:39 +0000 (09:41 +0200)]
ui: pci map edit: reintroduce warnings checks
they got lost in my last rebase/refactor.
the onLoadCallBack is used to check by the window if there are iommu
groups at all, and the checkIsolated function checks if the selected
ones are in a separate group (in regards to the other devices)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Mon, 19 Jun 2023 09:13:34 +0000 (11:13 +0200)]
d/postinst: actively remove pvetest repository (added for beta) again
in theory we'd need to be more cautios but this was added only during
beta, which is when we do not really provided any stability
guarantee, further, it's rather unlikely that one added very
important repos that, when removed, break something (again *during*
beta).
The new APT repo management makes it also easy to see when one does
not gets any PVE updates, and one can add the pvetest repo there
again easily too.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Mon, 19 Jun 2023 09:13:33 +0000 (11:13 +0200)]
ui: pci map edit: make top fields more clear
by
* moving the node to the left column and changing the label
* moving the mdev filter to the right column
* show only the create button for new node mappings (otherwise we'd have
a reset button here that cannot do anything useful)
Dominik Csapak [Mon, 19 Jun 2023 09:13:32 +0000 (11:13 +0200)]
ui: multi pci selector: indent functions multifunction devices
when there is more than one function for a device, indent the individual
functions. This sets them visually apart from the 'pass all through as
one' entry
We have to use a html entity here, as extjs trims the normal whitespace.
Dominik Csapak [Fri, 16 Jun 2023 13:05:39 +0000 (15:05 +0200)]
ui: allow configuring pci and usb mapping
uses the new ResourceMapTree to add the CRUD interfaces for the
mappings.
We add both of them into a single panel, since the datacenter menu
already has many entries, and without a proper summary for the group, we
cannot really put them in a category