]> git.proxmox.com Git - pve-manager.git/log
pve-manager.git
2 years agoui: utils: refactor render_as_property_string
Thomas Lamprecht [Fri, 12 Nov 2021 17:25:36 +0000 (18:25 +0100)]
ui: utils: refactor render_as_property_string

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: backup: add retention column
Thomas Lamprecht [Fri, 12 Nov 2021 17:19:17 +0000 (18:19 +0100)]
ui: backup: add retention column

half of this patch has already applied with the last commit by
mistake..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: ceph: fixup optional chaining operator
Thomas Lamprecht [Fri, 12 Nov 2021 16:06:50 +0000 (17:06 +0100)]
ui: ceph: fixup optional chaining operator

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: ceph: add more compatibilty code for versions
Dominik Csapak [Fri, 12 Nov 2021 16:01:04 +0000 (17:01 +0100)]
ui: ceph: add more compatibilty code for versions

we now have to handle the version of 'old' nodes, as well as the
new nodes, which are missing the 'version' field in the metadata/osd call

so set the 'versions' object to a default empty object for osds
and get the host version directly from the treenode
(the parent node of the osd node)

also compare the host version in the dashboard by getting first the
new version field, and the old one as fallback.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofollowup: code-style cleanup
Thomas Lamprecht [Fri, 12 Nov 2021 15:40:18 +0000 (16:40 +0100)]
followup: code-style cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agojobs: vzdump: fixup prune-schedule conf
Dominik Csapak [Fri, 12 Nov 2021 12:37:27 +0000 (13:37 +0100)]
jobs: vzdump: fixup prune-schedule conf

when we parse the config, we get the 'prune-backup' decoded, but the
api call we use wants it as a property string, so encode it here again

this fixes having jobs with prune options

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi/services: add pvescheduler to the service list
Dominik Csapak [Fri, 12 Nov 2021 12:37:26 +0000 (13:37 +0100)]
api/services: add pvescheduler to the service list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi/services: sort service list
Dominik Csapak [Fri, 12 Nov 2021 12:37:25 +0000 (13:37 +0100)]
api/services: sort service list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: dc/Backup: fix 'run now' button for jobs with comments
Dominik Csapak [Thu, 11 Nov 2021 12:04:22 +0000 (13:04 +0100)]
ui: dc/Backup: fix 'run now' button for jobs with comments

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopartially fix #2285: ui: disk create: allow selecting partitions
Fabian Ebner [Wed, 6 Oct 2021 09:18:53 +0000 (11:18 +0200)]
partially fix #2285: ui: disk create: allow selecting partitions

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: zfs create: switch to using widget-toolkit's multiDiskSelector
Fabian Ebner [Wed, 6 Oct 2021 09:18:52 +0000 (11:18 +0200)]
ui: zfs create: switch to using widget-toolkit's multiDiskSelector

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agopartially fix #2285: ui: ceph: allow selecting partitions
Fabian Ebner [Wed, 6 Oct 2021 09:18:51 +0000 (11:18 +0200)]
partially fix #2285: ui: ceph: allow selecting partitions

For DB and WAL disks, not only partitions will show up now, but one
more type of disk, that didn't show up before: Namely, GPT-partitioned
disks with any partitions detected as used.

It's confusing as the size shown is of the full disk, with no
indication that a new partition will be appended at the end. This
problem was already present before, but only affected GPT-partitioned
disks where no usage on a partition was detected.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: ceph: create osd: set correct partition type
Fabian Ebner [Wed, 6 Oct 2021 09:18:50 +0000 (11:18 +0200)]
api: ceph: create osd: set correct partition type

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agopartially fix #2285: api: ceph: create osd: allow using partitions
Fabian Ebner [Wed, 6 Oct 2021 09:18:49 +0000 (11:18 +0200)]
partially fix #2285: api: ceph: create osd: allow using partitions

Note that this does not only allow partitions to be used, but for DB
and WAL disks, one more type of disk, that wasn't allowed before.
Namely, GPT-partitioned disks with any partitions detected as used.
The reason is get_disks' behavior:
  * Without $include_partitions=1, the disk will have the same usage
    as it's first used partition, and thus wasn't allowed. (Except in
    the case that usage was LVM, where the check was bypassed, but
    luckily OSD creation just failed later because no Ceph volume
    group would be detected).
  * With $include_partitions=1, the disk will have usage 'partitions'
    and thus be allowed.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: ceph: create osd: set correct parttype for DB/WAL
