[pve-devel] [PATCH v2 container 12/28] Implement volume-related helpers

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/LXC/Config.pm | 24 1 file changed, 24 insertions(+) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index e88ba0b..abaae54 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -1076,6 +1076,30 @@ sub

[pve-devel] [PATCH v2 qemu-server 11/28] Extend snapshot_foreach_volume to allow different selections of volumes

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuConfig.pm | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm index b0dc3b9..b6a465e 100644 --- a/PVE/QemuConfig.pm +++ b/PVE/QemuConfig.pm @@ -394,7 +394,7 @@ sub

[pve-devel] [PATCH v2 qemu-server 01/28] Replace drivename_hash with drivedesc_hash

2020-02-24 Thread Fabian Ebner
which contains the full descriptions of the drives, and make parse_drive not depend on $confdesc anymore. In preparation to moving drive-related code to its own module. Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

[pve-devel] [PATCH v2 container 13/28] Extend snapshot_foreach_volume to allow different selections of volumes

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/LXC/Config.pm | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index abaae54..d72818a 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -181,7 +181,7 @@ sub

[pve-devel] [PATCH-SERIES v2] make storage migration more flexible

2020-02-24 Thread Fabian Ebner
lpers to translate a volume name between different storage types [0]: https://pve.proxmox.com/pipermail/pve-devel/2020-January/041436.html guest-common Fabian Ebner (5): Add interface for volume-related helpers Add snapshot_foreach_unused_volume snapshot_foreach_volume: Allow differe

[pve-devel] [PATCH v2 storage 15/28] storage_migrate: return volume ID of migrated volume

2020-02-24 Thread Fabian Ebner
In preparation to introduce an allow_rename parameter. Signed-off-by: Fabian Ebner --- PVE/CLI/pvesm.pm | 2 +- PVE/Storage.pm | 41 - 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm index 7b83ec8

[pve-devel] [PATCH v2 qemu-server 24/28] Update volume IDs in one go

2020-02-24 Thread Fabian Ebner
Use 'update_volume_ids' for the live-migrated disks as well. Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index bd17992..6f7a442 100644

[pve-devel] [PATCH v2 guest-common 19/28] Use new storage_migrate interface

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/Replication.pm | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PVE/Replication.pm b/PVE/Replication.pm index ae1ade4..5b1e917 100644 --- a/PVE/Replication.pm +++ b/PVE/Replication.pm @@ -186,8 +186,16 @@ sub replicate_volume

[pve-devel] [PATCH v2 container 21/28] Use new storage_migrate interface

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/LXC/Migrate.pm | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm index 7df3c4c..2efdf84 100644 --- a/src/PVE/LXC/Migrate.pm +++ b/src/PVE/LXC/Migrate.pm @@ -278,17 +278,21 @@ sub

[pve-devel] [PATCH v2 guest-common 07/28] snapshot_foreach_volume: Allow different volume selections

2020-02-24 Thread Fabian Ebner
by introducing a parameter $opts, which should contain 'include_'-flags. Also added @param and removed the '__'-prefix for future use from outside the module. Signed-off-by: Fabian Ebner --- PVE/AbstractConfig.pm | 17 ++--- 1 file changed, 10 insertions(+),

[pve-devel] [PATCH v2 qemu-server 22/28] Take note of changes to the volume IDs when migrating and update the config

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index cc6deb4..bd17992 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -270,7 +270,9 @@ sub

[pve-devel] [PATCH v2 qemu-server 25/28] sync_disks: use allow_rename to avoid collisions on the target storage

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 3 +++ PVE/QemuServer.pm | 1 + 2 files changed, 4 insertions(+) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 6f7a442..2fec0f4 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -353,6 +353,8 @@ sub

[pve-devel] [PATCH v2 storage 28/28] storage_migrate: use volname_for_storage to determine $target_volname

2020-02-24 Thread Fabian Ebner
obably) invalid for X, so import died. Now, volname_for_storage returns a volname that (by our assumption) is invalid for X, so import dies. Signed-off-by: Fabian Ebner --- PVE/Storage.pm | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.

[pve-devel] [PATCH v2 qemu-server 26/28] sync_disks: be more verbose if storage_migrate fails

2020-02-24 Thread Fabian Ebner
If storage_migrate dies, the error message might not include the volume ID or the target storage ID, but those might be good to know. Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE

