[pve-devel] Storage migration: No on-line migration support

Alexandre DERUMIER aderumier at odiso.com
Thu Jan 17 09:24:57 CET 2013


I'm looking to your drive-mirror code,

about
# if writes to disk occurs the disk needs to be freezed
# to be able to complete the migration

Are you sure that drive-mirror cannot handle new writes during the mirroring ?
I think they must be a bitmap a new writes somewhere, maybe it's exist some kind of delta write command ?

also, If you really need to freeze the vm, I think you can simply pause the vm, you don't need to use savevm-start/end.(because this is used to save vm memory)





	my $freeze = sub {
		print "Freezing to complete migration...\n";
		PVE::QemuServer::vm_mon_cmd($vmid, "savevm-start");
	};
	
	my $activate = sub {
		print "Reactivate after freeze...\n";
		PVE::QemuServer::vm_mon_cmd($vmid, "savevm-end");
	};
	
	eval {
		while (1) {
			my $stats = PVE::QemuServer::vm_mon_cmd($vmid, "query-block-jobs");
			my $stat = @$stats[0];
			die "error job is not mirroring" if $stat->{type} ne "mirror";
			print $stat->{offset}."/".$stat->{len}."\n";
			last if ($stat->{len} == $stat->{offset});
			if ($old_len == $stat->{offset}) {
				if ($count > 5) {
					# if writes to disk occurs the disk needs to be freezed
					# to be able to complete the migration
					&$freeze;
					$count = 0;
					$frozen = 1;
				} else {
					$count++ unless $frozen;
				}
			}
			elsif ($frozen) {
				&$activate;
				$count = 0;
			}
			
			$old_len = $stat->{offset};
			sleep 1;
		}
	};


----- Mail original ----- 

De: "Michael Rasmussen" <mir at datanom.net> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Envoyé: Mardi 15 Janvier 2013 07:49:35 
Objet: Re: [pve-devel] Storage migration: No on-line migration support 

On Tue, 15 Jan 2013 07:12:26 +0100 (CET) 
Alexandre DERUMIER <aderumier at odiso.com> wrote: 

> 
> Are you sure you completly loose the socket ? Or does it hang temporarly ? 
> 
It is completely lost. What triggers it is if some command is timed 
out then the next call will generate a lost socket error. This handles 
every time a command times out after 30 sec. 

-- 
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 
-------------------------------------------------------------- 
Use free-form input when possible. 
- The Elements of Programming Style (Kernighan & Plaugher) 



More information about the pve-devel mailing list