Fabian Ebner [Wed, 6 Oct 2021 09:18:48 +0000 (11:18 +0200)]
api: ceph: create osd: set correct parttype for DB/WAL

The get_ceph_journals function in pve-storage uses this information.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agobump version to 7.0-15
Thomas Lamprecht [Thu, 11 Nov 2021 20:37:10 +0000 (21:37 +0100)]
bump version to 7.0-15

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump versioned dependency on proxmox-widget-toolkit to 3.4-1
Thomas Lamprecht [Thu, 11 Nov 2021 20:39:21 +0000 (21:39 +0100)]
d/control: bump versioned dependency on proxmox-widget-toolkit to 3.4-1

to have new TFA related widgets available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump versioned dependency on libpve-access-control-perl
Thomas Lamprecht [Thu, 11 Nov 2021 20:38:38 +0000 (21:38 +0100)]
d/control: bump versioned dependency on libpve-access-control-perl

to ensure we're compatible regarding TFA stuff

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agojobs: rename function to better distinguish job state and task status
Fabian Ebner [Thu, 11 Nov 2021 15:17:45 +0000 (16:17 +0100)]
jobs: rename function to better distinguish job state and task status

Also, default to 'internal error' if the task status within the lock
is undef, which shouldn't actually be possible.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agojobs: started_job: rename variable to $msg
Fabian Ebner [Thu, 11 Nov 2021 15:17:44 +0000 (16:17 +0100)]
jobs: started_job: rename variable to $msg

it's not always an error, but can also be 'OK'.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agopvescheduler: simplify code for sleep time calculation
Fabian Ebner [Thu, 11 Nov 2021 15:17:43 +0000 (16:17 +0100)]
pvescheduler: simplify code for sleep time calculation

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: dc options: fix indentation
Thomas Lamprecht [Thu, 11 Nov 2021 19:35:20 +0000 (20:35 +0100)]
ui: dc options: fix indentation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: tfa: include cluster or node name in issuer
Thomas Lamprecht [Thu, 11 Nov 2021 19:30:25 +0000 (20:30 +0100)]
ui: tfa: include cluster or node name in issuer

As else people may have a hard time of figuring out for which host a
factor is valid.

As a factor is valid for every cluster node we prefer the cluster
name and for single-nodes we use the node name as fallback.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: index: set Proxmox.NodeName variable
Thomas Lamprecht [Thu, 11 Nov 2021 19:07:23 +0000 (20:07 +0100)]
ui: index: set Proxmox.NodeName variable

similar to PBS. This doesn't gives unauthenticated users more info as
we already set it in the title element anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: backup view: move tbar schedule-sim button to the right
Thomas Lamprecht [Thu, 11 Nov 2021 19:52:24 +0000 (20:52 +0100)]
ui: backup view: move tbar schedule-sim button to the right

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: schedule sim: slight title adaption
Thomas Lamprecht [Thu, 11 Nov 2021 19:51:58 +0000 (20:51 +0100)]
ui: schedule sim: slight title adaption

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: schedule sim: fix right alignment of simulate button
Thomas Lamprecht [Thu, 11 Nov 2021 19:51:04 +0000 (20:51 +0100)]
ui: schedule sim: fix right alignment of simulate button

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: cluster: add jobs sub-directory index and set its permissions
Thomas Lamprecht [Thu, 11 Nov 2021 20:00:08 +0000 (21:00 +0100)]
api: cluster: add jobs sub-directory index and set its permissions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: cluster: sort index
Thomas Lamprecht [Thu, 11 Nov 2021 19:59:24 +0000 (20:59 +0100)]
api: cluster: sort index

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocalendar event simulator: rename number parameter to iterations
Thomas Lamprecht [Thu, 11 Nov 2021 19:49:43 +0000 (20:49 +0100)]
calendar event simulator: rename number parameter to iterations

in sync with the same option of `systemd-analyze calendar` and number
is so generic.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoremove pvescheduler manpage generation
Dominik Csapak [Thu, 11 Nov 2021 11:07:09 +0000 (12:07 +0100)]
remove pvescheduler manpage generation

