Thomas Lamprecht [Wed, 10 Nov 2021 16:26:48 +0000 (17:26 +0100)]
api: version: only include the console option of the datacenter config
Especially with the new description the result can get quite huge and
we do not really require any other info, the console one is only
returned here anyway as a hack due to the dc config API path requires
higher privileges.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Mon, 8 Nov 2021 13:07:57 +0000 (14:07 +0100)]
api/backup: handle new vzdump jobs
in addition to listing the vzdump.cron jobs, also list from the
jobs.cfg file.
updates/creations go into the new jobs.cfg only now
and on update, starttime+dow get converted to a schedule
this transformation is straight forward, since 'dow'
is already in a compatible format (e.g. 'mon,tue') and we simply
append the starttime (if any)
id on creation is optional for now (for api compat), but will
be autogenerated (uuid). on update, we simply take the id from before
(the ids of the other entries in vzdump.cron will change but they would
anyway)
as long as we have the vzdump.cron file, we must lock both
vzdump.cron and jobs.cfg, since we often update both
we also change the backupinfo api call to read the jobs.cfg too
Dominik Csapak [Mon, 8 Nov 2021 13:07:54 +0000 (14:07 +0100)]
add PVE/Jobs to handle VZDump jobs
this adds a SectionConfig handling for jobs (only 'vzdump' for now) that
represents a job that will be handled by pvescheduler and a basic
'job-state' handling for reading/writing state json files
this has some intersections with pvesrs state handling, but does not
use a single state file for all jobs, but seperate ones, like we
do it in the backup-server.
The whole thing is already prepared for this, the systemd timer was
just a fixed periodic timer with a frequency of one minute. And we
just introduced it as the assumption was made that less memory usage
would be generated with this approach, AFAIK.
But logging 4+ lines just about that the timer was started, even if
it does nothing, and that 24/7 is not to cheap and a bit annoying.
So in a first step add a simple daemon, which forks of a child for
running jobs once a minute.
This could be made still a bit more intelligent, i.e., look if we
have jobs tor run before forking - as forking is not the cheapest
syscall. Further, we could adapt the sleep interval to the next time
we actually need to run a job (and sending a SIGUSR to the daemon if
a job interval changes such, that this interval got narrower)
We try to sync running on minute-change boundaries at start, this
emulates systemd.timer behaviour, we had until now. Also user can
configure jobs on minute precision, so they probably expect that
those also start really close to a minute change event.
Could be adapted to resync during running, to factor in time drift.
But, as long as enough cpu cycles are available we run in correct
monotonic intervalls, so this isn't a must, IMO.
Another improvement could be locking a bit more fine grained, i.e.
not on a per-all-local-job-runs basis, but per-job (per-guest?)
basis, which would improve temporary starvement of small
high-periodic jobs through big, less peridoci jobs.
We argued that it's the user fault if such situations arise, but they
can evolve over time without noticing, especially in compolexer
setups.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Wed, 10 Nov 2021 12:15:56 +0000 (13:15 +0100)]
ui: ceph: make version handling actually future proof
It seems we did not prepare the GUI enough for the API changes
planned when stopping to broadcast the old single string version. We
have to use the node specific versions, not the global 'versions'
object.
Also use the `PVE.Utils.compare_ceph_versions` everywhere, since some
versions are strings and others are the parts of the version (e.g.
["16", "2, "6"])
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
this also removes the "content" selector from the window.
as far as it seems, this selector was never able to select
more than one entry, so it was useless.
the check for FormData() is also removed, because this is
supported by all major browsers for a long time. therefore
doStandardSubmit() is also not necessary.
ui: storage content: avoid redundant options hasNotesColumn and hideColumns
Replace both by a showColumns option instead. As the current use of
hasNotesColumn already indicates, when new content-specific columns
are added, it is more natural for each derived class to specify the
columns it wants, rather than those it doesn't.
For hideColumns, there was no user. For hasNotesColumn, the only user
was the backup view.
Set the column information in the storage.BackupView class itself
rather than the instance (like hasNotesColumn was).
vzdump: skip protected backups for dumpdir pruning
Keeps the behavior consistent with what happens for storages. It also
is required to not get into conflict with the check in archive_remove,
i.e. pruning here marks a backup as 'remove' and then archive_remove
complains that it's protected.
Dominik Csapak [Fri, 5 Nov 2021 14:23:47 +0000 (15:23 +0100)]
ceph: fix version check shortcut
with 'get_node_kv', we get a hash which contains the value for
all nodes in the cluster (with the nodename as key), so we have to use
the value from the hash corresponding to our nodename.
also the 'str' property is inside the 'version' hash
ui: join info: rework error handling/checking for no-cluster
check if error is set before trying to access it and check for the
new HTTP code a newer pve-cluster may return, and do a more fuzzy
match for older ones.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
we may want to return null or an empty object for the join info on a
node without a cluster in the future (i.e., PVE 8.0+), so get
compatible for that now already as it costs not much and as we can
now use es2020 we even can write the object access nicer..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Thu, 7 Oct 2021 08:27:22 +0000 (10:27 +0200)]
d/postinst: use reload-or-restart instead of try-reload-or-try-restart
The only difference is that reload-or-try-restart does not do
anything if the service isn't already running, while
reload-or-restart also starts a stopped service.
We explicitly check if the service is enabled on upgrade before doing
any start/reload-or-restart action anyway. So, it would now start
daemons that were stopped but not disabled, which is not a really
valid state and would have happened on the next reboot anyway.
This starts new daemons (like the pvescheduler) automatically on a
package upgrade
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Aaron Lauterer [Mon, 4 Oct 2021 10:25:42 +0000 (12:25 +0200)]
ui: storage: change CIFS to SMB/CIFS
This will hopefully help people to find the needed storage as not
everyone will be aware of the fact that CIFS is also a name used for it
(technically it was only SMB v1).
Stefan Reiter [Mon, 4 Oct 2021 15:29:21 +0000 (17:29 +0200)]
ui: add support for adding TPM devices
Inspired by HDEfi for efidisks. Extends the DiskStorageSelector to allow
hiding the format, since tpmstate can only be stored in 'raw' format
(even on directory storages).
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
ui: qemu/OSTypeEdit: drop throwing an error on multiple widgets
we will have multiple panels with the same widget. Instead
of raising an error in that case, simply ignore it, since
we normally only want to set the default initially, not when
users configured something else