Commit Graph

887 Commits

Author SHA1 Message Date
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
Fabian Ebner
57951fc78b api: ceph: create mon: factor out monmaptool command
so it's easier to re-use for a future variant.

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
Fabian Ebner
d3b899c144 api: ceph: create mon: handle ms_bind_ipv* options more generally
mostly relevant to prepare support for IPv4/IPv6 dual stack mode as a special
case of the planned support for mutliple public networks.

As before, only set the false value when we are dealing with the first address,
but also be explicit about the IPv4 case as the defaults might change in the
future.

Then, when an address of a different type comes along later, set the relevant
bind option to true.

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
Fabian Ebner
6e96b07078 api: ceph: mon: split up arguments for run_command
no functional change is intended.

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
Thomas Lamprecht
ff119724ee vdzump: whitespace/extra-lines clean up
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 14:35:25 +02:00
Thomas Lamprecht
0e68b116f3 api: nodes: fix typo
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-17 16:27:55 +02:00
Fabian Ebner
596bb7b11a api: ceph: osd: create: rename size parameters
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 11:29:34 +02:00
Fabian Ebner
1c6bf641cb api: ceph: remove moved 'flags' calls
living below /cluster/ceph now. Frontend was adapted as part of the move in
commit 1225095df1

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 11:29:34 +02:00
Fabian Ebner
337a983cd3 api: ceph: remove obsoleted disks call
replaced by /nodes/{node}/disks/list

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 11:29:34 +02:00
Fabian Ebner
05d5446df8 api: move cpu path into qemu/capabilities
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 11:29:34 +02:00
Fabian Ebner
0c8e509eb5 api: nodes: remove deprecated upgrade parameter for vncshell
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 11:29:32 +02:00
Fabian Ebner
b270a6b4ea api: nodes: remove deprecated upgrade parameter for spiceshell
The change not to pass the 'upgrade' parameter in the frontend was made in
953f6e9bb3 (the commit doesn't talk about it, it's
likely an accidental squash of two changes)

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 10:51:53 +02:00