From 172ab9f5ccc40666478f2f83696e6b1e62090e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <f.gruenbichler@proxmox.com> Date: Wed, 15 May 2024 12:10:08 +0200 Subject: [PATCH] storage tunnel: correctly set disk-import parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit according to the schema, else some combinations of migration / guest / storage settings will fail validation: 2024-05-15 11:48:51 ERROR: migration_snapshot: type check ('boolean') failed - got '' since this is client / source side, remote migrations to a remote node with validation enabled can fail without this change. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> --- src/PVE/StorageTunnel.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/StorageTunnel.pm b/src/PVE/StorageTunnel.pm index bc7f966..c880889 100644 --- a/src/PVE/StorageTunnel.pm +++ b/src/PVE/StorageTunnel.pm @@ -50,13 +50,13 @@ sub storage_migrate { my $disk_import_opts = { format => $format, storage => $targetsid, - snapshot => $snapshot, - migration_snapshot => $migration_snapshot, + migration_snapshot => $migration_snapshot ? 1 : 0, with_snapshots => $with_snapshots, allow_rename => !$opts->{is_vmstate}, export_formats => join(",", @export_formats), volname => $name, }; + $disk_import_opts->{snapshot} = $snapshot if $snapshot; my $res = PVE::Tunnel::write_tunnel($tunnel, 600, 'disk-import', $disk_import_opts); my $local = "/run/pve/$local_vmid.storage"; if (!$tunnel->{forwarded}->{$local}) {