Commit Graph

5515 Commits

Author SHA1 Message Date
Fabian Ebner
af6f4b9ba0 ui: remove SafeDestroy window
which has been moved to proxmox-widget-toolkit.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 13:02:45 +02:00
Fabian Ebner
b9635c9b99 ui: use safe destroy window from proxmox-widget-toolkit
for the remaining (i.e. non-guests) users.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 13:02:45 +02:00
Fabian Ebner
94d2359b78 ui: safe destroy guest: add checkbox for removal of unreferenced disks
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:48:41 +02:00
Fabian Ebner
2452e18de4 ui: use new SafeDestroyGuest window
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:48:41 +02:00
Fabian Ebner
803053dad8 ui: add SafeDestroyGuest window
The purge parameter is always explicitly set, which is different from the
existing behavior, but it does not rely on what the default in the backend is.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:48:41 +02:00
Dominik Csapak
ced67201ad ui: Parser: respect mtu in {parse, print}QemuNetwork
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 12:15:10 +02:00
Thomas Lamprecht
736b919d04 http server: comment and refactor CSRF skip-check logic
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 11:19:40 +02:00
Lorenz Stechauner
7d11059e2d http-server: fix for api token csrf token check
Do not check any csrf tokens for auth with api tokens.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-04-22 10:54:26 +02:00
Thomas Lamprecht
e45f98ef8b http-server: minor code/indentation/comment cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 09:10:24 +02:00
Lorenz Stechauner
d9fc56efab fix #3389: Skip CSRF token check also for API tokens on file upload
On file upload, the check for CSRF tokens was already skipped when
performing user authentication. This now happens for API tokens also.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 09:01:11 +02:00
Dominik Csapak
8aac63a5db ui: Utils: change default Console order for vms
we want to use spice for vms more than xtermjs if both are available
(since spice must be chosen as display in that case)
so the resulting order of preference for vms is:
  spice
  xtermjs
  novnc

since all methods work for containers always, there we use
xtermjs by default, or what is chosen in the datacenter option

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 08:51:24 +02:00
Thomas Lamprecht
a91bd3c370 api: ceph pool create: replace left-over complex error handling
this was from the time where we had a loop here to add two storages,
one for KRDB-only and one for KRBD-never. Nowadays we can handle the
mixed case just fine, but the patch dropping that forget to cleanup
the error handling..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 17:34:23 +02:00
Dominik Csapak
27cc48c212 ui: add comment about disabling spice/xterm initially
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-21 17:29:21 +02:00
Thomas Lamprecht
68f94af88a ceph: pool set: fix printing problematic settings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 16:06:29 +02:00
Thomas Lamprecht
cb83113ddc ceph: pool set: print settings as they are applied
a bit of a weird place to print code-wise, but it shows up in the
task log just fine.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 16:05:42 +02:00
Thomas Lamprecht
69c0ff3e60 ceph: pool set: improve handling "size" parameter
instead of fully duplicating the code just order it first if it
exists...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 15:49:43 +02:00
Thomas Lamprecht
84b08e8aec api: ceph/pool: fix formatting of API parameters
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 15:45:35 +02:00
Thomas Lamprecht
86a5da839a ui: ceph/pool: fix setting target ratio/size (back) to zero
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 15:44:47 +02:00
Thomas Lamprecht
0e0f861a04 ui: ceph/pool: fix minWidths for columns to support 720p without scrolling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 15:41:03 +02:00
Thomas Lamprecht
00c0fc4bb5 ceph: pool: make min_size constrain check more general
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 14:19:50 +02:00
Thomas Lamprecht
5c2c2a6db9 ceph: pool: min_size should be auto-set to > size/2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 14:18:36 +02:00
Thomas Lamprecht
4d7acd65bf ceph: pool edit: improve UX of target size/ratio fields
s/Target Size Ratio/Target Ratio/, shorter and ceph docs call it also
that way, allows do drop the non-standard label width.

