[pve-devel] vm_copy : running vm copy for proxmox 3.0 ?

Michael Rasmussen mir at datanom.net
Fri May 3 00:59:56 CEST 2013


Hi all,

On Thu, 02 May 2013 18:34:10 +0200 (CEST)
Alexandre DERUMIER <aderumier at odiso.com> wrote:

> 
> Maybe can we compute average source new writes (ios ? bandwith ?), or something like that, and decrease progressively the ios or bandwith.
> I need to think about that a little more.
> 
I have given this some thoughts and I think it could be implemented
this way:

my $max_bps_wr = get_target_max_bps_wr($target);
my $bps_wr = $max_bps_wr;
my $new_bps_wr = 0;
my $timer = 0;
eval {
	while (1) {
		my $elapsed = time() - $timer
		if ($elapsed < $timer) {
			$new_bps_wr = $bps_wr * 0.9;
			if ($new_bps_wr <= ($max_bps_wr * 0.1) {
				die "Target $target is to congested";
			}
		}
		else {
			$new_bps_wr = $bps_wr * 1.05;
			if ($new_bps_wr > $max_bps_wr) {
				$new_bps_wr = $max_bps_wr;
			}
		}
		$timer = $elapsed;
		$bps_wr = $new_bps_wr;
		PVE::QemuServer::qemu_block_set_io_throttle(
			$vmid, $target, 0, 0, $new_bps_wr);
		# do other migration stuff
	}
};
do {
		my $err = $@;
		PVE::QemuServer::qemu_block_set_io_throttle(
			$vmid, $target, 0, 0, 0);
		# do other error stuff
		die $err;
} if $@;

PVE::QemuServer::qemu_block_set_io_throttle($vmid, $target, 0, 0, 0);

-- 
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
People think love is an emotion.  Love is good sense.
		-- Ken Kesey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://pve.proxmox.com/pipermail/pve-devel/attachments/20130503/7c3d5e99/attachment.pgp>


More information about the pve-devel mailing list