]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/LXC/Migrate.pm
migrate: also set targetsid for unreferenced disks
[pve-container.git] / src / PVE / LXC / Migrate.pm
index c85a09c33f4c7c7b6cef6a62029a8c88f5287c54..2ef1cce42adf738050c6cf37043c2bbb54bc01a8 100644 (file)
@@ -211,15 +211,16 @@ sub phase1 {
 
        # check if storage is available on target node
        my $targetsid = PVE::JSONSchema::map_id($self->{opts}->{storagemap}, $storeid);
-       PVE::Storage::storage_check_enabled($self->{storecfg}, $targetsid, $self->{node});
+       my $target_scfg = PVE::Storage::storage_check_enabled($self->{storecfg}, $targetsid, $self->{node});
 
-       die "content type 'rootdir' is not available on storage '$storeid'\n"
-           if !$scfg->{content}->{rootdir};
+       die "content type 'rootdir' is not available on storage '$targetsid'\n"
+           if !$target_scfg->{content}->{rootdir};
 
        PVE::Storage::foreach_volid($dl, sub {
            my ($volid, $sid, $volname) = @_;
 
            $volhash->{$volid}->{ref} = 'storage';
+           $volhash->{$volid}->{targetsid} = $targetsid;
        });
     }
 
@@ -304,6 +305,7 @@ sub phase1 {
                'ratelimit_bps' => $bwlimit,
                'insecure' => $opts->{migration_type} eq 'insecure',
                'with_snapshots' => $volhash->{$volid}->{snapshots},
+               'allow_rename' => 1,
            };
 
            my $logfunc = sub { $self->log('info', $_[0]); };