Add tooltips to explain both, target size and ratio, a bit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 13:31:06 +02:00
Thomas Lamprecht
18a5845e34 ceph: pools: use sizeField, nicer UX and less code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 13:15:32 +02:00
Thomas Lamprecht
8654b4b02f ui: size-field: add more units
This would probably benefit from being an object alá:
```
'GiB': {
    base: 2,
    order: 30,
},
```
but that would be a transparent internal change, and the current way
isn't yet a limitation, so ...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 13:11:41 +02:00
Thomas Lamprecht
635163b051 ui: transform bandwidth-field to generic size-field & derive bandwidth from that
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 13:03:36 +02:00
Thomas Lamprecht
d43aec909b ui: bandwidth field: make unit postfix configurable
preparation for making this widget more general, for sizes (not over
time) too

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 13:01:54 +02:00
Thomas Lamprecht
e1e930c39b ui: bandwidth field: fix eslint complaints and slight readability improvements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 13:00:08 +02:00
Thomas Lamprecht
ec455ed049 ui: ceph/pools: refactor to more declarative style
no semantic changes intended, fixes a few eslint issues along the
way.

This could be further improved by using a ViewController, but lets
keep it at this compromise for now due to work time ROI.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-21 12:56:53 +02:00
Dominik Csapak
cc0734fc9f ui: ceph/Pool: show progress on pool edit/create
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Dominik Csapak
17b90534d4 ui: ceph/Pools: improve number checking for target_size
the field gives us a string, so the second condition could never
be true, instead parse to a float instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Dominik Csapak
08db34257a API2/Ceph/Pools: remove unnecessary boolean conversion
we do nothing with that field, so leave it like it is

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Alwin Antreich
11d7427400 fix: ceph: always set pool size first
Since Ceph Nautilus 14.2.10 and Octopus 15.2.2 the min_size of a pool is
calculated by the size (round(size / 2)). When size is applied after
min_size to the pool, the manual specified min_size will be overwritten.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Alwin Antreich
ae79323250 ceph: gui: add min num of PG
this is used to fine-tune the ceph autoscaler

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Alwin Antreich
4618a86964 ceph: gui: rework pool input panel
* add the ability to edit an existing pool
* allow adjustment of autoscale settings
* warn if user specifies min_size 1
* disallow min_size 1 on pool create
* calculate min_size replica by size

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Alwin Antreich
6b36f36842 ceph: set allowed minimal pg_num down to 1
In Ceph Octopus the device_health_metrics pool is auto-created with 1
PG. Since Ceph has the ability to split/merge PGs, hitting the wrong PG
count is now less of an issue anyhow.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Alwin Antreich
11ce9e1a1d ceph: gui: add autoscale & flatten pool view
Letting the columns flex needs a flat column head structure.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Alwin Antreich
5a3d794242 ceph: add autoscale_status to api calls
the properties target_size_ratio, target_size_bytes and pg_num_min are
used to fine-tune the pg_autoscaler and are set on a pool. The updated
pool list shows now autoscale settings & status. Including the new
(optimal) target PGs. To make it easier for new users to get/set the
correct amount of PGs.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:20:35 +02:00
Dominik Csapak
d7518964d9 ui: qemu/Config: disable xtermjs and spice until status is loaded
We enable/disable spice/xtermjs for the console button in the 'load'
callback of the statusstore, depending on the vms capabilities,
but until the first load there, the only safe option is novnc.

So we have to disable xtermjs and spice on start, else a click on
the button might open a window that cannot connect to the vm.

a forum user probably triggered this:
https://forum.proxmox.com/threads/unable-to-find-serial-interface-console-problem.87705

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:14:58 +02:00
Thomas Lamprecht
d7a63207a3 ceph: osd_belongs_to_node: only check tree-entries of type host, refactor
We want to check explicitly for type host, so filter for that first
and create a hash map for easier usage afterwards.

Drop the error when there's no tree, as either RADOS error'd on bad
command already, or there really is no tree (but RADOS worked OK), in
which case we simply return that the OSD did not belong to this node.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-20 18:06:07 +02:00
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