]> git.proxmox.com Git - pve-container.git/commitdiff
storage migrate: add bwlimit parameter
authorStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 1 Apr 2019 09:31:06 +0000 (11:31 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 2 Apr 2019 12:31:13 +0000 (14:31 +0200)
pass bwlimit parameter to storage_migrate

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC/Migrate.pm

index 1364b8d480c0ce108b0c67f410b2577ab5732ada..7df3c4c84600d183c5a3cde261e7f38796c65dc1 100644 (file)
@@ -277,13 +277,18 @@ sub phase1 {
            'PVE::LXC::Config', $jobcfg, $start_time, $start_time, $logfunc);
     }
 
-    my $insecure = $self->{opts}->{migration_type} eq 'insecure';
+    my $opts = $self->{opts};
+    my $insecure = $opts->{migration_type} eq 'insecure';
     foreach my $volid (keys %$volhash) {
        next if $rep_volumes->{$volid};
        my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
        push @{$self->{volumes}}, $volid;
        my $with_snapshots = $volhash->{$volid}->{snapshots};
-       PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid, undef, undef, undef, undef, $insecure, $with_snapshots);
+       my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$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}, $sid, undef, undef, undef, $bwlimit, $insecure, $with_snapshots);
     }
 
     my $conffile = PVE::LXC::Config->config_file($vmid);