From: Fabian Ebner Date: Wed, 8 Apr 2020 09:25:11 +0000 (+0200) Subject: sync_disks: be more verbose if storage_migrate fails X-Git-Url: https://git.proxmox.com/?p=qemu-server.git;a=commitdiff_plain;h=49a5a0d84b626bef92ed4f1f519d5b1b9d59a64e;hp=cc1a3820dbe4ae79a553b1e52846a1a248628c38 sync_disks: be more verbose if storage_migrate fails 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 --- diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index a048fcb..5ed953a 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -557,8 +557,13 @@ sub sync_disks { 'allow_rename' => !$local_volumes->{$volid}->{is_vmstate}, }; - my $new_volid = PVE::Storage::storage_migrate($storecfg, $volid, $self->{ssh_info}, - $targetsid, $storage_migrate_opts); + my $new_volid = eval { + PVE::Storage::storage_migrate($storecfg, $volid, $self->{ssh_info}, + $targetsid, $storage_migrate_opts); + }; + if (my $err = $@) { + die "storage migration for '$volid' to storage '$targetsid' failed - $err\n"; + } $self->{volume_map}->{$volid} = $new_volid; $self->log('info', "volume '$volid' is '$new_volid' on the target\n");