]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #1013 : migrate : sync_disk : --targetstorage with offline disk
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 20 Dec 2018 08:55:10 +0000 (09:55 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 20 Dec 2018 09:11:32 +0000 (10:11 +0100)
targetsid was not used, for disk unused (offline copy)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/QemuMigrate.pm

index e9e9075ab4e3373cfa8505e08d6d1d1b494b8274..0bae0766678397a8b9e515c19d999f529aa7acae 100644 (file)
@@ -446,6 +446,7 @@ sub sync_disks {
 
        foreach my $volid (keys %$local_volumes) {
            my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
 
        foreach my $volid (keys %$local_volumes) {
            my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
+           my $targetsid = $self->{opts}->{targetstorage} ? $self->{opts}->{targetstorage} : $sid;
            if ($self->{running} && $self->{opts}->{targetstorage} && $local_volumes->{$volid}->{ref} eq 'config') {
                push @{$self->{online_local_volumes}}, $volid;
            } else {
            if ($self->{running} && $self->{opts}->{targetstorage} && $local_volumes->{$volid}->{ref} eq 'config') {
                push @{$self->{online_local_volumes}}, $volid;
            } else {
@@ -453,7 +454,7 @@ sub sync_disks {
                push @{$self->{volumes}}, $volid;
                my $insecure = $self->{opts}->{migration_type} eq 'insecure';
                my $with_snapshots = $local_volumes->{$volid}->{snapshots};
                push @{$self->{volumes}}, $volid;
                my $insecure = $self->{opts}->{migration_type} eq 'insecure';
                my $with_snapshots = $local_volumes->{$volid}->{snapshots};
-               PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid,
+               PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $targetsid,
                                              undef, undef, undef, undef, $insecure, $with_snapshots);
            }
        }
                                              undef, undef, undef, undef, $insecure, $with_snapshots);
            }
        }