Commit Graph

1004 Commits

Author SHA1 Message Date
Aaron Lauterer
e907f822d7 api ceph osd: add OSD index, metadata and lv-info
To get more details for a single OSD, we add two new endpoints:
* nodes/{node}/ceph/osd/{osdid}/metadata
* nodes/{node}/ceph/osd/{osdid}/lv-info

The {osdid} endpoint itself gets a new GET handler to return the index.

The metadata one provides various metadata regarding the OSD.

Such as
* process id
* memory usage
* info about devices used (bdev/block, db, wal)
    * size
    * disks used (sdX)
    ...
* network addresses and ports used
...

Memory usage and PID are retrieved from systemd while the rest can be
retrieved from the metadata provided by Ceph.

The second one (lv-info) returns the following infos for a logical
volume:
* creation time
* lv name
* lv path
* lv size
* lv uuid
* vg name

Possible volumes are:
* block (default value if not provided)
* db
* wal

'ceph-volume' is used to gather the infos, except for the creation time
of the LV which is retrieved via 'lvs'.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by:  Dominik Csapak <d.csapak@proxmox.com>
2023-03-15 18:24:27 +01:00
Fiona Ebner
6aec456504 api: node: bulk actions: allow when user has permission for each guest
Users with permissions for some guests can already start a task for
each sequentially.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-03-15 18:21:56 +01:00
Dominik Csapak
2f4105013b api: return missing 'hardware' entry in node endpoint index
The 'hardware' entry was missing there. While interfacing with it
works, it will not show up during CLI auto completion and in the HTML
debug view (/api2/html/) if not listed here in the API directory
index.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-11 17:57:02 +01:00
Aaron Lauterer
c4368cf6d6 ceph osd: return PGs per OSD and show in UI
By switching from 'ceph osd tree' to the 'ceph osd df tree' mon API
equivalent , we get the same data structure with more information per
OSD. One of them is the number of PGs stored on that OSD.

The number of PGs per OSD is an important number, for example when
trying to figure out why the performance is not as good as expected.
Therefore, adding it to the OSD overview visible by default should
reduce the number of times, one needs to access the CLI.

Comparing runtime cost on a 3 node ceph cluster with 4 OSDs each doing 50k
iterations gives:

               Rate osd-df-tree    osd-tree
osd-df-tree  9141/s          --        -25%
osd-tree    12136/s         33%          --

