Commit Graph

898 Commits

Author SHA1 Message Date
Thomas Lamprecht
c20699493a api: cluster: add jobs sub-directory index and set its permissions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 21:02:03 +01:00
Thomas Lamprecht
7cced7126b api: cluster: sort index
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 21:02:03 +01:00
Thomas Lamprecht
584a57ea3c 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>
2021-11-11 20:53:13 +01:00
Dominik Csapak
e190bc2cc8 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>
2021-11-11 18:35:52 +01:00
Dominik Csapak
6ec3dc437b 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>
2021-11-11 17:52:08 +01:00
Dominik Csapak
352a0e5c93 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>
2021-11-11 17:52:08 +01:00
Dominik Csapak
028af34e3d 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>
2021-11-11 17:52:08 +01:00
Dominik Csapak
0ab69d6e88 api: cephfs: refactor {ls, create}_fs
no function change intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-11 17:52:08 +01:00
Dominik Csapak
998b61fbff 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>
2021-11-10 16:11:42 +01:00
Dominik Csapak
305921b1ab 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>
2021-11-10 16:11:00 +01:00
Dominik Csapak
85b9ba88f1 api/backup: refactor string for all days
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-10 16:11:00 +01:00
Dominik Csapak
d3eed3b4a8 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>
2021-11-10 14:36:22 +01:00
Fabian Ebner
45d602f212 api: ceph: create osd: work around udev bug
There is a udev bug [0] which can ultimately lead to the udev database
for certain devices not being actively updated. The Diskmanage package
relies upon lsblk for certain info, and lsblk queries the udev
database. Ensure the information is updated by manually calling
'udevadm trigger' for the changed devices.

Without the fix, and a bit of bad luck, a cleaned up disk could still
show up as an 'LVM2_member' for example.

[0]: https://github.com/systemd/systemd/issues/18525

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-09-30 18:12:58 +02:00
Fabian Ebner
683a3563e7 api: check: create osd: use wipe_blockdev from the Diskmanage package
which is mostly a copy of the wipe_disks helper with the difference
that it also uses wipefs on the device and its partitions.

Remove the wipe_disks helper as no users remain.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-09-30 18:12:58 +02:00
Fabian Ebner
e256595683 api: ceph: create osd: re-check disk requirements after fork/lock
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-09-30 18:12:58 +02:00
Dylan Whyte
e95aae29ac Add/fix option descriptions in pvenode api docs
Adds some missing descriptions to the api/man page documentation, for
certain options of the `pvenode` command. Some minor language fix-ups
are also included

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2021-08-31 17:02:29 +02:00
Thomas Lamprecht
560bdfd846 api: network apply: fix check for ifupdown2 origin
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-15 14:30:52 +02:00
Thomas Lamprecht
ad7dd5a91f api: services: propagate "uninstalled" state for units
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 18:48:30 +02:00
Thomas Lamprecht
4ec19e8487 api: services: improve state detection for one-shot units
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 18:47:05 +02:00
Dominik Csapak
7195dcd37a API: Tasks: add more fields to return schema
so that they are documented and get displayed by pvesh/pvenode
all those fields must exists (since they come from the upid)
aside from the exitstatus, so marking that as optional

forum user reported that they are missing:
https://forum.proxmox.com/threads/ergebnis-eines-tasks-per-api-abfragen.92267/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-13 06:36:33 +02:00
Dominik Csapak
e8300c39df fix #3490: show more pci devices by default
we filtered out devices which belong into the 'Generic System Peripheral'
category, but this can contain actual useful pci devices
users want to pass through, so simply do not filter it by default.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-07 18:37:07 +02:00
Lorenz Stechauner
17711ff849 api: nodes: add query_url_metadata method
metadata is gained using a HEAD request.

Due to the ability of this api endpoint to request files on internal
networks (which would not be visible/accessible from outside) it is
restricted to users with permissions `Sys.Audit` and `Sys.Modify` on
`/`. Users with these permissions are able to alter node (network)
config anyway, so this should not create any further security risk.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
2021-07-03 00:36:20 +02:00
Thomas Lamprecht
df6f4b1874 move BackupInfo module into Cluster
no semantic change regarding API or the like intended

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 12:50:49 +02:00
Fabian Ebner
1a2e0e235e api: backup info: prefer kebab-case
And also add the 'backup-info' endpoint to the index.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 12:03:03 +02:00
Thomas Lamprecht
1bde7cd8df api: cluster: add backupinfo to subdirectories
to make it actually show up in auto-completion and some docs..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 11:36:26 +02:00
Thomas Lamprecht
db11051374 api: cluster/backupinfo: rework bogus index endpoint
This had a myriad of issues:

* marked as protected, thus forwarded to the privileged daemon even
  if it just returned static information
* did not return directory index but a "stub" string, which does not
  makes sense.
* not named index

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 11:34:34 +02:00
Fabian Ebner
7e33f74b22 api: apt: add PUT and POST handler for repositories
To allow adding/modifying them. Currently the only possible modification is
enable/disable.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 21:03:38 +02:00
Fabian Ebner
9005e0dfe1 api: apt: add call for repository information
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 21:03:09 +02:00
Hannes Laimer
c5f7b4b34f api: cluster/resources: add 'name' property to return schema
VM names are returned by the endpoint anyway, therefore it makes sense
to add it to the endpoint specification so it also appears in the API
docs and is visible when using pvesh with text output.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 17:59:53 +02:00
Dominik Csapak
acf8a27172 api: tasks: add 'statusfilter' to task list endpoint
Similar to PBS. The 'errors' filter parameter still takes precedence
(overrides this)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ Thomas: adapt to renamed PVE::Tools helper method ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 17:51:25 +02:00
Dominik Csapak
97e749ad3c api: tasks: add 'since' and 'until' filter for the task list
similar to PBS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 17:17:43 +02:00
Thomas Lamprecht
2cc7120e1b api: apt versions: track proxmox-backup-file-restore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-25 15:32:38 +02:00
Thomas Lamprecht
89e4fc8cc7 api/apt: whitespace/indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-25 14:07:03 +02:00
Fabian Ebner
0a7de3377b nodes: startall: correctly handle warning status for delayed task
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-24 08:50:38 +02:00
Thomas Lamprecht
48197df2b9 api: services: also track systemd-journald, as syslog is not often there anymore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-22 18:14:12 +02:00
Thomas Lamprecht
3546270cbc api: services: return more information
we have lots of information already parsed and cached, use that and
give the frontend more to work with/display.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-22 18:13:29 +02:00
Thomas Lamprecht
6d9807b68e api: services: whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 16:29:32 +02:00
Thomas Lamprecht
3a000e1193 api: services: track chrony
Keep systemd-timesync for now, old installations may have it around
for a while.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 16:28:40 +02:00
Thomas Lamprecht
5fa0c20483 api: services: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 16:25:27 +02:00
Thomas Lamprecht
0d213945f1 api: nodes: simplify appliance list code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 18:57:30 +02:00
Thomas Lamprecht
aee25c2ed1 api: nodes: simplify appliance download code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 18:57:23 +02:00
Thomas Lamprecht
c3020cf230 api: nodes: fix re-defined rpcenv/user variables regression
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 18:40:34 +02:00
Lorenz Stechauner
fac5d57e5b api: nodes: refactor aplinfo to use common download function
a common function to download arbitrary files from urls has been
defined as PVE::Tools::download_file_from_url and is now used.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-06-18 18:36:06 +02:00
Alwin Antreich
0b6a283801 fix #2422: allow multiple Ceph public networks
Multiple public networks can be defined in the ceph.conf. The networks need to
be routed to each other.

Support handling multiple IPs for a single monitor. By default, one address from
each public network is selected for monitor creation, but, as before, it can be
overwritten with the mon-address parameter, now taking a list of addresses.

On removal, make sure the all addresses are removed from the mon_host entry in
the ceph configuration.

Originally-by: Alwin Antreich <a.antreich@proxmox.com>
[handling of multiple addresses]
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:13:05 +02:00
Fabian Ebner
815325da0d api: ceph: mon: fix handling of IPv6 addresses in destroymon
by also comparing the canonical form to decide when to remove an address. When
getting the IP from the rados information, also drop eventual brackets, so our
existing function can handle it. Add the brackets back within the
remove_addr_from_mon_host function.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:13:05 +02:00
Fabian Ebner
3e10f0fcdb api: ceph: mon: factor out mon_host regex address removal
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:13:04 +02:00
Fabian Ebner
9e989449ae api: ceph: mon: fix handling of IPv6 addresses in assert_mon_prerequisites
by comparing their canonical forms.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:13:04 +02:00
Fabian Ebner
4be756f59c api: ceph: mon: add ips_from_mon_host helper
Partially based on pve-storage's CephConfig.pm get_monaddr_list, but the
interface is not the best for the use case here.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:13:04 +02:00
Fabian Ebner
396acb1577 api: ceph: mon: fix handling of IPv6 addresses in find_mon_ip
by comparing their canonical forms.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:13:04 +02:00
Fabian Ebner
8ecaa0bfbe api: ceph: create mon: explicitly add subsequent monitors to the monmap
in preparation for supporting multiple addresses. The config section does not
allow more than one public_addr.

Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:13:04 +02:00