[pve-devel] applied-series: [PATCH proxmox-acme/pve-manager] add crud for acme accounts/plugin

2020-05-05 Thread Thomas Lamprecht
On 5/5/20 2:38 PM, Dominik Csapak wrote: > this series adds the gui (and necessary api calls) for > adding/editing/deleting acme accounts and plugins > > applied series, but I nested the fields in the schema one level deeper, differ between api id and name (with fallback to name) for the

[pve-devel] applied: [pve-network] only parse version if local sdn file exists

2020-05-05 Thread Thomas Lamprecht
On 5/5/20 5:22 PM, Stoiko Ivanov wrote: > if a file does not exist PVE::Tools::file_read_firstline returns undef. > > This happens e.g. if you install the libpve-network-perl package before > creating the local sdn file. > > Signed-off-by: Stoiko Ivanov > --- > caught in my journal after

[pve-devel] applied: [PATCH common] ProcFSTools: fix read_meminfo without KSM

2020-05-05 Thread Thomas Lamprecht
On 5/5/20 5:01 PM, Stoiko Ivanov wrote: > on kernel configs where KSM is not enabled (e.g. an openstack instance at > OVH) the file /sys/kernel/mm/ksm/pages_sharing does not exist. > In that case there is no memory shared so assuming 0 is reasonable. > > While this is not the case with our

[pve-devel] [PATCH manager v2] Fix #1210: ceph: extend pveceph purge

2020-05-05 Thread Alwin Antreich
to clean service directories as well as disable and stop Ceph services. Addtionally provide the option to remove crash and log information. This patch is also in addtion to #2607, as the current cleanup doesn't allow to re-configure Ceph, without manual steps during purge. Signed-off-by: Alwin

[pve-devel] [pve-network] only parse version if local sdn file exists

2020-05-05 Thread Stoiko Ivanov
if a file does not exist PVE::Tools::file_read_firstline returns undef. This happens e.g. if you install the libpve-network-perl package before creating the local sdn file. Signed-off-by: Stoiko Ivanov --- caught in my journal after installing updates today: May 05 17:17:20 rosa

[pve-devel] [PATCH common] ProcFSTools: fix read_meminfo without KSM

2020-05-05 Thread Stoiko Ivanov
on kernel configs where KSM is not enabled (e.g. an openstack instance at OVH) the file /sys/kernel/mm/ksm/pages_sharing does not exist. In that case there is no memory shared so assuming 0 is reasonable. While this is not the case with our shipped kernel, and thus will probably not happen on a

[pve-devel] [PATCH v2 qemu-server] rng: die when trying to pass through disconnected hwrng

2020-05-05 Thread Stefan Reiter
If /dev/hwrng exists, but no actual generator is connected (or it is disabled on the host), QEMU will happily start the VM but crash as soon as the guest accesses the VirtIO RNG device. To prevent this unfortunate behaviour, check if a useable hwrng is connected to the host before allowing the VM

[pve-devel] [PATCH manager 1/6] ACMEPlugin: check digest on update

2020-05-05 Thread Dominik Csapak
and extract the param, otherwise the check dies because of an unknown field 'digest' Signed-off-by: Dominik Csapak --- PVE/API2/ACMEPlugin.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/API2/ACMEPlugin.pm b/PVE/API2/ACMEPlugin.pm index 92e0dfb6..71f53a35 100644 ---

[pve-devel] [PATCH 1/2] DNSChallenge: make plugins a hash with an optional schema

2020-05-05 Thread Dominik Csapak
so that we can use that schema to generate form fields in the gui Signed-off-by: Dominik Csapak --- src/PVE/ACME/DNSChallenge.pm | 235 --- 1 file changed, 132 insertions(+), 103 deletions(-) diff --git a/src/PVE/ACME/DNSChallenge.pm

[pve-devel] [PATCH 2/2] add note that the data has to be base64 encoded

2020-05-05 Thread Dominik Csapak
but only via api, on the cli it is a file which contains the data in plaintext Signed-off-by: Dominik Csapak --- src/PVE/ACME/DNSChallenge.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/ACME/DNSChallenge.pm b/src/PVE/ACME/DNSChallenge.pm index 8a393f4..534922d

[pve-devel] [PATCH proxmox-acme/pve-manager] add crud for acme accounts/plugin

2020-05-05 Thread Dominik Csapak
this series adds the gui (and necessary api calls) for adding/editing/deleting acme accounts and plugins gui parts still missing are: * changing the account on the node * selecting a plugin for a domain proxmox-acme: Dominik Csapak (2): DNSChallenge: make plugins a hash with an optional

[pve-devel] [PATCH manager 6/6] ui: add ACMEClusterView

2020-05-05 Thread Dominik Csapak
to show the list of accounts and defined plugins for now we ignore 'standalone' plugins here and only show 'dns' ones Signed-off-by: Dominik Csapak --- www/manager6/Makefile | 1 + www/manager6/dc/ACMEClusterView.js | 206 + www/manager6/dc/Config.js

