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>
The recent change transformed this checkbox from a negative "No
Backup" to a positive "Backup" did not accounted for changing the
default fallback for the parseBoolean call.
As this would had suggested that disk are backed-up which aren't
backup, it could lead to pretty devastating results...
Aaron Lauterer [Mon, 2 Dec 2019 09:58:28 +0000 (10:58 +0100)]
ui: hdedit: change nobackup to include in backup
Change the behavior from having to activate the `No backup` checkbox to
exclude a disk from backups to having a `Include in backup` checkbox
that is checked by default.
Aaron Lauterer [Mon, 2 Dec 2019 09:58:26 +0000 (10:58 +0100)]
ui: mpedit: activate backup on MP creation
This patch enables the backup checkbox by default for newly created
LXC mount points.
Hopefully this will help to avoid situations in the future where people
realize too late that the mount point has not been backed up when they
expected it to because they missed the checkbox.
The reason why `view.isCreate` is not passed directly is because
AFAIU the 'view.isCreate' can have one of three values:
* null - editing an existing mount point
* true - creating a new mp
* array('unusedX') - adding an unused disk again
Dominik Csapak [Wed, 4 Dec 2019 12:41:34 +0000 (13:41 +0100)]
gui: GuestSummary: choose columns based on container width
instead of the viewport width. This means that the number of columns can
change when the tree width changes, not only on browser window resize
for this to work reliably, we have to change the structure of the first
two panels, so that they are in one container for non-templates. if
we do not do this, there are some weird glitches on resizing with the
scrollbar
Dominik Csapak [Thu, 5 Dec 2019 09:43:38 +0000 (10:43 +0100)]
ui: window/Restore: fixup unit conversion for bwlimit
vzdumps bwlimit is in KiB, so we have to tell our component that
and also remove the unnecessary multiplication with 1024
(the field previously returned the value in MiB)
Restore may be a long running operation, as it goes over the common
create API path we can reuse the "start after create" for a "start
after restore" for free.
Add this as hbox layout, as else it looks like a lot of wasted space
in the right side of the window, especially when restoring a CT
backup (were the "unprivileged" checkbox is additionally there).
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
ui: add date column for backups in storage content view
main use case is to sort by date, e.g., I just re-created a cluster,
did some VM/CT backups on a NFS dump of mine which already had quite
some backups. Now, on restore I knew that only the backups made
yesterday were interesting, so a sort by date would allow me to find
them all easily, thus this patch was born.
Simple frontend extraction of information from the volid, for now
only for backups as there's the only case were we have the info at
all. Called the model entry "vdate" for "virtual date".
Mayb adding the creation date to all entries could be a nice addition
for the API someday.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>