pve-docs-generator does this now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: dc/Backup: add schedule simulator button
Dominik Csapak [Thu, 11 Nov 2021 11:07:08 +0000 (12:07 +0100)]
ui: dc/Backup: add schedule simulator button

so that a user can simply simulate the schedule

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: cluster: add jobs/schedule-analyze api call
Dominik Csapak [Thu, 11 Nov 2021 11:07:07 +0000 (12:07 +0100)]
api: cluster: add jobs/schedule-analyze api call

a simple api call to simulate calendar event triggers
takes a schedule, an optional number (default 10), an optional starttime
(default 'now') and returns a list with unix timestamps, as well as
humanly readable utc timestamps.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: dc/Backup: fix comment sort
Dominik Csapak [Thu, 11 Nov 2021 11:07:06 +0000 (12:07 +0100)]
ui: dc/Backup: fix comment sort

without this, jobs without comments will not be included in the sort
properly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: dc/Backup: never show id input field, autogenerate id
Dominik Csapak [Thu, 11 Nov 2021 11:07:05 +0000 (12:07 +0100)]
ui: dc/Backup: never show id input field, autogenerate id

similar to pbs sync jobs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agod/control: bump versioned dependency on libpve-cluster-api-perl
Thomas Lamprecht [Thu, 11 Nov 2021 17:12:49 +0000 (18:12 +0100)]
d/control: bump versioned dependency on libpve-cluster-api-perl

for new webauthn config

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopveceph: add 'fs destroy' command
Dominik Csapak [Mon, 25 Oct 2021 14:01:38 +0000 (16:01 +0200)]
pveceph: add 'fs destroy' command

with 'remove-storages' and 'remove-pools' as optional parameters

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: ceph/fs: allow creating multiple cephfs
Dominik Csapak [Mon, 25 Oct 2021 14:01:37 +0000 (16:01 +0200)]
ui: ceph/fs: allow creating multiple cephfs

but only if there are any standby mds

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: storage/cephfs: make ceph fs selectable
Dominik Csapak [Mon, 25 Oct 2021 14:01:36 +0000 (16:01 +0200)]
ui: storage/cephfs: make ceph fs selectable

by adding a CephFSSelector and using it in the CephFSEdit window
(similar to the poolselector/textfield)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: cephfs: add 'fs-name' for cephfs storage
Dominik Csapak [Mon, 25 Oct 2021 14:01:35 +0000 (16:01 +0200)]
api: cephfs: add 'fs-name' for cephfs storage

so that we can uniquely identify the cephfs (in case of multiple)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: ceph/fs: show fs for active mds
Dominik Csapak [Mon, 25 Oct 2021 14:01:34 +0000 (16:01 +0200)]
ui: ceph/fs: show fs for active mds

so that the user can see which mds is responsible for which cephfs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: ceph/ServiceList: refactor controller out
Dominik Csapak [Mon, 25 Oct 2021 14:01:33 +0000 (16:01 +0200)]
ui: ceph/ServiceList: refactor controller out

we want to reuse that controller type by overriding some functionality
in the future, so factor it out.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: cephfs: add fs_name to 'is mds active' check
Dominik Csapak [Mon, 25 Oct 2021 14:01:32 +0000 (16:01 +0200)]
api: cephfs: add fs_name to 'is mds active' check

so that we check the mds for the correct cephfs we just added

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: cephfs: more checks on fs create
Dominik Csapak [Mon, 25 Oct 2021 14:01:31 +0000 (16:01 +0200)]
api: cephfs: more checks on fs create

namely if the fs is already existing, and if there is currently a
standby mds that can be used for the new fs
previosuly, only one cephfs was possible, so these checks were not
necessary. now with pacific, it is possible to have multiple cephfs'
and we should check for those.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: cephfs: refactor {ls, create}_fs
Dominik Csapak [Mon, 25 Oct 2021 14:01:30 +0000 (16:01 +0200)]
api: cephfs: refactor {ls, create}_fs

no function change intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: ceph: catch missing version for service list
Dominik Csapak [Mon, 25 Oct 2021 14:01:29 +0000 (16:01 +0200)]
ui: ceph: catch missing version for service list

when a daemon is stopped, the version here is 'undefined'. catch that
instead of letting the template renderer run into an error.
this fixes the rendering of the grid backgrounds

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: ceph-mds: get mds state when multple ceph filesystems exist
Dominik Csapak [Mon, 25 Oct 2021 14:01:28 +0000 (16:01 +0200)]
api: ceph-mds: get mds state when multple ceph filesystems exist