[pve-devel] [PATCH manager 2/6] ACME: add challengeschema api call

2020-05-05 Thread Dominik Csapak
which returns a list of challenge api types with the schema of their required data (if it exists) Signed-off-by: Dominik Csapak --- PVE/API2/ACMEAccount.pm | 55 + 1 file changed, 55 insertions(+) diff --git a/PVE/API2/ACMEAccount.pm

[pve-devel] [PATCH manager 4/6] ui: add ACMEAPiSelector field

2020-05-05 Thread Dominik Csapak
which return all api types from /cluster/acme/challengeschema and has a convenience method for getting the schema of the current value Signed-off-by: Dominik Csapak --- www/manager6/Makefile| 1 + www/manager6/form/ACMEAPiSelector.js | 40 2 files

[pve-devel] [PATCH manager 5/6] ui: add ACMEPluginEdit window

2020-05-05 Thread Dominik Csapak
this is a rather complex edit window, because we dynamically create form fields according to the schema we get from the api to do this properly we have to handle a few things: * we have to properly set the values on edit * we have to properly track the original values * we have to merge and split

[pve-devel] [PATCH manager 3/6] ui: ACMEAccountCreate: add optional name field

2020-05-05 Thread Dominik Csapak
so that we can create multiple accounts, but leave it empty and set the emptyText to the default name 'default' Signed-off-by: Dominik Csapak --- www/manager6/node/ACME.js | 7 +++ 1 file changed, 7 insertions(+) diff --git a/www/manager6/node/ACME.js b/www/manager6/node/ACME.js index

Re: [pve-devel] [PATCH manager] Improve storage selection on restore

2020-05-05 Thread Thomas Lamprecht
On 5/5/20 1:20 PM, Fabian Ebner wrote: > Previously, the blank '' would be passed along and lead to a > parameter verfication failure. > > For LXC the default behavior in the backend is to use 'local' as > the storage, so disallow blank and auto-select the first storage > supporting 'rootdir'

[pve-devel] [PATCH manager] Improve storage selection on restore

2020-05-05 Thread Fabian Ebner
Previously, the blank '' would be passed along and lead to a parameter verfication failure. For LXC the default behavior in the backend is to use 'local' as the storage, so disallow blank and auto-select the first storage supporting 'rootdir' instead. For QEMU the default behavior in the backend

[pve-devel] [PATCH RESEND qemu-server] migrate: cleanup forwarding code

2020-05-05 Thread Fabian Grünbichler
fixing the following two issues: - the legacy code path was never converted to the new fork_tunnel signature (which probably means that nothing triggers it in practice anymore?) - the NBD Unix socket got forwarded multiple times if more than one disk was migrated via NBD (this is harmless, but

Re: [pve-devel] [PATCH v2 container 02/10] create_vm: avoid premature write_config caused by update_pct_config

2020-05-05 Thread Fabian Ebner
On 5/5/20 12:02 PM, Thomas Lamprecht wrote: On 5/5/20 10:27 AM, Fabian Ebner wrote: by moving the write_config calls from vmconfig_*_pending to their call sites. The single other call site for update_pct_config in update_vm is also adapted. The update_pct_config call lead to a write_config

Re: [pve-devel] [PATCH v2 container 02/10] create_vm: avoid premature write_config caused by update_pct_config

2020-05-05 Thread Thomas Lamprecht
On 5/5/20 10:27 AM, Fabian Ebner wrote: > by moving the write_config calls from vmconfig_*_pending to their > call sites. The single other call site for update_pct_config in > update_vm is also adapted. > > The update_pct_config call lead to a write_config call and so the > configuration file was

Re: [pve-devel] [PATCH qemu-server] qemu/rng: die when trying to pass through disconnected hwrng

2020-05-05 Thread Thomas Lamprecht
On 5/5/20 10:59 AM, Stefan Reiter wrote: > If /dev/hwrng exists, but no actual generator is connected (or it is > disabled on the host), QEMU will happily start the VM but crash as soon > as the guest accesses the VirtIO RNG device. > > To prevent this unfortunate behaviour, check if a useable

[pve-devel] applied-series: [PATCH v2 container 01/10] LXC: drop unused imported locking functions

2020-05-05 Thread Fabian Grünbichler
with breaks/versioned-depends ;) On May 5, 2020 10:27 am, Fabian Ebner wrote: > From: Fabian Grünbichler > > Signed-off-by: Fabian Grünbichler > Tested-by: Fabian Ebner > --- > > Changes from v1: > * Add patch for container create_vm issue > * Add patch for snapshot_rollback issue >

[pve-devel] [PATCH qemu-server] qemu/rng: die when trying to pass through disconnected hwrng

2020-05-05 Thread Stefan Reiter
If /dev/hwrng exists, but no actual generator is connected (or it is disabled on the host), QEMU will happily start the VM but crash as soon as the guest accesses the VirtIO RNG device. To prevent this unfortunate behaviour, check if a useable hwrng is connected to the host before allowing the VM

