The volid contains the format and that's relevant information
for why migration is not possible.
For example, a raw volume can be migrated between an LVM storage
and a filesystem based storage, but a qcow2 volume cannot.

Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---
 PVE/Storage.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 6aea2ef..664e07d 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -589,7 +589,10 @@ sub storage_migrate {
     }
 
     my @formats = volume_transfer_formats($cfg, $volid, $target_storeid, 
$target_volname, $snapshot, $base_snapshot, $with_snapshots);
-    die "cannot migrate from storage type '$scfg->{type}' to 
'$tcfg->{type}'\n" if !@formats;
+    if (!@formats) {
+       die "cannot migrate volume '$volid' from storage type '$scfg->{type}' " 
.
+           "to storage type '$tcfg->{type}' - no common format\n";
+    }
     my $format = $formats[0];
 
     my $import_fn = '-'; # let pvesm import read from stdin per default
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to