by iterating over all of them and saving the name to the active ones
this fixes the issue that an mds that is assigned to not the first
fs in the list gets wrongly shown as offline

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: form/CalendarEvent: remove 'first saturday each month' example
Thomas Lamprecht [Thu, 11 Nov 2021 16:50:45 +0000 (17:50 +0100)]
ui: form/CalendarEvent: remove 'first saturday each month' example

Originally-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: dc/options: show depreacation notice in u2f settings
Thomas Lamprecht [Thu, 11 Nov 2021 16:44:03 +0000 (17:44 +0100)]
ui: dc/options: show depreacation notice in u2f settings

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: dc/options: display WebAuthn and add editor
Thomas Lamprecht [Thu, 11 Nov 2021 16:38:10 +0000 (17:38 +0100)]
ui: dc/options: display WebAuthn and add editor

mostly copied 1:1 from PBS, we could move this to widget toolkit
sometimes though..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agowww: redirect user TFA button to TFA view
Wolfgang Bumiller [Tue, 9 Nov 2021 11:27:14 +0000 (12:27 +0100)]
www: redirect user TFA button to TFA view

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agowww: add TFA view to config
Wolfgang Bumiller [Tue, 9 Nov 2021 11:27:13 +0000 (12:27 +0100)]
www: add TFA view to config

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agowww: use af-address-book-o for realms
Wolfgang Bumiller [Tue, 9 Nov 2021 11:27:12 +0000 (12:27 +0100)]
www: use af-address-book-o for realms

we do this in PBS, and use the key for TFA

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agowww: switch to new tfa login format
Wolfgang Bumiller [Tue, 9 Nov 2021 11:27:11 +0000 (12:27 +0100)]
www: switch to new tfa login format

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agowww: use UserSelector from wtk
Wolfgang Bumiller [Tue, 9 Nov 2021 11:27:09 +0000 (12:27 +0100)]
www: use UserSelector from wtk

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agowww: use render_u2f_error from wtk
Wolfgang Bumiller [Tue, 9 Nov 2021 11:27:08 +0000 (12:27 +0100)]
www: use render_u2f_error from wtk

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: calendar event: fix descriptions for examples
Fabian Ebner [Thu, 11 Nov 2021 09:00:55 +0000 (10:00 +0100)]
ui: calendar event: fix descriptions for examples

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agodepend on and use libjs-qrcodejs
Wolfgang Bumiller [Wed, 10 Nov 2021 12:49:04 +0000 (13:49 +0100)]
depend on and use libjs-qrcodejs

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: storage: avoid deleting preallocation setting on creation
Thomas Lamprecht [Wed, 10 Nov 2021 21:03:05 +0000 (22:03 +0100)]
ui: storage: avoid deleting preallocation setting on creation

reported in the forum: https://forum.proxmox.com/threads/.99471/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopvestatd: broadcast version info
Wolfgang Bumiller [Wed, 10 Nov 2021 14:11:46 +0000 (15:11 +0100)]
pvestatd: broadcast version info

broadcast the built-in, statically available version info, e.g.:
{
   "release" : "7.0",
   "repoid" : "3ce05d40",
   "version" : "7.0-14"
}

We can expand this by more actual package version info in the future,
but that certainly needs more elaborate update control mechanisms as
the oneshot at boot we have now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: form/calendar event: add some more complex examples
Thomas Lamprecht [Wed, 10 Nov 2021 20:32:14 +0000 (21:32 +0100)]
ui: form/calendar event: add some more complex examples

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: form/calendar event: increase width of combobox picker
Thomas Lamprecht [Wed, 10 Nov 2021 20:31:16 +0000 (21:31 +0100)]
ui: form/calendar event: increase width of combobox picker

makes it more readable and will allow for some more complex examples
without wrapping (which is hard to grasp without row styling
otherwise)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: backup job: limit ID to 20 chars for now
Thomas Lamprecht [Wed, 10 Nov 2021 20:29:38 +0000 (21:29 +0100)]
ui: backup job: limit ID to 20 chars for now

