[pve-devel] [PATCH container 1/3] bwlimit: add parameter to LXC::Migrate

Stoiko Ivanov s.ivanov at proxmox.com
Fri Mar 29 08:28:07 CET 2019


pass bwlimit parameter to storage_migrate

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index 1364b8d..6e85c61 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -283,7 +283,10 @@ sub phase1 {
 	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], $self->{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);
-- 
2.11.0





More information about the pve-devel mailing list