]> git.proxmox.com Git - qemu-server.git/commitdiff
sync_disks: be more verbose if storage_migrate fails
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 8 Apr 2020 09:25:11 +0000 (11:25 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 8 Apr 2020 20:11:54 +0000 (22:11 +0200)
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 <f.ebner@proxmox.com>
PVE/QemuMigrate.pm

index a048fcb5736832927abc460e8031f43056861b66..5ed953add834e76d3680028cf48bc4a803156592 100644 (file)
@@ -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");