we're thinking of maybe just auto-filling it or allowing to edit it,
in any way, the comment field can/should be used for longer, free
form info.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: backup job: ellipsize read-only ID on edit
Thomas Lamprecht [Wed, 10 Nov 2021 18:26:56 +0000 (19:26 +0100)]
ui: backup job: ellipsize read-only ID on edit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: backup job: avoid row wrapping due to overly long label
Thomas Lamprecht [Wed, 10 Nov 2021 18:25:55 +0000 (19:25 +0100)]
ui: backup job: avoid row wrapping due to overly long label

We can express that it's a notification in the combobox.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: version: expand return schema info
Thomas Lamprecht [Wed, 10 Nov 2021 16:34:39 +0000 (17:34 +0100)]
api: version: expand return schema info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: version: only include the console option of the datacenter config
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>
2 years agoui: dc/Backup: add comment field and column
Dominik Csapak [Wed, 10 Nov 2021 14:02:56 +0000 (15:02 +0100)]
ui: dc/Backup: add comment field and column

and hide the ID column by default

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: backup/jobs: add comment field to jobs
Dominik Csapak [Wed, 10 Nov 2021 14:02:55 +0000 (15:02 +0100)]
api: backup/jobs: add comment field to jobs

and encode them with PVE::Tools::encode_text in the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: dc/BackupEdit: use correct validation
Dominik Csapak [Wed, 10 Nov 2021 14:02:54 +0000 (15:02 +0100)]
ui: dc/BackupEdit: use correct validation

we use a 'pve-configid', so use the 'ConfigId' vtype

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoJobs/VZDump: encode/decode 'prune-backups' where needed
Dominik Csapak [Wed, 10 Nov 2021 14:02:53 +0000 (15:02 +0100)]
Jobs/VZDump: encode/decode 'prune-backups' where needed

we want to write it out to the config as propertyString,
but want it as object in the api (for compatiblity)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: dc/backup: show id+schedule instead of dow+starttime
Dominik Csapak [Mon, 8 Nov 2021 13:07:58 +0000 (14:07 +0100)]
ui: dc/backup: show id+schedule instead of dow+starttime

we can now show the id (since its not autogenerated anymore),
and we can always show/edit the schedule instead of the dow+starttime

also add an 'ID' field to the edit/create window and update the
backupinfo window as well

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi/backup: handle new vzdump jobs
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

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi/backup: refactor string for all days
Dominik Csapak [Mon, 8 Nov 2021 13:07:56 +0000 (14:07 +0100)]
api/backup: refactor string for all days

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopvescheduler: run jobs from jobs.cfg
Dominik Csapak [Mon, 8 Nov 2021 13:07:55 +0000 (14:07 +0100)]
pvescheduler: run jobs from jobs.cfg

PVE/Jobs is responsible to decide if the job must run (e.g. with a
schedule)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoadd PVE/Jobs to handle VZDump jobs
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.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoreplace systemd timer with pvescheduler daemon
Thomas Lamprecht [Mon, 8 Nov 2021 13:07:53 +0000 (14:07 +0100)]
replace systemd timer with pvescheduler daemon

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>
2 years agoRevert "ceph services: drop broadcasting legacy version pmxcfs KV"
Thomas Lamprecht [Wed, 10 Nov 2021 13:06:28 +0000 (14:06 +0100)]
Revert "ceph services: drop broadcasting legacy version pmxcfs KV"

This reverts commit 8a3a300b8e430a74af2497e1759cf5ee461a22c8 as 7.0
wasn't fully prepared for the transition...

https://lists.proxmox.com/pipermail/pve-devel/2021-November/050833.html
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: ceph: make version handling actually future proof
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>
2 years agoapi: ceph: fix getting ceph versions
Dominik Csapak [Wed, 10 Nov 2021 12:15:55 +0000 (13:15 +0100)]
api: ceph: fix getting ceph versions

