[pve-devel] [RFC storage 9/16] storage_migrate: Make error message more verbose

Fabian Ebner f.ebner at proxmox.com
Wed Jan 29 14:30:07 CET 2020


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.ebner at 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




More information about the pve-devel mailing list