Commit Graph

5426 Commits

Author SHA1 Message Date
Dominic Jäger
e12c5dbf22 Add tests for OSD-belongs-to-node helper
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-04-20 16:42:12 +02:00
Dominic Jäger
220173e9c6 Fix #2053: OSD destroy only on specified node
Allow destroying only OSDs that belong to the node that has been specified in
the API path.

So if
 - OSD 1 belongs to node A and
 - OSD 2 belongs to node B
then
 - pvesh delete nodes/A/ceph/osd/1 is allowed but
 - pvesh delete nodes/A/ceph/osd/2 is not

Destroying an OSD via GUI automatically inserts the correct node
into the API path.

pveceph automatically insert the local node into the API call, too.
Consequently, it can now only destroy local OSDs (fix #2053).
 - pveceph osd destroy 1 is allowed on node A but
 - pveceph osd destroy 2 is not

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-04-20 16:42:12 +02:00
Mira Limbeck
1226cd97f9 report: add multipath.conf and wwids file
These 2 files can be helpful for issues with multipath. The multipath -v3
output is too large most of the time and not required for analyzing and
solving the issues.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2021-04-16 15:20:40 +02:00
Thomas Lamprecht
7b04342fc2 bump version to 6.3-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:57:14 +02:00
Thomas Lamprecht
424c94fee8 api: resources: only get guest lock after real access check
The guest iteration is slightly confusing as we also handle the
accumulated pool settings there, so we only check the VM.Audit privs.
for a specific VM and skip to the next if the permissions is not
there after those pool handling.

So, move operations which are only required when VM privs. are there
below this check.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:45:01 +02:00
Thomas Lamprecht
ab8ed6f4b0 api: resources: push guest, pool and sdn info sorted
makes it easier to compare in API responses, and those list are not
huge, seldom over a few thousands, which is peanut crumbs compared to
all the other thing in this perl stack.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:35:31 +02:00
Thomas Lamprecht
e67d454a18 ui: use byte unit and power-of-two base for memory rrd graphs
To better match the gauge in the current status infobox in the same
summary panel, which is already using a format where KiB is 1024

the latter needs a (not yet bumped) widget toolkit update to 2.5-2 or
newer, just setting now to avoid forgetting it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:31:03 +02:00
Thomas Lamprecht
52b31ee327 ui: live restore: make warning to a shorter note
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 17:21:47 +02:00
Stefan Reiter
878bbf0b96 ui: restore: add live-restore checkbox
Add 'isPBS' parameter for Restore window so we can detect when to show
the 'live-restore' checkbox.

Includes a warning about this feature being experimental for now.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-15 17:18:40 +02:00
Fabian Ebner
875c2e5aae vzdump: getlock: return lock file handle and let the caller close it
so it doesn't get out of scope too early.

Regression introduced by 5620e5761e as pointed
out by Fabian Grünbichler.

Reported in the community forum:
https://forum.proxmox.com/threads/limit-simultaneous-backup-jobs.87489

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-12 14:36:08 +02:00
Fabian Ebner
164651dab6 vzdump: storage info: move out activate storage call
Otherwise storage_info() cannot be used for (at least) PBS storages from an API
call without 'protected => 1', because the password cannot be read from
'/etc/pve/priv'. Note that the function itself does not need the storage to be
active, because it only uses storage_config() and get_backup_dir().

AFAICT new() is the only existing user of this function and can be responsible
for activating the storage itself.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-31 15:40:13 +02:00
Mira Limbeck
ac7bf67282 js: readd SLAAC option to IPConfig
Now that SLAAC is supported, we can revert commit 793f2cf4.
SLAAC requires cloud-init 19.4 or newer.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2021-03-31 15:35:59 +02:00
Dominik Csapak
c0b8a02bb8 ui: backups: enable editing notes for Proxmox Backup Server
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-25 09:20:46 +01:00
Fabian Ebner
7c5f30bcd5 ui: cluster task log: eslint fixes
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-16 14:52:36 +01:00
Dominik Csapak
bc33c73963 metrix: influx: fix default api_prefix
we set the api prefix by default to '/' so we always triggered
the the replacement and added '///' which is wrong and does not
work for the 'health' api path
(influxdb returns 404 for 'https://ip:port///health')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-03-15 15:28:11 +01:00
Dominik Csapak
c7777408ea metrics: influx: special case 'health' api path i _get_v2url
the forwards compatible api of 1.8 only contains this path
(not api/v2/health) and it it also contained in the v2 api

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-03-15 15:26:46 +01:00
Thomas Lamprecht
c69faba311 ui: metrics: influxdb: add support for new api-path-prefix field
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
23c9eaf63d metrics: influx: allow one to add an API URL-path prefix
I normally use a reverse proxy in front of my influxdb instances,
proxying all from the /influx/ path to the only locally listening
influxdb. So here I'd need to set "influx" as api-path-prefix.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
6e5405fb21 metrics: influx: do not error out when credendtials could not be loaded
Not a hard error, some network box (proxy) down the line could add it
for us, or it could be just not required, so ...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
bb35a833d1 metrics: influx: send along auth token on connection test too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
9f8d8f2b05 metrics: influx: include unrecognized protocol value in error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Fabian Ebner
23b596dce0 ui: avoid errors when 'template' property is not present in guest status
The API doesn't advertise the property as non-optional and it's safer and more
in line with the surrounding code.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-15 13:59:52 +01:00
Fabian Ebner
9ae4a024f0 ui: restore: fix bandwidth limit behavior
by allowing zero and updating the field name. Otherwise the hint mentioning zero
is wrong. Also, it's not only a read limit as the emptyText already indicates.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-15 13:26:05 +01:00
Fabian Ebner
dcbc3b3ee9 ui: bandwidth limit selector: make it possible to allow zero
The initial value is '' and in getSubmitValue(), previously the branch
   if (v == 0 || v == 0.0) return null;
was taken, because of the lax '==' comparision. Make sure we still return null
for '' by explicitly checking for it.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-15 13:26:05 +01:00
Thomas Lamprecht
f8d1d5ad9a ext. metris. fixup InfluxDB spelling in schema and code style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-13 21:30:03 +01:00
Thomas Lamprecht
63d4344ef1 bump version to 6.3-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-09 08:34:03 +01:00
Stefan Reiter
4a0ccbadc3 ui/hardware: extend machine renderer to show pinned Windows versions
The default is not just "i440fx", this hides the fact that the version
will be pinned to 5.1, unless one deliberately opens the editor.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Stefan Reiter
43798244a9 Utils: add is_windows and use in MachineEdit
A bit more future proof and reuseable than a regex match.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Stefan Reiter
cfdb6ac69c ui/machine: fix eslint warning (unnecessary parentheses)
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Stefan Reiter
34aec3514c ui/machine: fix Windows pinning and detect "pc" as non-pinned
We need to detect "isWindows" before splitting a pinned version into
.version/.machine, otherwise .machine will always be "pc" or "q35", and
the check in "isWindows" will succeed even for pinned versions. This
resulted in "5.1" being shown even if a different version has been set
for a Windows machine.

Also alias "pc" directly to "__default__", as they have the same
meaning, but "pc" is not a valid entry in the "machine" combobox,
leading to an invalid state when editing the (valid) configuration of
"machine: pc" on a VM.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Stefan Reiter
86c112d069 ui: add onlineHelp to rng
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Thomas Lamprecht
16788eac58 bump version to 6.3-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 22:23:19 +01:00
Thomas Lamprecht
6c2bc32631 ui: vm/machine: show autopinned version for win VM
and improve switchting machine type and keeping same version for
the windows based VMs, as we cannot do the same as for other
OS-Types, just select the "latest" magic version.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 22:23:19 +01:00
Fabian Ebner
914e86ccbd partially fix #2745: vzdump: use default for remove parameter
The initial default from the $confdesc is 1 anyways, and like
this changing the default in /etc/vzdump.conf to 0 actually works.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
432639a82a ui: vm/machine: show notice about effects of machine version change
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
1fe7de1a5e ui: vm/machine: allow blank to avoid invalidity and show Latest as empty text
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
aeb61a525b ui: vm/machine: only set advanced temporary visible for pinned machines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
c0cb5eee2e ui: vm/machine: avoid showing latest for windows VMs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
60cc233a10 ui: style followup cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
1b344da292 ui: vm/machine: adapt to API changes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Stefan Reiter
a51b2c335d ui: MachineEdit: add option for machine version pinning
Hidden behind "Advanced" options, as to not confuse inexperienced users.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Stefan Reiter
9dbddec75b ui: create MachineEdit window
no functional change intended

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
c6c4b2788d api: node: add capabilities path and move qemu machines over
avoid further crowding the top-level node API path with such
"what can some part of the node currently do" stuff, rather move it
down.

The QEMU cpu stuff should move also down there.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
5a378425b8 api: nodes: sort use statements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Stefan Reiter
32ad9758a2 api: register Qemu::Machine call
as 'machine-types', so it is clear this refers to QEMU machines, not the
local machine (as one might think, this being a 'node' API call).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
cc5e0685be buildsys: api: sort sources
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
784d6ee9b4 api: nodes: sort index
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
c2162150f1 metric status: fix misspelled method call
reported in:
https://forum.proxmox.com/threads/typo-in-influxdb-pm.85017/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-27 16:11:09 +01:00
Thomas Lamprecht
face18ee72 ui: zpool status detail: reuse existing translation
this is not something one really questions when not there, so avoid
adding a extra overly specific translation as "No Data" fits quite
well..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-26 09:15:29 +01:00
Stoiko Ivanov
91399609b2 ui: zpool status detail: add default for scrub information
in case a zpool has not been yet scrubbed, there is no 'scan'
information in `zpool status` output.

Adding a informational text in that case might help users to notice
that something is not configured optimally (e.g. disabled cronjob)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-02-26 09:10:44 +01:00