Since commit: 8a3a300b ("ceph services: drop broadcasting legacy
version pmxcfs KV")

The 'ceph-version' kv is not broadcasted anymore, so we should not
query it, instead use get_ceph_versions

Also drop the other legacy keys for the versions

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump dep on pve-storage
Fabian Grünbichler [Wed, 10 Nov 2021 13:28:04 +0000 (14:28 +0100)]
d/control: bump dep on pve-storage

for disk manage with deletion

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoui: node: storage removal: add checkbox for cleaning up storage config
Fabian Ebner [Mon, 25 Oct 2021 13:47:55 +0000 (15:47 +0200)]
ui: node: storage removal: add checkbox for cleaning up storage config

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: node: storage removal: add checkbox for cleaning up disks
Fabian Ebner [Mon, 25 Oct 2021 13:47:54 +0000 (15:47 +0200)]
ui: node: storage removal: add checkbox for cleaning up disks

and factor out a SafeDestroyStorage sub-class to avoid duplication.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: node: add destroy menu for directory, lvm, lvmthin, zfs
Fabian Ebner [Mon, 25 Oct 2021 13:47:53 +0000 (15:47 +0200)]
ui: node: add destroy menu for directory, lvm, lvmthin, zfs

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: utils: add task descriptions for disk removal
Fabian Ebner [Mon, 25 Oct 2021 13:47:52 +0000 (15:47 +0200)]
ui: utils: add task descriptions for disk removal

For 'dirremove', it already exists.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: node: lvmthin: add volume group to columns
Fabian Ebner [Mon, 25 Oct 2021 13:47:51 +0000 (15:47 +0200)]
ui: node: lvmthin: add volume group to columns

to be able to identify thin pools even if they have the same name.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: node: directory: use gettext for 'Directory'
Fabian Ebner [Mon, 25 Oct 2021 13:47:50 +0000 (15:47 +0200)]
ui: node: directory: use gettext for 'Directory'

It's also localised when adding a storage for example.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui/UploadToStorage: check file extension
Lorenz Stechauner [Mon, 8 Nov 2021 08:53:50 +0000 (09:53 +0100)]
ui/UploadToStorage: check file extension

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui/UploadToStorage: add TaskViewer
Lorenz Stechauner [Mon, 8 Nov 2021 08:53:49 +0000 (09:53 +0100)]
ui/UploadToStorage: add TaskViewer

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofix #3505: ui/UploadToStorage: add checksum and algorithm
Lorenz Stechauner [Mon, 8 Nov 2021 08:53:48 +0000 (09:53 +0100)]
fix #3505: ui/UploadToStorage: add checksum and algorithm

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: refactor UploadToStorage.js
Lorenz Stechauner [Mon, 8 Nov 2021 08:53:47 +0000 (09:53 +0100)]
ui: refactor UploadToStorage.js

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.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: move upload window into UploadToStorage.js
Lorenz Stechauner [Mon, 8 Nov 2021 08:53:46 +0000 (09:53 +0100)]
ui: move upload window into UploadToStorage.js

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agod/control: bump versioned dependency for pve-cluster
Thomas Lamprecht [Tue, 9 Nov 2021 17:35:12 +0000 (18:35 +0100)]
d/control: bump versioned dependency for pve-cluster

ensure we got the notes property for the datacenter config and also
the newly registered/watched jobs.cfg for future pveschedule patches.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: close #3504: Add datacenter notes
Dominic Jäger [Wed, 22 Sep 2021 10:42:18 +0000 (12:42 +0200)]
ui: close #3504: Add datacenter notes

Like notes for nodes.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agod/control: bump b-d/depends
Fabian Grünbichler [Tue, 9 Nov 2021 16:47:26 +0000 (17:47 +0100)]
d/control: bump b-d/depends

for replication and protection changes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoui: prune: also handle new 'renamed' keep reason
Fabian Ebner [Thu, 30 Sep 2021 11:42:15 +0000 (13:42 +0200)]
ui: prune: also handle new 'renamed' keep reason

The back-end no longer returns 'protected' for renamed backups, and
'protected' backups are now their own kind.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: backup views: add button to change protection status
Fabian Ebner [Thu, 30 Sep 2021 11:42:14 +0000 (13:42 +0200)]
ui: backup views: add button to change protection status

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: backup views: add protected column
Fabian Ebner [Thu, 30 Sep 2021 11:42:13 +0000 (13:42 +0200)]
ui: backup views: add protected column

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: storage content: avoid redundant options hasNotesColumn and hideColumns
Fabian Ebner [Thu, 30 Sep 2021 11:42:12 +0000 (13:42 +0200)]
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).

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agovzdump: skip protected backups for dumpdir pruning
Fabian Ebner [Thu, 30 Sep 2021 11:42:11 +0000 (13:42 +0200)]
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.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>