[pve-devel] [PATCH v2 storage 17/28] Collect optional parameters for storage_migrate into $opts

2020-02-24 Thread Fabian Ebner
Sanitizing $with_snapshots is done on extraction to save a line. Signed-off-by: Fabian Ebner --- PVE/API2/Storage/Content.pm | 2 +- PVE/Storage.pm | 11 --- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage

[pve-devel] [PATCH v2 qemu-server 23/28] Allow specifying targetstorage for offline migration

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/API2/Qemu.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index caca430..a4b8604 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -3380,9 +3380,6 @@ __PACKAGE__->register_method({ $param->{

[pve-devel] [PATCH v2 storage 16/28] pvesm import: introduce allow_rename parameter

2020-02-24 Thread Fabian Ebner
which can be used to avoid aborting on collision. Signed-off-by: Fabian Ebner --- PVE/CLI/pvesm.pm | 9 - PVE/Storage.pm | 8 PVE/Storage/LVMPlugin.pm | 15 +-- PVE/Storage/Plugin.pm| 13 + PVE/Storage

[pve-devel] [PATCH v2 storage 27/28] Add volname_for_storage and print_volname helper

2020-02-24 Thread Fabian Ebner
-123-disk-4.raw Signed-off-by: Fabian Ebner --- PVE/Storage.pm| 17 +++-- PVE/Storage/Plugin.pm | 19 +++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 8969d2e..7a76b2c 100755 --- a/PVE/Storage.pm +++ b/PVE

[pve-devel] [PATCH v2 storage 18/28] storage_migrate: introduce allow_rename option

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/Storage.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 851c59d..8969d2e 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -570,6 +570,7 @@ sub storage_migrate { my $ratelimit_bps = $opts->{ratelimit_

[pve-devel] [PATCH v2 storage 14/28] pvesm import: return and print the allocated volume ID

2020-02-24 Thread Fabian Ebner
ise) and so volid is returned. This is done for backwards compatibility with foreign plugins. Signed-off-by: Fabian Ebner --- PVE/CLI/pvesm.pm | 13 - PVE/Storage.pm | 2 +- PVE/Storage/LVMPlugin.pm | 2 ++ PVE/Storage/Plugin.pm| 2 ++ PVE/Storage/Z

[pve-devel] [PATCH v2 qemu-server 20/28] Use new storage_migrate interface

2020-02-24 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 6db5e62..cc6deb4 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -471,15 +471,19 @@ sub sync_disks

[pve-devel] [PATCH v2 qemu-server 04/28] Create Drive.pm and move some drive-related code there

2020-02-24 Thread Fabian Ebner
and imported into QemuServer.pm. Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 459 +-- PVE/QemuServer/Drive.pm | 468 PVE/QemuServer/Makefile | 1 + 3 files changed, 474 insertions(+), 454 deletions

Re: [pve-devel] [PATCH v2 qemu-server 04/28] Create Drive.pm and move some drive-related code there

2020-02-25 Thread Fabian Ebner
u commandline, so maybe something like drive_to_qemu_string or print_drive_qemu (as always, naming is not my strength ;))? Ok. On February 24, 2020 1:43 pm, Fabian Ebner wrote: Apart from moving and adapting two places where $MAX_SATA_DISKS is used, the initialization for the drive keys in $confdes

Re: [pve-devel] [PATCH v2 guest-common 06/28] Add snapshot_foreach_unused_volume

2020-02-25 Thread Fabian Ebner
optionally reverse keys 3. iterate over keys 4. optionally iterate over extras 5. optionally also do the same for snapshots On February 24, 2020 1:43 pm, Fabian Ebner wrote: Signed-off-by: Fabian Ebner --- PVE/AbstractConfig.pm | 13 + 1 file changed, 13 insertions(+) diff -

Re: [pve-devel] [PATCH v2 qemu-server 09/28] parse_drive: Allow parsing vmstate volumes

2020-02-25 Thread Fabian Ebner
On 2/25/20 12:32 PM, Fabian Grünbichler wrote: On February 24, 2020 1:43 pm, Fabian Ebner wrote: Signed-off-by: Fabian Ebner --- PVE/QemuServer/Drive.pm | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer/Drive.pm b/PVE/QemuServer/Drive.pm index

Re: [pve-devel] [PATCH v2 storage 16/28] pvesm import: introduce allow_rename parameter

2020-02-25 Thread Fabian Ebner
44 pm, Fabian Ebner wrote: which can be used to avoid aborting on collision. Signed-off-by: Fabian Ebner --- PVE/CLI/pvesm.pm | 9 - PVE/Storage.pm | 8 PVE/Storage/LVMPlugin.pm | 15 +-- PVE/Storage/Plugin.pm

Re: [pve-devel] [PATCH v2 storage 27/28] Add volname_for_storage and print_volname helper

2020-02-25 Thread Fabian Ebner
On 2/25/20 12:34 PM, Fabian Grünbichler wrote: On February 24, 2020 1:44 pm, Fabian Ebner wrote: Allows to convert a volume ID from the source storage to a valid volume name for the target storage. The original name is preserved, except for a possible extension and it's also checked whethe

[pve-devel] [PATCH manager] Add all standard output options that are not yet defined

2020-03-02 Thread Fabian Ebner
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. Reported here: https://forum.proxmox.com/threads/output-format-error-with-pvesh-create.47711/ Signed-off-by: Fabian Ebner --- PVE/CLI/pvesh

[pve-devel] [PATCH v3 qemu-server 1/7] Replace drivename_hash with drivedesc_hash

2020-03-02 Thread Fabian Ebner
which contains the full descriptions of the drives, and make parse_drive not depend on $confdesc anymore. In preparation to moving drive-related code to its own module. Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

[pve-devel] [PATCH-SERIES v3] Move drive-related code into its own module

2020-03-02 Thread Fabian Ebner
moving (but touching the same code) [0]: https://pve.proxmox.com/pipermail/pve-devel/2020-February/041910.html Fabian Ebner (7): Replace drivename_hash with drivedesc_hash Use parse_drive for EFI disk Create Drive.pm and move drive-related code there Rename disksize to bootdis

[pve-devel] [PATCH v3 qemu-server 7/7] Also update disk size if there was no old size

2020-03-02 Thread Fabian Ebner
If for whatever reason there is no size in the property string of a drive, 'qm rescan' would do nothing for that drive and live migration would also fail. Also adds a check to avoid potential auto-vivification of volid_hash->{$volid} Signed-off-by: Fabian Ebner --- PVE/QemuServer

[pve-devel] [PATCH v3 qemu-server 6/7] Use correct description for unused drives

2020-03-02 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuServer/Drive.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer/Drive.pm b/PVE/QemuServer/Drive.pm index 1af1d36..fed379e 100644 --- a/PVE/QemuServer/Drive.pm +++ b/PVE/QemuServer/Drive.pm @@ -418,7 +418,7 @@ sub

[pve-devel] [PATCH v3 qemu-server 4/7] Rename disksize to bootdisk_size and print_drive_full to print_drive_commandline_full

2020-03-02 Thread Fabian Ebner
to avoid confusion with print_drive Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 8 PVE/QemuServer/Drive.pm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index f636150..d68fbc2 100644 --- a/PVE/QemuServer.pm

[pve-devel] [PATCH v3 qemu-server 5/7] Use MAX_UNUSED_DISKS from Drive.pm to avoid duplication

2020-03-02 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuConfig.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm index 1ba728a..8d03774 100644 --- a/PVE/QemuConfig.pm +++ b/PVE/QemuConfig.pm @@ -5,6 +5,7 @@ use warnings; use PVE::AbstractConfig

[pve-devel] [PATCH v3 qemu-server 2/7] Use parse_drive for EFI disk

2020-03-02 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 7953154..1580514 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3522,7 +3522,7 @@ sub config_to_command { my $path

[pve-devel] [PATCH v3 qemu-server 3/7] Create Drive.pm and move drive-related code there

2020-03-02 Thread Fabian Ebner
exported from the submodule and imported into QemuServer.pm. For callers of the now imported functions within QemuServer.pm, the prefix PVE::QemuServer is dropped, because it is unnecessary and now even confusing. Signed-off-by: Fabian Ebner --- PVE/API2/Qemu.pm| 11 +- PVE/CLI/qm.pm

Re: [pve-devel] [PATCH v3 qemu-server 6/7] Use correct description for unused drives

2020-03-02 Thread Fabian Ebner
Please don't apply this one. It would be necessary to add default_key => 1, to $unuseddesc and below it would be necessary to use ? {file => $unuseddesc} so that the result of parse_drive is a hash with a 'file' key set. On 3/2/20 11:33 AM, Fabian Ebner wrote:

Re: [pve-devel] applied: [PATCH manager] Add all standard output options that are not yet defined

2020-03-03 Thread Fabian Ebner
On 3/2/20 8:21 PM, Thomas Lamprecht wrote: On 3/2/20 10:21 AM, Fabian Ebner wrote: 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

[pve-devel] [PATCH qemu-server] Revert "resize_vm: request new size from storage after resizing"

2020-03-04 Thread Fabian Ebner
#2621. Signed-off-by: Fabian Ebner --- PVE/API2/Qemu.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index caca430..d0dd2dc 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -3586,8 +3586,7 @@ __PACKAGE__->register_met

Re: [pve-devel] [PATCH qemu-server 1/3] Rename parameter 'volname' to 'volinfo'

2020-03-05 Thread Fabian Ebner
Any feedback for these patches? On 1/8/20 11:28 AM, Fabian Ebner wrote: since it is not just the name but a hash containing information about the volume Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuMigrate.pm

Re: [pve-devel] [PATCH qemu-server] Revert "resize_vm: request new size from storage after resizing"

2020-03-09 Thread Fabian Ebner
On 3/6/20 7:55 PM, Thomas Lamprecht wrote: On 3/4/20 10:51 AM, Fabian Ebner wrote: This reverts commit b5490d8a98e5e7328eb4cebb0ae0b60e6d406c38. When resizing a volume of a running VM, a qmp block_resize command is issued. This is non-blocking, so the size on the storage immediately after

[pve-devel] [PATCH v2 qemu-server 2/2] Consistently use format determined in 'PVE::Storage::foreach_volid'

2020-03-09 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index aa8ee6e..44e4c57 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -319,6 +319,7 @@ sub sync_disks

[pve-devel] [PATCH v2 qemu-server 1/2] Always set 'snapshots' for qcow2 and vmdk volumes

2020-03-09 Thread Fabian Ebner
ls when its output leaves through a pipe. Upon importing, a second error is present, because the format from the volume ID doesn't match the format of the stream and there is no conversion yet. Signed-off-by: Fabian Ebner --- Changes from v1: * squash renaming volname->volinfo into

[pve-devel] [PATCH qemu] save_snapshot_cleanup: make alignment to 1024 explicit

2020-03-11 Thread Fabian Ebner
Follow-up for the already implemented change and removes the outdated patch message. Like this we don't need to rely on BDRV_SECTOR_SIZE being 512. Signed-off-by: Fabian Ebner --- @Thomas regarding the off-list discussion about the blk_truncate call: I hadn't updated the qemu submodul

[pve-devel] [PATCH v4 qemu-server] Change format for unused drives

2020-03-12 Thread Fabian Ebner
and make it match with what parse_drive does. Even though the 'real' format was pve-volume-id, callers already expected that parse_drive returns a hash with a valid 'file' key (e.g. PVE/API2/Qemu.pm:1147ff). Signed-off-by: Fabian Ebner --- This is the last patch left

[pve-devel] [PATCH v3 guest-common 04/22] Add update_volume_ids

2020-03-12 Thread Fabian Ebner
This function is intened to be used after doing a migration where some of the volume IDs changed. Signed-off-by: Fabian Ebner --- PVE/AbstractConfig.pm | 30 ++ 1 file changed, 30 insertions(+) diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm index f2e130c

[pve-devel] [PATCH v3 qemu-server 05/22] Implement volume-related helpers and use new foreach_volume

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuConfig.pm | 40 +--- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm index 8d03774..8b3ce36 100644 --- a/PVE/QemuConfig.pm +++ b/PVE/QemuConfig.pm @@ -77,6 +77,37

[pve-devel] [PATCH v3 container 07/23] Implement volume-related helpers and use new foreach_volume

2020-03-12 Thread Fabian Ebner
Renames mountpoint_names to avoid the need to create a wrapper. Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 4 ++-- src/PVE/CLI/pct.pm| 2 +- src/PVE/LXC/Config.pm | 38 -- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src

[pve-devel] [PATCH v3 storage 08/23] Add apiinfo helper to pvesm

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/CLI/pvesm.pm | 30 ++ 1 file changed, 30 insertions(+) diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm index 510faba..7c0e259 100755 --- a/PVE/CLI/pvesm.pm +++ b/PVE/CLI/pvesm.pm @@ -47,6 +47,30 @@ sub setup_environment { PVE

[pve-devel] [PATCH v3 guest-common 03/22] foreach_volume: generalize and implement function

2020-03-12 Thread Fabian Ebner
Introduce a parameter $opts to allow for better control of which keys/volumes to use for the iteration and ability to reverse the order. Also, allow extra parameters for the function. Removes the '__snapshot'-prefix for future use from outside the module. Signed-off-by: Fabian Ebner

[pve-devel] [PATCH v3 storage 09/22] Collect optional parameters for storage_migrate into $opts

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/API2/Storage/Content.pm | 2 +- PVE/Storage.pm | 12 +--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm index 63fa4fc..f2e3e57 100644 --- a/PVE/API2/Storage

[pve-devel] [PATCH v3 qemu-server 11/22] Use new storage_migrate interface

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 44e4c57..464abc6 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -478,15 +478,19 @@ sub sync_disks

[pve-devel] [PATCH-SERIES v3] Make storage migration more flexible

2020-03-12 Thread Fabian Ebner
_volname for plugins * parse vm_state in parse_volume instead of parse_drive [0]: https://pve.proxmox.com/pipermail/pve-devel/2020-February/041910.html guest-common: Fabian Ebner (5): Add interfaces for volume-related helpers Add foreach_unused_volume foreach_volume: generalize

[pve-devel] [PATCH v3 guest-common 02/22] Add foreach_unused_volume

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/AbstractConfig.pm | 13 + 1 file changed, 13 insertions(+) diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm index 6148271..5b1683b 100644 --- a/PVE/AbstractConfig.pm +++ b/PVE/AbstractConfig.pm @@ -419,6 +419,19 @@ sub add_unused_volume

[pve-devel] [PATCH v3 guest-common 10/22] Use new storage_migrate interface

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/Replication.pm | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PVE/Replication.pm b/PVE/Replication.pm index ae1ade4..5b1e917 100644 --- a/PVE/Replication.pm +++ b/PVE/Replication.pm @@ -186,8 +186,16 @@ sub replicate_volume

[pve-devel] [PATCH v3 qemu-server 06/22] Allow parsing vmstate entries

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- Done in here instead of parse_drive, because state files don't feel like proper drives and this is only used for the abstract volume iterator anyways. PVE/QemuConfig.pm | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git

[pve-devel] [PATCH v3 qemu-server 16/22] Allow specifying targetstorage for offline migration

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/API2/Qemu.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 3b61334..4828821 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -3381,9 +3381,6 @@ __PACKAGE__->register_method({ $param->{

[pve-devel] [PATCH v3 guest-common 01/22] Add interfaces for volume-related helpers

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/AbstractConfig.pm | 30 ++ 1 file changed, 30 insertions(+) diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm index ee00486..6148271 100644 --- a/PVE/AbstractConfig.pm +++ b/PVE/AbstractConfig.pm @@ -368,6 +368,36 @@ sub

[pve-devel] [PATCH v3 qemu-server 15/22] Take note of changes to the volume IDs when migrating and update the config

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 464abc6..3c601ff 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -271,7 +271,9 @@ sub

[pve-devel] [PATCH v3 storage 14/22] storage_migrate: add volname_for_storage helper

2020-03-12 Thread Fabian Ebner
ed, except for a possible extension and it's also checked whether the format is valid for the target storage. Example: mylvm:vm-123-disk-4 <-> mydir:123/vm-123-disk-4.raw Signed-off-by: Fabian Ebner --- PVE/Storage.pm | 30 -- 1 file changed, 28 insertions(

[pve-devel] [PATCH v3 container 12/22] Use new storage_migrate interface

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/LXC/Migrate.pm | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm index 6c1e9c1..aafaeeb 100644 --- a/src/PVE/LXC/Migrate.pm +++ b/src/PVE/LXC/Migrate.pm @@ -278,17 +278,21 @@ sub

[pve-devel] [PATCH v3 qemu-server 20/22] sync_disks: log output of storage_migrate

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- Not sure about this one. On the one hand it adds even more to the migration logs, which are already rather long. On the other hand it might contain useful information. PVE/QemuMigrate.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE

[pve-devel] [PATCH v3 qemu-server 18/22] sync_disks: use allow_rename to avoid collisions on the target storage

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 3 +++ PVE/QemuServer/Drive.pm | 1 + 2 files changed, 4 insertions(+) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index a684885..57ac34d 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -360,6 +360,8 @@ sub

[pve-devel] [PATCH v3 container 22/22] Use foreach_volume instead of foreach_mountpoint_full to avoid duplication

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC/Config.pm | 2 +- src/PVE/LXC/Config.pm | 17 ++--- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/PVE/API2/LXC/Config.pm b/src/PVE/API2/LXC/Config.pm index 0879172..ca0203c 100644 --- a/src/PVE/API2/LXC

[pve-devel] [PATCH v3 qemu-server 21/22] update_disk_config: use config volume iterators instead of loops

2020-03-12 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 50 --- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index ee99b26..b38b8dd 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -5571,35

[pve-devel] [PATCH v3 qemu-server 17/22] Update volume IDs in one go

2020-03-12 Thread Fabian Ebner
Use 'update_volume_ids' for the live-migrated disks as well. Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 3c601ff..a684885 100644

[pve-devel] [PATCH v3 storage 13/22] Introduce allow_rename parameter for pvesm import and storage_migrate

2020-03-12 Thread Fabian Ebner
import with the requested volid was successful (it should've died otherwise) and so volid is returned. This is done for backwards compatibility with foreign plugins. Signed-off-by: Fabian Ebner --- PVE/CLI/pvesm.pm | 22 ++ PVE/Storage.p

[pve-devel] [PATCH v3 qemu-server 19/22] sync_disks: be more verbose if storage_migrate fails

2020-03-12 Thread Fabian Ebner
If storage_migrate dies, the error message might not include the volume ID or the target storage ID, but those might be good to know. Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE

Re: [pve-devel] [PATCH v3 container 07/23] Implement volume-related helpers and use new foreach_volume

2020-03-12 Thread Fabian Ebner
Forgot to change the 23 in the subject here and for patch #8 Should be 22; sorry for the noise. On 3/12/20 1:08 PM, Fabian Ebner wrote: Renames mountpoint_names to avoid the need to create a wrapper. Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 4 ++-- src/PVE/CLI/pct.pm

Re: [pve-devel] [PATCH v4 qemu-server] Change format for unused drives

2020-03-16 Thread Fabian Ebner
On 16.03.20 10:10, Fabian Grünbichler wrote: On March 12, 2020 11:19 am, Fabian Ebner wrote: and make it match with what parse_drive does. Even though the 'real' format was pve-volume-id, callers already expected that parse_drive returns a hash with a valid 'file' key (e

Re: [pve-devel] [PATCH v3 guest-common 03/22] foreach_volume: generalize and implement function

2020-03-16 Thread Fabian Ebner
On 16.03.20 12:05, Fabian Grünbichler wrote: On March 12, 2020 1:08 pm, Fabian Ebner wrote: Introduce a parameter $opts to allow for better control of which keys/volumes to use for the iteration and ability to reverse the order. Also, allow extra parameters for the function. Removes the

Re: [pve-devel] [PATCH-SERIES v3] Make storage migration more flexible

2020-03-16 Thread Fabian Ebner
On 16.03.20 12:07, Fabian Grünbichler wrote: On March 12, 2020 1:08 pm, Fabian Ebner wrote: This is the second half for the previous series [0]. This series aims to allow offline migration with '--targetstorage' and improve handling unsued/orphaned disks when migrating. It als

[pve-devel] [PATCH qemu-server] Add unused description to drivedesc_hash

2020-03-17 Thread Fabian Ebner
Moved code so that initialization of drivedesc_hash stays a single block. Avoid auto-vivication in parse_drive. Signed-off-by: Fabian Ebner --- Follow-up suggested by Fabian G. I checked the call-sites for is_valid_drivename and in most cases it won't benefit from including unused d

[pve-devel] [PATCH container 1/2] fix #1904: convert to base image when moving a volume of a template

2020-03-18 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- For VMs this already happens. When adding volumes to templates no such conversion to base images happens yet (affects both VM/LXC). Because templates are more-or-less supposed to be read-only it probably makes sense to disallow adding volumes altogether. Or

[pve-devel] [PATCH container 2/2] move_volume: if deleting old volume fails, add it as unused

2020-03-18 Thread Fabian Ebner
Like this it's clearer that the volume is still there. The warning is easily missed. Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 9eb52dc..6280430 100644 ---

Re: [pve-devel] [PATCH container 1/2] fix #1904: convert to base image when moving a volume of a template

2020-03-19 Thread Fabian Ebner
On 19.03.20 09:01, Fabian Grünbichler wrote: On March 18, 2020 2:02 pm, Fabian Ebner wrote: Signed-off-by: Fabian Ebner --- For VMs this already happens. When adding volumes to templates no such conversion to base images happens yet (affects both VM/LXC). Because templates are more-or-less

Re: [pve-devel] [zsync] fix: check for incremental sync snapshot.

2020-03-19 Thread Fabian Ebner
Hi, this does fix an issue when the receiving side has the most recent snapshot, but not the 'old_snap' one. And of course testing for 'last_snap' is correct, since that one is the relevant one for the incremental sync. With that: Reviewed-By: Fabian Ebner Tested-By:

[pve-devel] [PATCH v2 storage 1/4] volume_has_feature: be aware that qcow2 does not work for lxc

2020-03-19 Thread Fabian Ebner
Relevant for the 'clone' feature, because Plugin.pm's clone_image always produces qcow2. Also fixed style for neighboring if/else block. Signed-off-by: Fabian Ebner --- Previous discussion: https://pve.proxmox.com/pipermail/pve-devel/2020-March/042472.html Changes from v1:

[pve-devel] [PATCH v2 container 4/4] move_volume: if deleting old volume fails, add it as unused

2020-03-19 Thread Fabian Ebner
Like this it's clearer that the volume is still there. The warning is easily missed. Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index c62955a..fbafd8c 100644 ---

[pve-devel] [PATCH v2 container 3/4] fix #1904: convert to base image when moving a volume of a template

2020-03-19 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 205743c..c62955a 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -1818,7 +1818,13 @@ __PACKAGE__

[pve-devel] [PATCH v2 container 2/4] Rely on template_create to check whether creating a template is possible

2020-03-19 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 29 ++--- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index a5aa5fc..205743c 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -440,13 +440,8

Re: [pve-devel] [PATCH v2 storage 1/4] volume_has_feature: be aware that qcow2 does not work for lxc

2020-03-23 Thread Fabian Ebner
On 19.03.20 16:53, Fabian Grünbichler wrote: On March 19, 2020 1:37 pm, Fabian Ebner wrote: Relevant for the 'clone' feature, because Plugin.pm's clone_image always produces qcow2. Also fixed style for neighboring if/else block. Signed-off-by: Fabian Ebner --- Previous dis

[pve-devel] [PATCH v3 container 3/5] Rely on template_create to check whether creating a template is possible

2020-03-23 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 29 ++--- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index ddf417b..c724118 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -440,13 +440,8

[pve-devel] [PATCH v3 storage 1/5] Allow passing options to volume_has_feature

2020-03-23 Thread Fabian Ebner
t qcow2 is not valid and hence the clone feature is not available. Signed-off-by: Fabian Ebner --- Changes from v2: * Use new options parameter instead of adding more dependency to PVE::Cluster * storage API bump and now there is an inter-package dependency: #2 container dep

[pve-devel] [PATCH v3 container 2/5] For clone+copy features, make sure a valid format for the target is supported

2020-03-23 Thread Fabian Ebner
using the new option valid_target_formats. This is necessary, because clone_image can result in a qcow2 image being created (on directory based storages) which is not valid for LXC. Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 2 +- src/PVE/LXC/Config.pm | 7 ++- 2 files changed

[pve-devel] [PATCH v3 container 4/5] fix #1904: convert to base image when moving a volume of a template

2020-03-23 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index c724118..307fd90 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -1818,7 +1818,13 @@ __PACKAGE__

[pve-devel] [PATCH v3 container 5/5] move_volume: if deleting old volume fails, add it as unused

2020-03-23 Thread Fabian Ebner
Especially useful when there are linked clones using the volume that is being moved, but shouldn't hurt otherwise either. Signed-off-by: Fabian Ebner --- src/PVE/API2/LXC.pm | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/L

Re: [pve-devel] [PATCH v3 qemu-server] vzdump: move include logic for volumes to method

2020-03-24 Thread Fabian Ebner
On 17.03.20 15:34, Fabian Grünbichler wrote: On March 16, 2020 4:44 pm, Aaron Lauterer wrote: Move the logic which volumes are included in the backup job to its own method and adapt the VZDump code accordingly. This makes it possible to develop other features around backup jobs. Signed-off-by:

[pve-devel] [PATCH qemu-server] Fix calls to get_replicateable_volumes

2020-03-25 Thread Fabian Ebner
There is a need to set $noerr, because otherwise migration for a VM with a non-replicatable volume fails with: missing replicate feature on volume 'myfs:107/vm-107-disk-2.raw' Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 2 +- PVE/QemuServer.pm | 2 +- 2 files changed, 2

[pve-devel] [PATCH v4 qemu-server 02/27] migration with targetstorage: check if target storage supports images

2020-03-26 Thread Fabian Ebner
This makes sure that live migration also respects content types. Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 6 ++ 1 file changed, 6 insertions(+) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 9cff64d..f2be2a6 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm

[pve-devel] [PATCH v4 storage 01/27] storage_migrate: check if target storage supports content type

2020-03-26 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/Storage.pm | 5 + 1 file changed, 5 insertions(+) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index a46550c..7af1fc3 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -575,6 +575,11 @@ sub storage_migrate { my $tcfg = storage_config($cfg

[pve-devel] [PATCH v4 guest-common 13/27] Use new storage_migrate interface

2020-03-26 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/Replication.pm | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PVE/Replication.pm b/PVE/Replication.pm index ae1ade4..5b1e917 100644 --- a/PVE/Replication.pm +++ b/PVE/Replication.pm @@ -186,8 +186,16 @@ sub replicate_volume

[pve-devel] [PATCH v4 storage 12/27] Collect optional parameters for storage_migrate into $opts

2020-03-26 Thread Fabian Ebner
Sanitizing $with_snapshots is done on extraction to save a line. Signed-off-by: Fabian Ebner --- PVE/API2/Storage/Content.pm | 2 +- PVE/Storage.pm | 12 +--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage

[pve-devel] [PATCH v4 qemu-server 25/27] sync_disks: log output of storage_migrate

2020-03-26 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 5071f35..4fb204d 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -539,9 +539,10 @@ sub sync_disks

[pve-devel] [PATCH v4 storage 17/27] Add apiinfo helper to pvesm

2020-03-26 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/CLI/pvesm.pm | 30 ++ 1 file changed, 30 insertions(+) diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm index 510faba..0d1d816 100755 --- a/PVE/CLI/pvesm.pm +++ b/PVE/CLI/pvesm.pm @@ -47,6 +47,30 @@ sub setup_environment { PVE

[pve-devel] [PATCH v4 qemu-server 24/27] sync_disks: be more verbose if storage_migrate fails

2020-03-26 Thread Fabian Ebner
If storage_migrate dies, the error message might not include the volume ID or the target storage ID, but those might be good to know. Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE

[pve-devel] [PATCH v4 qemu-server 14/27] Use new storage_migrate interface

2020-03-26 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuMigrate.pm | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index abdac56..400c5e2 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -523,15 +523,19 @@ sub sync_disks

[pve-devel] [PATCH-SERIES v4] Make storage migration more flexible

2020-03-26 Thread Fabian Ebner
il/pve-devel/2020-March/042007.html [1]: https://pve.proxmox.com/pipermail/pve-devel/2020-March/042539.html guest-common: Fabian Ebner (5): Add interfaces for volume-related helpers Add foreach_unused_volume foreach_volume(_full): generalize and implement function Use new storage_migrate i

[pve-devel] [PATCH v4 qemu-server 21/27] Allow specifying targetstorage for offline migration

2020-03-26 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/API2/Qemu.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 4502a81..b7c28d2 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -3428,9 +3428,6 @@ __PACKAGE__->register_method({ $param->{

[pve-devel] [PATCH v4 qemu-server 06/27] Implement volume-related helpers and use new foreach_volume

2020-03-26 Thread Fabian Ebner
Signed-off-by: Fabian Ebner --- PVE/QemuConfig.pm | 40 +--- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm index 8d03774..6322089 100644 --- a/PVE/QemuConfig.pm +++ b/PVE/QemuConfig.pm @@ -77,6 +77,37

<    1   2   3   4   5   >