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>
Dominik Csapak [Wed, 27 Nov 2019 16:31:44 +0000 (17:31 +0100)]
gui: Bandwidth limits: increase labelWidth to 120
in some languages (e.g. German) the default (100) is too short for some labels,
resulting in cut-off text. We often use 120 in such cases, so we should
do here as well
Dominik Csapak [Wed, 13 Nov 2019 09:15:57 +0000 (10:15 +0100)]
fix #2462: ACMEAccount: make tos in get_tos optional
the code returns undef in case there is no 'tos', and the code
calling this api call handles a non-existing tos already, but
fails in that case becasue of the failing return value verification
Stefan Reiter [Thu, 21 Nov 2019 12:22:16 +0000 (13:22 +0100)]
Fix #2476: Fix auto-ballooning QMP command
Commit 0dd73a7fec (statd: refactor update_node_status) changed $target
in pvestatd's auto_balloning sub into a variable:
my $target = int($res->{$vmid});
but then uses it in a string as a parameter to the $log function:
$log->("BALLOON $vmid to $target (%d)\n", $target - $current);
This surprisingly causes the variable to be incorrectly converted into a
JSON string by perl's to_json (called in QMPClient after mon_cmd):
{"value":"1234"}
instead of
{"value":1234}
which causes QEMU to report the parameter as invalid:
"Invalid parameter type for 'value', expected: integer"
This behaviour is made even trickier, since $target internally is still
considered more of an 'int' (although that's a weak claim in perl
anyway), showing up without quotes in Dumper et. al. - but the perldoc
for to_json scheds some light:
simple scalars
Simple Perl scalars (any scalar that is not a reference) are the
most difficult objects to encode: this module will encode undefined
scalars as JSON "null" values, scalars that have last been used in a
string context before encoding as JSON strings, and anything else as
number value
So coerce to_json to treat $target as an integer by using it as one and
everything is fine again.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Thomas Lamprecht [Thu, 21 Nov 2019 09:57:49 +0000 (10:57 +0100)]
api/ceph: skip merging metadata if hostname is undefined
It's a bit hard to figure out the exact constellation required for
this to happen, but we saw it in live systems when one node was dead
in a three node cluster.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>