]> git.proxmox.com Git - qemu-server.git/commitdiff
bwlimit: add parameter to QemuMigrate::sync_disks
authorStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 1 Apr 2019 09:31:00 +0000 (11:31 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 2 Apr 2019 08:58:35 +0000 (10:58 +0200)
used for offline migration of local volumes

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/QemuMigrate.pm

index bb65d634cfcbf98b898ed80fff0d91b504a5e33d..55c9a7c652df61833951f0612815be111a3efe47 100644 (file)
@@ -464,10 +464,16 @@ sub sync_disks {
            } else {
                next if $rep_volumes->{$volid};
                push @{$self->{volumes}}, $volid;
-               my $insecure = $self->{opts}->{migration_type} eq 'insecure';
+               my $opts = $self->{opts};
+               my $insecure = $opts->{migration_type} eq 'insecure';
                my $with_snapshots = $local_volumes->{$volid}->{snapshots};
+               # use 'migrate' limit for transfer to other node
+               my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$targetsid, $sid], $opts->{bwlimit});
+               # JSONSchema and get_bandwidth_limit use kbps - storage_migrate bps
+               $bwlimit = $bwlimit * 1024 if defined($bwlimit);
+
                PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $targetsid,
-                                             undef, undef, undef, undef, $insecure, $with_snapshots);
+                                             undef, undef, undef, $bwlimit, $insecure, $with_snapshots);
            }
        }
     };