[pve-devel] [PATCH v2 container 02/10] create_vm: avoid premature write_config caused by update_pct_config

2020-05-05 Thread Fabian Ebner
by moving the write_config calls from vmconfig_*_pending to their call sites. The single other call site for update_pct_config in update_vm is also adapted. The update_pct_config call lead to a write_config call and so the configuration file was created before it was intended to be created. When

[pve-devel] [PATCH v2 container 01/10] LXC: drop unused imported locking functions

2020-05-05 Thread Fabian Ebner
From: Fabian Grünbichler Signed-off-by: Fabian Grünbichler Tested-by: Fabian Ebner --- Changes from v1: * Add patch for container create_vm issue * Add patch for snapshot_rollback issue * Dropped the two already applied patches for qemu-server src/PVE/LXC.pm | 4 ++-- 1 file

[pve-devel] [PATCH v2 qemu-server 10/10] clone: use new config_lock_shared

2020-05-05 Thread Fabian Ebner
From: Fabian Grünbichler and move the lock call and decision logic closer together Signed-off-by: Fabian Grünbichler Tested-by: Fabian Ebner --- PVE/API2/Qemu.pm | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index

[pve-devel] [PATCH v2 guest-common 03/10] Avoid duplication by using lock_config_mode

2020-05-05 Thread Fabian Ebner
No functional change is intended. Signed-off-by: Fabian Ebner --- PVE/AbstractConfig.pm | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm index beb10c7..f1b395c 100644 --- a/PVE/AbstractConfig.pm +++ b/PVE/AbstractConfig.pm

[pve-devel] [PATCH v2 guest-common 08/10] snapshot_delete: check for concurrent modifications at each step

2020-05-05 Thread Fabian Ebner
From: Fabian Grünbichler Signed-off-by: Fabian Grünbichler Tested-by: Fabian Ebner --- PVE/AbstractConfig.pm | 14 ++ 1 file changed, 14 insertions(+) diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm index eefeeb9..3a064b7 100644 --- a/PVE/AbstractConfig.pm +++

[pve-devel] [PATCH v2 guest-common 09/10] lock_config: rename lock_config_mode -> lock_config_shared

2020-05-05 Thread Fabian Ebner
From: Fabian Grünbichler and pull the actual lock_file_full handling into a helper, to make the public interface clearer: lock_config -> standard exclusive lock with 10s timeout lock_config_full -> exclusive lock with configurable timeout lock_config_shared -> shared lock with configurable

[pve-devel] [PATCH v2 guest-common 06/10] snapshot_rollback: make sure newer replication snapshots are deleted

2020-05-05 Thread Fabian Ebner
Commit a1dfeff3a8502544123245ea61ad62cbe97803b7 changed the behavior for Replication::prepare with last_sync=0, so use last_sync=1 instead. Signed-off-by: Fabian Ebner --- This is not related to the locking issues. PVE/AbstractConfig.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[pve-devel] [PATCH v2 container 07/10] api/destroy: repeat early checks after locking

2020-05-05 Thread Fabian Ebner
From: Fabian Grünbichler and check_lock before forking as well Signed-off-by: Fabian Grünbichler Tested-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm

[pve-devel] [PATCH v2 guest-common 04/10] fix 2682: make sure configuration file is up-to-date for lock_config-variants

2020-05-05 Thread Fabian Ebner
See [0] for the details. The call tree for the variants is lock_config -> lock_config_full -> lock_config_mode so it is sufficient to adapt lock_config_mode. [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=2682 Suggested-by: Fabian Grünbichler Signed-off-by: Fabian Ebner --- Note that

[pve-devel] [PATCH v2 guest-common 05/10] snapshot_rollback: flock earlier

2020-05-05 Thread Fabian Ebner
From: Fabian Grünbichler to protect checks against concurrent modifications Signed-off-by: Fabian Grünbichler Tested-by: Fabian Ebner --- PVE/AbstractConfig.pm | 45 +-- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git

Re: [pve-devel] [PATCH v2 container] create_vm: avoid premature write_config caused by update_pct_config

2020-05-05 Thread Fabian Ebner
I'll re-send this as part of the lock series v2. On 4/30/20 11:33 AM, Fabian Ebner wrote: by moving the write_config calls from vmconfig_*_pending to their call sites. The single other call site for update_pct_config in update_vm is also adapted. The first write_config call in

Re: [pve-devel] [PATCH guest-common 1/2] Avoid duplication by using lock_config_mode

2020-05-05 Thread Fabian Ebner
On 5/4/20 6:02 PM, Thomas Lamprecht wrote: On 4/23/20 1:51 PM, Fabian Ebner wrote: No functional change is intended. Signed-off-by: Fabian Ebner --- PVE/AbstractConfig.pm | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/PVE/AbstractConfig.pm