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
Thomas Lamprecht [Wed, 21 Apr 2021 15:34:22 +0000 (17:34 +0200)]
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>
Thomas Lamprecht [Wed, 21 Apr 2021 11:11:39 +0000 (13:11 +0200)]
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>
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.
* 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
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.
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.
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
Thomas Lamprecht [Tue, 20 Apr 2021 16:05:56 +0000 (18:05 +0200)]
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>
Dominic Jäger [Mon, 11 Jan 2021 11:42:58 +0000 (12:42 +0100)]
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
Mira Limbeck [Fri, 16 Apr 2021 13:15:54 +0000 (15:15 +0200)]
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>
Thomas Lamprecht [Thu, 15 Apr 2021 17:44:59 +0000 (19:44 +0200)]
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>
Thomas Lamprecht [Thu, 15 Apr 2021 17:33:26 +0000 (19:33 +0200)]
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>
Fabian Ebner [Thu, 11 Mar 2021 09:22:05 +0000 (10:22 +0100)]
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.
Dominik Csapak [Mon, 15 Mar 2021 14:28:11 +0000 (15:28 +0100)]
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')
Thomas Lamprecht [Mon, 15 Mar 2021 08:14:56 +0000 (09:14 +0100)]
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>
Fabian Ebner [Mon, 15 Mar 2021 11:57:29 +0000 (12:57 +0100)]
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.
Fabian Ebner [Mon, 15 Mar 2021 11:57:28 +0000 (12:57 +0100)]
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.
Stefan Reiter [Mon, 8 Mar 2021 10:01:48 +0000 (11:01 +0100)]
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>
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>
Thomas Lamprecht [Mon, 22 Feb 2021 13:30:53 +0000 (14:30 +0100)]
ui: firewall grid: try balance between flex and good overview
Recently, with the Proxmox Backup sync/verify/.. job grids I had to
change my mind regarding use of flex, overuse of it is as bad as
having all to fixed widths as it spreads out the data a lot on big
screens, making it hard to follow as lots of eye movement is
required.
What we ideally would have is a "maxFlexWidth", i.e., a maximal
auto-flex width which still allows wider columns if a user manually
drags it wider. "maxWidth" comes close, but is a hard limit and so
use it only in cases where its quite clear that wider columns make no
sense (surely someone will disagree even for those, but well...).
Basic solution is to add lots more flex ratio to comment so that the
others won't get to big fast, keeping the actual relevant config of a
rule somewhat close by (thus easier to read/grasp/parse)
Also move the source/destination port columns after their direction
column and abbreviate their header title.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 22 Feb 2021 13:28:35 +0000 (14:28 +0100)]
ui: firewall grid: fix rendering comment, only show tooltip when truncated
avoid showing "undefined" if there's no comment, renderer must not
return null or undefined directly, it will converted to string as is,
so always fallback to '' empty string
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Aaron Lauterer [Mon, 22 Feb 2021 10:16:26 +0000 (11:16 +0100)]
ui: FirewallRules: Add tooltip to comments
The comment columns might not be wide enough for longer comments. Since
it is the most right columns, it can be tricky to grab the right pixel
to drag it wider.
Aaron Lauterer [Mon, 22 Feb 2021 10:16:25 +0000 (11:16 +0100)]
ui: FirewallRules: make columns flexible
Changing the width definitions to use flex will make better use on
larger monitors. Changing the `width` parameter to `minWidth` ensures
that on smaller screens it is still usable, though some horizontal
scrolling might be necessary.
There are several types of drives that use the same config keys. Most
notably CDRom and regular VM disks (EFI and cloudinit exist as well).
Since there is a dedicated permission for CDRom drives we need to check
permissions in more detail, depending on what type of drive it actually
is for things like the edit, remove and Add -> CDRom buttons.
The permission check in the row definition itself which only checked for
'VM.Config.Disk' permissions (never_delete) had to be removed and finer
grained checks added for the individual buttons. This also meant a bit
of reshuffling in the checks what kind of disk the current one is.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Fri, 12 Feb 2021 15:01:15 +0000 (16:01 +0100)]
ui: dc/TokenEdit: fix editing existing tokens
we always have to calculate the url correctly, not only on creation
otherwise we try to edit the token by doing a 'PUT' request on
/access/users
and not on
/access/users/USERID/token/TOKENID
Dominik Csapak [Fri, 19 Feb 2021 14:27:00 +0000 (15:27 +0100)]
ui: window/Settings: fix labelWidth for saved user name
Somewhere during rendering of the window, extjs wants to add 5px to
the labelwidth for the surrounding container. Having a string here
results in the container having a width of 1505px instead of 155px and
the value of the field is far off to the right and not visible.