Dominik Csapak [Fri, 18 Nov 2022 08:09:37 +0000 (09:09 +0100)]
ui: fix datacenter tags options inputs
* dont allow blank for tree shape
* allow completely removing registered tags and user-tag-access properties
* correctly check validity for the listfield
* use correct gettexts
* don't inject empty field in the listfield when setting an empty string
Fixes: c8f2cf4c ("ui: vm network: allow to override MTU for virtio devices") Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Aaron Lauterer [Thu, 17 Nov 2022 14:10:02 +0000 (15:10 +0100)]
ui: osd: mon: mds: warn if stop/destroy actions are problematic
Check if stopping of a service (OSD, MON, MDS) will be problematic for
Ceph. The warning still allows the user to proceed.
Ceph also has a check if the destruction of a MON is okay, so let's use
it.
Instead of the common OK button, label it with `Stop OSD` and so forth
to hopefully reduce the "click OK by habit" incidents.
This will not catch it every time as Ceph can need a few moments after a
change to establish its current status. For example, stopping one of 3
MONs and then right away destroying one of the last two running MONs
will most likely not trigger the warning. Doing so after a few seconds
should show the warning though.
Aaron Lauterer [Thu, 17 Nov 2022 14:10:01 +0000 (15:10 +0100)]
ui: osd: warn if removal could be problematic
If an OSD is removed during the wrong conditions, it could lead to
blocked IO or worst case data loss.
Check against global flags that limit the capabilities of Ceph to heal
itself (norebalance, norecover, noout) and if there are degraded
objects.
Unfortunately, the 'safe-to-destroy' Ceph API endpoint will not help
here as it only works as long as the OSD is still running. By the time
the destroy button is enabled, the OSD will already be stopped.
Aaron Lauterer [Thu, 17 Nov 2022 14:10:00 +0000 (15:10 +0100)]
api: ceph: add cmd-safety endpoint
Ceph provides us with several safety checks to verify that an action is
safe to perform. This endpoint provides means to acces them.
The actual mon commands are not exposed directly. Instead the two
actions "stop" and "destroy" are offered.
In case it is not okay to perform an action, Ceph provides a status
message explaining why. This message is part of the returned values.
For now there are the following checks for these services:
Even though OSDs have a check if it is okay to destroy them, it is for
now not really usable in our workflow because it needs the OSD to be up
and running to return useful information. Our workflow in the GUI
currently is that the OSD needs to be stopped in order to destroy it.
Dominik Csapak [Thu, 17 Nov 2022 14:56:19 +0000 (15:56 +0100)]
ui: rework inline tag editing
things that changed:
* removed 'add Tag' inline button with proper button that adds
empty tag
* don't require to confirm each tag, simply update the color "live"
* set a minimum width for the editing box, so that it's easier to click
* replace cancel/finish icons with proper buttons
* fix tagCharRegex for multichar text (necessary for paste)
Dominik Csapak [Wed, 16 Nov 2022 15:48:15 +0000 (16:48 +0100)]
ui: implement tag ordering as configured in datacenter config
datacenter.cfg returns an 'ordering' option. parse that and
use it to order the tags when viewing. default is alphabetical.
With alphabetical ordering, drag & drop when editing is disabled and the
tags will be inserted at the right place. When saving, the sorted
order will be written into the config
Dominik Csapak [Wed, 16 Nov 2022 15:48:14 +0000 (16:48 +0100)]
ui: add tags to ResourceGrid and GlobalSearchField
also allows to search for tags in the GlobalSearchField where each tag is
treated like a seperate field, so it weighs more if the user searches for
the exact string of a single tag
Dominik Csapak [Wed, 16 Nov 2022 15:48:13 +0000 (16:48 +0100)]
ui: tree/ResourceTree: show Tags in tree
and update the treenodes when the tags change.
since we change the vm node text (which we pass through to the config
panel), we have to change how we generate the text there slightly
(otherwise that would include the rendered tags)
Dominik Csapak [Wed, 16 Nov 2022 15:48:10 +0000 (16:48 +0100)]
ui: add form/Tag
displays a single tag, with the ability to edit inline on click (when
the mode is set to editable). This brings up a list of globally available tags
for simple selection.
this is a basic ext component, with 'i' tags for the icons (handle and
add/remove button) and a span (for the tag text)
shows the tag by default, and if put in editable mode, makes the
span editable. when actually starting the edit, shows a picker
with available tags to select from
Dominik Csapak [Wed, 16 Nov 2022 15:48:07 +0000 (16:48 +0100)]
ui: add grid form for mapping tags to foreground/background colors
This provides a basic grid to edit a list of tag color overrides.
We'll use this for editing the datacenter.cfg overrides and the
browser storage overrides.
Dominik Csapak [Wed, 16 Nov 2022 15:48:06 +0000 (16:48 +0100)]
ui: parse and save tag infos from /cluster/options
stores the color-map into a global list of overrides. on update, also parse
the values from the browser localstore. Also emits a GlobalEvent
'loadedUiOptions' so that e.g. the tags can listen to that and refresh their
colors
also saves the list of 'allowed-tags' into PVE.Utils
Dominik Csapak [Wed, 16 Nov 2022 15:48:04 +0000 (16:48 +0100)]
api: open up /cluster/options call over injecting info into /version
To avoid returning unrelated information in the /version api call in
the future use the API endpoint that'd return the relevant
information basically anyway.
It contains most ui relevant options, like the console preference and
tag-style so allow these for users without 'Sys.Audit' on '/', for
others its unchanged, they still get the whole datacenter config.
We also add the list of allowed tags, while not strictly a datacenter
config, it's derived from the current users privileges and the
datacenter config.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Checking for only Sys.Console prevents users who actually have the
correct permissions (VM.Config.CDROM, VM.Config.Cloudinit) from adding
a new cloud-init drive. Some checks needed to be adapted so that editing
cloud-init devices was possible with VM.Config.CDROM instead of
VM.Config.Disk.
ui: qemu: options: use 'first disk' for legacy 'c' boot setting
The kvm man page mentions that using 'c' will try booting from the
first hard disk, so the current '(no bootdisk)' text in the UI is not
accurate, and boot can still succeed.
Reported in the community forum:
https://forum.proxmox.com/threads/115800/
Stefan Sterz [Tue, 25 Oct 2022 08:10:46 +0000 (10:10 +0200)]
ui: only allow rbd pools to be added as rbd storage
previously the ui would allow adding all pools (even the default
ceph-mon pools) as storage. this could lead to issues when users did
use these pools as storage (e.g.: vms missing their disks after a
migration). hence, restrict the pool selector to rbd pools.
fails gracefully by reverting to the previous behavior if a pool has
no application assigned to it.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com> Tested-By:  Aaron Lauterer <a.lauterer@proxmox.com>
Stefan Sterz [Tue, 25 Oct 2022 08:10:45 +0000 (10:10 +0200)]
api: ceph: add applications of each pool to the lspools endpoint
since ceph luminous (ceph 12) pools need to be associated with at
least one applicaton. expose this information here too so that clients
of this endpoint can use it.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com> Tested-By:  Aaron Lauterer <a.lauterer@proxmox.com>
instead of saving maximum 500 lines, count commands + lines, and only
if both are over the limit, truncate the command list
this way, at least the last 10 commands + output are always visible, and
no visible output is truncated, while still not letting the log
grow infinitely
The new MTU field and the rate limit field are now in the advanced
section of the NetworkInputPanel to parallel the layout of the
NetworkEdit for VMs.
Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com> Reviewed-by:  Stefan Hanreich <s.hanreich@proxmox.com> Tested-by:  Stefan Hanreich <s.hanreich@proxmox.com>
The option to set the mtu parameter for lxc containers already exists
in the backend. It just has to be exposed in the web UI as well.
Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com> Reviewed-by:  Stefan Hanreich <s.hanreich@proxmox.com> Tested-by:  Stefan Hanreich <s.hanreich@proxmox.com>
Oguz Bektas [Wed, 9 Nov 2022 15:37:09 +0000 (16:37 +0100)]
ui: vm network: allow to override MTU for virtio devices
we already have the 'mtu' option in the API, so we can just expose
that option inside the 'Advanced' menu for virtio network interfaces.
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Moved the message tooltip below the advanced columns to avoid the line
break and make it more visually pleasing.
Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Fiona Ebner [Wed, 16 Nov 2022 08:30:13 +0000 (09:30 +0100)]
fix #4351: vzdump: send mail if job-end hook fails with mailnotification=failure
Since all tasks succeeded, previously no mail was sent in that case.
Note that the error passed to $self->sendmail() is added to the
subject of the mail if it is a single line or the beginning of the
mail otherwise. Thus changing the mail slightly compared to previously
for the case where the job-start hook fails and the case where the
job-end hook fails with mailnotification=always. But can be considered
an improvement, because the user sees the error right away.
Dominik Csapak [Tue, 15 Nov 2022 13:23:12 +0000 (14:23 +0100)]
ui: backup job edit: fix form reset tracking
When the mode changes, we set the pool selector visible/hidden, but
we never disabled/enabled it. This tripped up the dirty state of the
form always showing the reset button as enabled.
Properly enabling and disabling the pool field fixes the dirty state
tracking.
Fiona Ebner [Thu, 10 Nov 2022 14:37:47 +0000 (15:37 +0100)]
ui: lxc/qemu: cpu edit: make cpuunits depend on node's cgroup version
so that the default value and limits actually correspond to what will
be used. Defaults to values for cgroup v2, because that is the more
common scenario.
Fiona Ebner [Thu, 10 Nov 2022 14:37:45 +0000 (15:37 +0100)]
pvestatd: broadcast static node information
Planned to be used for static resource scheduling in the HA manager.
It's enough to broadcast the values whenever they are outdated or not
set in the node's local kv store, because pmxcfs will re-broadcast the
local kv store whenever the quorate partition changes. This is already
relied upon for the 'ceph-versions' kv pair.
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Fiona Ebner [Tue, 15 Nov 2022 10:18:29 +0000 (11:18 +0100)]
api: backup: auto-inject job id where expected by the API
for backwards compatibility. Otherwise, e.g. listing backup jobs with
pvesh get /cluster/backup is broken. And suddenly not having the
property anymore would be a breaking API change.
Stefan Sterz [Mon, 14 Nov 2022 11:38:28 +0000 (12:38 +0100)]
fix #4328: ui: add widget toolkit to dependencies of OnlineHelpInfo.js
previously the widget toolkit was not scanned when creating the
mapping between `onlineHelp` keys and pve-doc anchors. this could
lead to cases where help buttons didn't work because the necessary
mapping wasn't present in `OnlineHelpInfo.js`.
Thomas Lamprecht [Sun, 13 Nov 2022 14:57:24 +0000 (15:57 +0100)]
job manager: run cfs_update before starting a job
we may want to even do this only once, before the loop, but for now
this is basically the same as it was previously but avoids the need
for every (future) plugin to do this manually; which is just the
wrong place.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Thu, 10 Nov 2022 14:36:00 +0000 (15:36 +0100)]
ui: qemu: increase available usb ports depending on machine and ostype
in the backend, we allow up to 14 usb ports, but only if the vm can
use the qemu-xhci controller which is only possible since machine
version 7.1 and if the ostype is l26 or windows > 7
for this we introduce two helpers:
* qemu_min_version: modeled after the signature of 'min_version' from
qemu-server, expects two arrays of versions and returns true if
the first parameter is equal or greater than the second version
* get_max_usb_count looks at the given ostype and machine string
and returns the proper maximum number
since we don't currently have the actual running version of the vm in
the gui, this is only a heuristic for running vms. but since the actual
running version could only be lower if none is set (e.g. for
migrated/long-running vms) we allow more in the gui and the backend will
do the proper thing (either hotplug it, or make it a pending change)
Fiona Ebner [Fri, 21 Oct 2022 13:02:50 +0000 (15:02 +0200)]
d/postinst: replace pvemailforward with proxmox-mail-forward
proxmox-mail-forward is a new helper binary in Rust intended to behave
essentially the same on PVE installations. It can also handle mixed
PBS+PVE installations.
Stefan Sterz [Tue, 8 Nov 2022 15:01:30 +0000 (16:01 +0100)]
ui: add javascript source to `OnlineHelpInfo.js` prerequisites
by adding the javascript files as prerequisites, the
`OnlineHelpInfo.js` will get re-generated if a new `onlineHelp` key
is used. thus, this avoids an issue were valid keys might not get
mapped correctly because the info in `OnlineHelpInfo.js` wasn't
updated.
Fiona Ebner [Fri, 7 Oct 2022 12:41:54 +0000 (14:41 +0200)]
ui: lxc/qemu: cpu edit: use emptyText for cpuunits
This makes it slightly clearer that it's a default value (not being
written to the config explicitly). It's also in preparation to bind
the default based on the cgroup version, where it's a bit nicer to
bind the emptyText instead of the value (or a user set value would be
overwritten when the binding updates).
Fiona Ebner [Fri, 7 Oct 2022 12:41:53 +0000 (14:41 +0200)]
ui: qemu/lxc: cpu edit: fix 'create' parameter for delete_if_default()
For lxc, commit 53395db1 ("lxc/ResoureEdit: move some cpu fields to
advanced options") made the fields available in the create wizard, so
the comment is also wrong.
Both wizards do a 'delete kv.delete' in their onSubmit() function, so
it didn't actually matter in practice.
Fiona Ebner [Fri, 7 Oct 2022 12:41:52 +0000 (14:41 +0200)]
ui: lxc: cpu edit: drop superfluous delete_if_default
Commit bf96f60d ("use IntegerField from widget toolkit") switched to
using an Promxox IntegerField with 'deleteEmpty: true'. This means
that a value of '' already is removed from 'values' and added to
'delete' before onGetValues() is called here.
Thomas Lamprecht [Wed, 19 Oct 2022 13:12:15 +0000 (15:12 +0200)]
ui: node: rework layout of certificate viewer
Move the raw cert into a fieldset and collapse that by default, also
make it render monospace and pre-wrap whitespace.
Use a inputpanel to get top, col 1/2 & bottom layout so that rsa key
type/size and validity range can be rendered more compactly
n addition to that limit the whole windows height but make it
scrollable, this allows to sanely use the viewer on certs with many
SANs even on small window/browser sizes.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>