From: sudhir kumar Subject: Re: [KVM-AUTOTEST] [PATCH] support for remote migration Date: Mon, 25 May 2009 12:10:07 +0530 Message-ID: References: <796594249.90621241466107981.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> <1473872622.90691241466166259.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: yogi , Uri Lublin , kvm@vger.kernel.org To: Michael Goldish Return-path: Received: from yw-out-2324.google.com ([74.125.46.29]:52509 "EHLO yw-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818AbZEYGkG convert rfc822-to-8bit (ORCPT ); Mon, 25 May 2009 02:40:06 -0400 Received: by yw-out-2324.google.com with SMTP id 5so1766026ywb.1 for ; Sun, 24 May 2009 23:40:07 -0700 (PDT) In-Reply-To: <1473872622.90691241466166259.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Michael, any updates on this patch? Are you going to commit this or you have any other plans/patch ? On Tue, May 5, 2009 at 1:12 AM, Michael Goldish w= rote: > Thanks for the new patch. I'll comment on it later because I want to = take some more time to review it. > > The login prompt problem is my fault -- please see my comment below. > > ----- "yogi" wrote: > >> Hello everyone, >> >> I like to resubmit patch to add support for "remote migration" in >> kvm-autotest, based on Michael Goldish's suggestions. >> >> To use this patch the following seven parameters should be added to >> the >> existing migration test >> >> =A0 =A0 =A0 =A0 remote_dst =3D yes >> =A0 =A0 =A0 =A0 hostip =3D >> =A0 =A0 =A0 =A0 remoteip =3D >> =A0 =A0 =A0 =A0 remuser =3D root >> =A0 =A0 =A0 =A0 rempassword =3D >> =A0 =A0 =A0 =A0 qemu_path_dst =3D >> =A0 =A0 =A0 =A0 image_dir_dst =3D >> >> >> For example: >> =A0 =A0 - migrate: =A0 =A0 =A0install setup >> =A0 =A0 =A0 =A0 type =3D migration >> =A0 =A0 =A0 =A0 vms +=3D " dst" >> =A0 =A0 =A0 =A0 migration_test_command =3D help >> =A0 =A0 =A0 =A0 kill_vm_on_error =3D yes >> =A0 =A0 =A0 =A0 hostip =3D 192.168.1.2 >> =A0 =A0 =A0 =A0 remoteip =3D 192.168.1.3 >> =A0 =A0 =A0 =A0 remuser =3D root >> =A0 =A0 =A0 =A0 rempassword =3D 123456 >> =A0 =A0 =A0 =A0 remote_dst =3D yes >> =A0 =A0 =A0 =A0 qemu_path_dst =3D /tmp/kvm_autotest_root/qemu >> =A0 =A0 =A0 =A0 image_dir_dst =3D /tmp/kvm_autotest_root/images >> >> =A0 =A0 =A0 =A0 variants: >> >> The parameter "remote_dst =3D yes", indicates that the VM "dst" shou= ld >> be >> started on the remote host.If the parameter qemu_path_dst and >> image_dir_dst, it is assumed tht the qemu binary images path is same >> on >> both local and remote host. >> >> > Regarding remote_login: >> > >> > - Why should remote_login return a session when it gets an >> unexpected login prompt? If you get a login prompt doesn't that mean >> something went wrong? The username is always provided in the ssh >> command line, so we shouldn't expect to receive a login prompt -- or >> am I missing something? I am pretty confident this is true in the >> general case, but maybe it's different when ssh keys have been >> exchanged between the hosts. >> > >> > - I think it makes little sense to return a session object when yo= u >> see a login prompt because that session will be useless. You can't >> send any commands to it because you don't have a shell prompt yet. A= ny >> command you send will be interpreted as a username, and will most >> likely be the wrong username. >> > >> > - When a guest is in the process of booting and we try to log into >> it, remote_login sometimes fails because it gets an unexpected login >> prompt. This is good, as far as I understand, because it means the >> guest isn't ready yet (still booting). The next time remote_login >> attempts to log in, it usually succeeds. If we consider an unexpecte= d >> login prompt OK, we pass login attempts that actually should have >> failed (and the resulting sessions will be useless anyway). >> > >> I have removed this from the current patch, so now the remote_login >> function is unchanged.I will recheck my machine configuration and >> submit >> it as new patch if necessary. I had exchanged ssh keys between the >> hosts(both local and remote hosts), but the login sessions seem to >> terminates with "Got unexpected login prompt". > > It seems the problem is caused by a "loose" regular expression in kvm= _utils.remote_login(). > In the list of parameters to read_until_last_line_matches, you'll fin= d something like "[Ll]ogin:". > I put it there to match the telnet login prompt which indicates failu= re, but it also matches the > "Last login: Mon May 4 ... from ..." line, which appears when SSH log= in succeeds. > This regex should be made stricter, e.g. r"^[Ll]ogin:\s*$", which mea= ns it must appear at the beginning > of the line, and must be followed by nothing other than whitespace ch= aracters. > > I'll commit a fix, which will also make the other regex's stricter as= well, but it won't appear in the > public repository until Uri comes back from vacation. > > Thanks, > Michael > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at =A0http://vger.kernel.org/majordomo-info.html > --=20 Sudhir Kumar