So, while definitively a bit slower, but it's still in the µs range,
and as such below HTTP in TLS in TCP connection setup for most users,
so worth the extra useful information.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
 [ TL: slight rewording of subject and add benchmark data ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-15 10:16:50 +01:00
Stefan Sterz
31746f261a fix #4521: api/tasks: replace upid as filename for task log downloads
previously the upid would just be used without a file extension when
downloading a task log. this lead to rather strange filenames that
appeared unfamiliar to users as the upid is not very prevalent in the
gui. set a proper file name based on the node name, worker type and a
time stamp instead. also add the ".log" file extension to indicate
that these files contain logs.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-02-09 17:18:52 +01:00
Thomas Lamprecht
a689d3c04c api apt: fix spelling in hash to avoid undef access warnings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-02 08:42:12 +01:00
Thomas Lamprecht
592635817e api apt: support getting changelog of backports packages
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-01 12:27:29 +01:00
Thomas Lamprecht
ef2c6453ac api apt: code/style cleanup in changelog endpoint
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-01 12:25:42 +01:00
Thomas Lamprecht
913d893364 api apt: recduce indentation in package status update sub
best viewed with `-w` flag

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-01 12:21:54 +01:00
Thomas Lamprecht
a8cac426df api apt: code/style cleanup getting changelog URL
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-01 12:20:28 +01:00
Leo Nunner
2bbfac1f45 fix #4481: fetch changelogs for any Proxmox repository
This patch fixes the issue that when the user supplied any non-standard
repositories, the changelogs often wouldn't load. For example, providing
both pve-no-subscription and pbs-no-subscription broke the changelog
API, since the URL built for pbs-no-subscription was invalid.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
2023-01-31 18:03:26 +01:00
Fiona Ebner
118f9076cf api: apt: versions: add proxmox-mail-forward to package list
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-01-18 11:06:43 +01:00
Thomas Lamprecht
08d251ef2b api: ceph metadata: rename instance placeholder to id in return schema
It's a bit more commonly used for such identifier

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-16 16:32:16 +01:00
Aaron Lauterer
ee6ec73ba9 api: ceph: metadata: update return schema
This API endpoint returns a big nested schema. This patch adds a mostly
complete description.

For the actual service instance return schema, we include commonly used
and important properties. It will usually return more. What exactly
depends on the Ceph service type.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2023-01-16 14:32:00 +01:00
Aaron Lauterer
b62ba85ad7 api: ceph: update return schemas
to include a more complete description of the returned data.
Sort properties in alphabetical order if the list is longer.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2023-01-16 14:32:00 +01:00
Thomas Lamprecht
853ce1ea65 fixup! api: node stopall: expose setting the task timeout as endpoint parameter 2023-01-14 17:41:04 +01:00
Thomas Lamprecht
1154329312 api: node stopall: expose setting force-stop behavior
So that one can really decide if this is a shutdown or an actual
stop.

partially related to #4194

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-14 17:41:04 +01:00
Thomas Lamprecht
8f063fbc7f api: node stopall: expose setting the task timeout as endpoint parameter
Note that this changes the lower timeout of 60s for CTs also to 180s
like VM always used; besides that there's not much gained making that
distinction there was never a really good argument for this.

partially related to #4194

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-14 17:41:04 +01:00
Thomas Lamprecht
b27ebcadb8 api: nodes: move variable definition closer to use site
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-14 17:41:04 +01:00
Thomas Lamprecht
f77faab20a api: nodes: code style/indentation fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-14 17:41:04 +01:00
Matthias Heiserer
136f5724be API: ceph: fix typo in permissions
With Sys.Audit being spelled wrong, this call always failed

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2023-01-13 12:39:40 +01:00
Thomas Lamprecht
709065a63f api: task download: improve code/comment locallity slightly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-04 14:38:19 +01:00
Thomas Lamprecht
2ebba46720 api: task download: name clashing params explicit
we might add other ones that might be used together with the
`download` one, so rather be explicit on communicating what we check.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-04 14:37:08 +01:00
Thomas Lamprecht
627903257b api: task download: avoid useless intermediate variable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-04 14:36:47 +01:00
Daniel Tschlatscher
aa73246bd4 make task log downloadable in the PVE manager backend
The read_tasklog API call now stream the whole log file if the query
parameter 'download' is set to true.
This is done in preparation for the task log download button to be
added in the TaskViewer.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Tested-by: Stefan Sterz <s.sterz@proxmox.com>
Reviewed-by: Stefan Sterz <s.sterz@proxmox.com>
2023-01-04 14:32:11 +01:00
Aaron Lauterer
56b03211e6 api: ceph: sort and update index sub-directory list
The 'cmd-safety', 'configdb' and 'mgr' items were missing, and while
directly calling the API endpoints worked, the api-viewer and pvesh
where partially broken here.

Sort the whole list alphabetically will make it easier to track in
the future

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
 [ T: note which items where missing and reword slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-12-21 14:55:14 +01:00
Aaron Lauterer
f18b7ddd36 api: ceph: fix grammar/styling in descriptions
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
 [ T: slightly rework commit subject ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-12-21 14:50:11 +01:00
Thomas Lamprecht
c3264e92ca api: apt: code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-12-16 13:01:24 +01:00
Fiona Ebner
2b233ecc08 api: vzdump: soften parameter permission checks
Allows sufficiently privileged users to pass-in retention and
performance parameters for manual backup, but keeps tmpdir, dumpdir
and script root-only. Such users could already edit the job
accordingly, so essentially not granting anything new.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-21 14:13:05 +01:00
Thomas Lamprecht
65cbfe79e4 fix #4245: api: node HW: allow to get PCI info with Sys.Audit on /
keep Sys.Modify only for backward compat, as it does not make really
much sense to ask for that on an informative GET call.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-20 13:29:58 +01:00
Aaron Lauterer
ccb281a7ae 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:

MON:
  - ok-to-stop
  - ok-to-rm
OSD:
  - ok-to-stop
  - safe-to-destroy
MDS:
  - ok-to-stop

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.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2022-11-17 18:27:48 +01:00
Dominik Csapak
1f6d7f7fbf 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>
2022-11-17 18:16:43 +01:00
Dominik Csapak
d18b69822e api: /cluster/resources: add tags to returned properties
by querying 'lock' and 'tags' with 'get_guest_config_properties'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:16:24 +01:00
Stefan Sterz
7818083008 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>
2022-11-16 20:24:12 +01:00
Fiona Ebner
7060a39316 cluster resources: add cgroup-mode to node properties
so the frontend has the information readily available.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-15 14:08:55 +01:00
Thomas Lamprecht
63d389bc51 api: backup info: make "name" property truly optional in response struct
avoid returning a nullish/undef value if not specified

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-15 14:07:39 +01:00
Thomas Lamprecht
fc9991245f api: backup info: code/style cleanup/rework/modernization
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-15 14:07:39 +01:00
Thomas Lamprecht
730d5a0f42 api: backup info: drop querying rrd_dump, not used
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-15 14:07:39 +01:00
Thomas Lamprecht
0d3f86f2a4 api: backup info: rework get_included_vmids code style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-15 14:07:39 +01:00
Thomas Lamprecht
2b5f3f98cd api vzdump: split/sort module usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-15 14:07:39 +01:00
Fiona Ebner
7a516cbfd1 api: vzdump: also check for default storage permission
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-15 13:58:29 +01:00
Fiona Ebner
082e029758 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.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-15 13:29:34 +01:00
Thomas Lamprecht
6f2e57c050 jobs: move base registry to pve-common & split vzdump base out to guest-common
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:59:38 +01:00
Wolfgang Bumiller
55fb2eadb1 fixup /cluster/resources schema
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-04 16:20:18 +01:00
Aaron Lauterer
655080eeeb api: ceph: pools: get_storages: set pool name if missing
This avoids errors about the use of uninitialized values if the 'pool'
parameter is not present in the storage configuration.

The 'pool' property for an RBD storage config is not mandatory.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2022-10-14 15:43:53 +02:00
Fiona Ebner
93880785c8 vzdump: handle new 'performance' property string
Also generalizes the way vzdump property strings are handled for jobs.
Something similar could be done in VZDump.pm, but there the maxfiles
and prune-backups settings are currently coupled, so a dedicated
parse_performance() is used instead. Can be changed once maxfiles is
dropped.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-10-10 13:04:17 +02:00
Fabian Grünbichler
d088f89b16 apt: add proxmox-offline-mirror-helper package
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-15 09:07:11 +02:00
Fabian Grünbichler
8794bb15de apt: sort list of optional packages
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-15 09:07:11 +02:00
Fabian Grünbichler
25eaf729d7 subscription: handle missing subscription info
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 14:50:32 +02:00
Thomas Lamprecht
dbfcac27d5 api: nodes: code/style rework start/stop list generation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-09-07 09:47:48 +02:00