Stefan Reiter [Tue, 25 Feb 2020 15:32:00 +0000 (16:32 +0100)]
fix #2611: gui: use backendUnit and pretty renderer
Slightly confusing with the units:
* Backend stores values in KiB/s
* Frontend displays MiB/s (which is a good choice when considering
current generation network speeds as opposed to huge KiB numbers IMO)
* Renderer previously showed no units, which would usually be interpreted
as Bytes/s
So add a pretty renderer that shows units and set backendUnit to submit
correctly converted values.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Stefan Reiter [Thu, 20 Feb 2020 17:10:42 +0000 (18:10 +0100)]
qemu: add virtio-rng option to GUI
Warn the user when selecting /dev/random or disabling speed limits.
'hardware_counts' is used since technically more than one RNG could be
attached to a QEMU machine. It is limited to 1 however, since the
usefulness of such a setup is more than questionable, considering the
linux kernel only ever uses one hwrng at a time anyway.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Dominik Csapak [Mon, 24 Feb 2020 15:32:19 +0000 (16:32 +0100)]
ceph: make all service name regexes the same
instead of having multiple regexes in various places for the name,
define a 'SERVICE_REGEX' in PVE::Ceph::Services, and use that
everywhere in the api where we need it
additionally limit new sevices to 200 characters, since
systemd units have a limit of 256 characters[0] (including suffix), and
200 seems to be enough.
users can now create ceph services on machines with hostnames
longer than 32 characters
Dominik Csapak [Mon, 24 Feb 2020 11:01:35 +0000 (12:01 +0100)]
ceph: do not check ips if no network is configured
the network and the cluster network are optional in the ceph config
and with 'pveceph init', so only check if we have an ip address
from those networks if it is actually configured
otherwise, the createosd call dies with an 'ip' error message
even if it would work
Fabian Ebner [Mon, 2 Mar 2020 09:21:35 +0000 (10:21 +0100)]
Add all standard output options that are not yet defined
When a property description already contained an option, no standard
output options at all would be added to it, e.g. '/nodes/NODE/vzdump'
already defines its own 'quiet'. Now all not yet defined options are
added to the description, this is done by using the fact that we can
pass a explicit list of std options to add to
add_standard_output_properties, so we filter all already defined ones
out and just pass that as list.
Fixes
pvesh create /nodes/NODE/vzdump -vmid ID -storage STORAGE
issued from a different node and
pvesh create /nodes/NODE/vzdump -vmid ID -storage STORAGE --output-format json
and maybe other calls.
Thomas Lamprecht [Fri, 21 Feb 2020 15:36:48 +0000 (16:36 +0100)]
ui: add date column in per-guest backup archive panel
Similar to commit 12d50fcd21c045ba55a3cbadd27b91a9e8939310 which
added this column to the storage content grid let's also add it here.
As we also base off the 'pve-storage-content' it's just a matter of
copying over the column definition 1:1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Reiter [Mon, 17 Feb 2020 13:36:28 +0000 (14:36 +0100)]
gui: pci passthrough: fix 'Add PCI' dialog for new devices
Commit f36240c507 (gui: pci passthrough: consider domain in PCISelector)
used 'values.host' without checking if it's set, resulting in an error
when the dialog was opened for a new device (where values.host is
undefined).
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Dominic Jäger [Mon, 17 Feb 2020 11:28:57 +0000 (12:28 +0100)]
ceph api: Make systemd unit type suffix optional
To (re)start and stop Ceph services the API calls systemd units using the
function ceph_service_cmd. If unspecified, this function assumes the type
".target" for a unit. By making the unit type suffix in the API optional, it
can make use of this assumption.
Stefan Reiter [Wed, 29 Jan 2020 10:27:22 +0000 (11:27 +0100)]
gui/cluster: show all links (up to 8) in cluster overview
Show only links found on the cluster.
'enableColumnHide' is set to false, since it causes confusing behaviour
for the user, considering we'd overwrite part of their choices every 5
seconds.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Dominik Csapak [Wed, 12 Feb 2020 09:51:59 +0000 (10:51 +0100)]
gui: form/ControllerSelector: fix autoselection
changing from Ext.Array.each to a for loop and changing the return
to a 'break', resulted in exiting the wrong loop (previously the outer,
now the inner) resulting in wrongly looping through all controllers
instead of only until we found a match
using a label and labeled break, we can break the outer loop
if no storage is selected in 'My Settings' our calculatin was done as follows:
* for every node, count 'local',
* every other storage gets only counted *once*, even if it is a local storage
as we have the 'shared' flag available, we can count local storages
for every node where they are defined which results in a storage total
calculation:
sum of all local storages on all nodes + all shared storages once
should make a better overview of storage for a cluster with local storages
Dominik Csapak [Tue, 11 Feb 2020 09:01:30 +0000 (10:01 +0100)]
gui: TFAEdit: use viemodel binding for hiding/showing qr code
the verification textfield, and the selected tab.
also remove the code that used the value by the userview panel, since
this is the only way to have a consistent behaviour on the userview
setting and the usermenu tfa setting
this fixes the issue that on the 'user menu' we accidentally showed
the qr code and verification field, even if the user already had a
totp code
now it shows 'Unchanged' like when opened via dc/UserView
Dominik Csapak [Mon, 10 Feb 2020 12:54:48 +0000 (13:54 +0100)]
gui: lxc/Network: add 'None' EmptyText for static mode
this way it is more clear that leaving that field empty results in
no configured ip for that interface, this may help prevent
users to select 'dhcp' for e.g. ipv6 when they do not want an ipv6
and do not have a dhcp6 server in the network (which would result
in a long boot time of the container, because of the dhcp timeout)
When a remote node not return a json, we got and error.
This is fixing this:
pvesh set /nodes/localname/network
UPID:kvmformation2:0034937B:09352894:5E41106C:srvreload:networking:root@pam:
pvesh set /nodes/remotenode/network
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/share/perl5/PVE/CLI/pvesh.pm line 125.
This patch simply return raw result if it's not a json
ui: snapshots: move hint to bottom and make it shorter
Moving it to the bottom of the dialog avoids other UI elements
jumping around when it gets displayed.
Further shorten the text itself, while the originally was good it was
a bit on the long side, users tend to overead to long warnings/hints
more easily, so try to be more terse.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Fabian Ebner [Thu, 6 Feb 2020 12:26:37 +0000 (13:26 +0100)]
Warn about file system state when a freeze would be needed, but isn't possible
If a snapshot of a running VM is taken and the RAM is not included, the backend
checks whether the QEMU Guest Agent is running inside the VM. If it is, it freezes
the file system, otherwise the snapshot is taken without freezing, which
could lead to an inconsistent file system state in the snapshot.
Thomas Lamprecht [Thu, 30 Jan 2020 19:03:23 +0000 (20:03 +0100)]
ui snapshot tree: avoid another exception in delayd load when view is gone
similar story than commit 9cc4958f5a03dd130198a090472782a2664d5b8d
We cannot really assert anything about the state of me (the view) and
consorts if me.destroyed is true, just early return.
We can get here because this is a delayed task, i.e., async,
everything can happen in between triggering it and receiving the
actual callback, so guard!
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 30 Jan 2020 18:43:16 +0000 (19:43 +0100)]
ui snapshot tree: avoid exception in delayd load when view is gone
If one switched through guest fast (e.g., keeping the down-arrow key
pressed) while staying on the snapshot panel, it could happen that
the previous view got already destroyed once the success callback of
the feature API request got executed.
Then the ExtJS ViewModels' set method got a "null" back from its
me.getStub(...) call, and tried to access members of that, resulting
in a TypeError exception.
Avoid that by checking if we're already destroyed or still around
before doing that call. During the time we are already in the
callback we shouldn't be able to get destroyed in parallel due to JS
single thread nature and no yield point here, so this is safe.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 30 Jan 2020 18:34:08 +0000 (19:34 +0100)]
ui snapshot tree: express formulas more concisely
Use arrow functions to bring them in a more simple boolean expression
style. Further, we can reuse the "isSnapshot" formula in the
"canRollback" and "canRemove" ones.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Wolfgang Link [Fri, 17 Jan 2020 13:48:59 +0000 (14:48 +0100)]
Protect the user's tfa key setting.
If oath or U2F is set, it should not be possible to change it
in the GUI on the user edit window.
It disables the second factor, but leave the tfa key behind
in the file tfa.cfg.
The key in the tfa.cfg file is a problem when the user tries to recreate a key.
The old key must be deleted before a new one can be created.
this improves following behaviours:
* do not loop over items multiple times
(we iterated one time extra for efidisk)
* do not check every item for cloudinit
(we even checked non-disk types)
* make the counts more generic using an object
* also disable cloudinit button when you have one pending
* also disable serial/net button when at limit or the user has
not the right priviliges
Stefan Reiter [Thu, 21 Nov 2019 14:53:52 +0000 (15:53 +0100)]
Broadcast supported CPU flags
pvestatd will check if the KVM version has changed using
kvm_user_version (which automatically clears its cache if QEMU/KVM
updates), and if it has, query supported CPU flags and broadcast them as
key-value pairs to the cluster.
If detection fails, we clear the kv-store and set up a delay (120s), to not
try again too quickly.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Thomas Lamprecht [Fri, 10 Jan 2020 14:51:58 +0000 (15:51 +0100)]
fix #2552: ui: allow to collapse notes panel from guest summary
Allow to collapse and expand the "Notes" panel on the virtual guests
summary panel.
Further add a browser setting to control the default behavior, one
can chose from:
* expand on show (default)
* collapse on show
* collapse if there are no notes
This way users can make slightly better use of the available screen
space for the guest status.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Co-developed-by: Stefan Reiter <s.reiter@proxmox.com>
Thomas Lamprecht [Tue, 14 Jan 2020 10:00:25 +0000 (11:00 +0100)]
network reload: check if recent enough PVE ifupdown2 version is present
We need a recent version *and* our patches on top of the vanilla
ifupdown2:
0001-don-t-remove-tap-veth-fwpr-interfaces-from-bridge-on.patch
0004-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
So check for at least 1.2.8 and the pve string in the version output.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Thu, 9 Jan 2020 08:59:35 +0000 (09:59 +0100)]
fix #2334: gui/cloudinit: enable edit button only when editor is set
when a user does not have the right privileges for cloudinit (e.g.
VM.Config.Network), we do not set an editor, which results in a button
that does nothing when pressed
fix this by enabling the button only when there is an editor set
Aaron Lauterer [Mon, 16 Dec 2019 11:04:10 +0000 (12:04 +0100)]
API: OSD: Fix #2496 Check OSD Network
It's possible to have a situation where the cluster network (used for
inter-OSD traffic) is not configured on a node. The OSD can still be
created but can't communicate.
This check will abort the creation if there is no IP within the subnet
of the cluster network present on the node. If there is no dedicated
cluster network the public network is used as a failsafe even though
this situation should not occur.
Dominik Csapak [Mon, 16 Dec 2019 10:07:30 +0000 (11:07 +0100)]
fix BandwidthSelector empty return value
if we do not want to return a value for submitting, we have to return
'null', every other value will get returned by getSubmitValue,
including 'undefined' and '' (empty string)
this fixes an issue when the user did not enter any bwlimit on
restore (the user would get an api error that bwlimit expects an
integer and not '')
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Tested-by: Stefan Reiter <s.reiter@proxmox.com>
By ensuring we delete the property if it's true (the backend default)
and set it is false, i.e., like originally (pre, mine and Aaron's
patch), but with reversed user input.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>