[pve-devel] [PATCH container 1/3] bwlimit: add parameter to LXC::Migrate
Thomas Lamprecht
t.lamprecht at proxmox.com
Sat Mar 30 11:04:14 CET 2019
On 3/29/19 8:28 AM, Stoiko Ivanov wrote:
> pass bwlimit parameter to storage_migrate
looks OK, for nits see answer to qemu-server 1/7
>
> 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);
>
More information about the pve-devel
mailing list