[pve-devel] [PATCH] (partially) implement bwlimits

Stoiko Ivanov s.ivanov at proxmox.com
Fri Mar 29 08:27:58 CET 2019


This patch-series adds support for bandwidth limits to:
* qemu-server for:
  * online migration (including local volumes)
  * offline migration (consisting of only local volumes)
  * online clone_vm
  * online move_vm_disk

* pve-container for:
  * migration (only offline)
  * clone_vm
  * move_volume

AFAIS the following operations still ignore the bwlimits configured:
* Migration with replicated volumes
* replication (which has its 'rate' parameter per job, but probably should also
  honor the 'migrate' bwlimit)
* Qemu offline clone and move_vm_disk - this codepath currently uses
  `qemu-img convert` (which has no rate-limiting parameter (yet)) and swapping
  this for 'dd', 'pvesm export/import' would lose the ability of `qemu-img` to
  preserve sparse-files (I quickly tested it with a lvmthin volume where
  qemu-img kept it sparse) - I'd be grateful for a pointer if/how this could
  work, or if I missed something!

Additionally my (quick and limited) tests showed that qemu's drive-mirror seems
to have a discrepancy between the set 'speed' parameter and the actual speed
(IIRC setting the speed to 10MB/s, consistently moved the data with 8MB/s),
however I stuck to the documentation (speed parameter is in bytes/s).

The patch for pve-storage is a small fix for a conditional in
get_bandwidth_limits, enabling us to pass 'undef', additionally to '[]', if
we don't care about limits set on storages.

pve-storage:
Stoiko Ivanov (1):
  Storage::get_bandwidth_limit: fix if condition

 PVE/Storage.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

qemu-server: 
Stoiko Ivanov (7):
  bwlimit: honor bwlimit for migrate qmp call
  bwlimit: add parameter to qemu_drive_mirror
  bwlimit: add parameter to QemuMigrate::sync_disks
  bwlimit: add parameter for QemuMigrate:phase2
  add todo comment for bwlimits in clone_disk
  bwlimit: add parameter to QemuServer:clone_disk
  bwlimit: add parameter to API2 calls

 PVE/API2/Qemu.pm   | 28 ++++++++++++++++++++++++++--
 PVE/QemuMigrate.pm | 22 +++++++++++++++++-----
 PVE/QemuServer.pm  | 15 +++++++++++----
 3 files changed, 54 insertions(+), 11 deletions(-)

pve-container:
Stoiko Ivanov (3):
  bwlimit: add parameter to LXC::Migrate
  bwlimit: add parameter to rsync in copy_volume
  bwlimit: add parameter to API2 calls

 src/PVE/API2/LXC.pm    | 30 +++++++++++++++++++++++++++---
 src/PVE/LXC.pm         | 10 ++++++----
 src/PVE/LXC/Migrate.pm |  5 ++++-
 3 files changed, 37 insertions(+), 8 deletions(-)

-- 
2.11.0




More information about the pve-devel mailing list