Skip to contentSkip to conversation

support for remote migration

PATCH In review yogi 2 participants 2 messages Apr 30, 2009 KVM

lore
Share & tools
lore

yogi

author
#0 lore raw

PATCH 1/1 support for remote migration

Hello everyone,

I like to submit patch to add support for "remote migration" in kvm-autotest.

To use this patch the following four parameters should be added to the existing migration test

remote = dst
hostip = <localhost ip or name>
remoteip = <remote host ip or name>
remuser = root
rempassword = <password>

the field remote=dst indicates the VM "dst" should be created on remote machine.
For example:
- migrate: install setup
type = migration
vms += " dst"
migration_test_command = help
kill_vm_on_error = yes
remote = dst
hostip = 192.168.1.2
remoteip = 192.168.1.3
remuser = root
rempassword = 123456
variants:

Three files r being modified in this patch kvm_utils.py, kvm_tests.py and kvm_vm.py.
kvm_utils.py - if the ssh-keys have been exchanged between the test machines,then remote login fails with message "Got unexpected login prompt", to prevent this, have made it return a session rather then None

kvm_tests.py - the host address used in migration is made dynamic

kvm_vm.py - have replaced unix sockets with tcp sockets for monitor,
in both remote and local VM. Added two new variables(remote,ssh_port) to class VM,remote set to True if the VM is on a remote machine,ssh_port contains the redirection port, funtion get_address() returns the ip of the host whr the VM is(local or remote).

Thx
Yogi

 kvm_tests.py |    2 -
 kvm_utils.py |    3 --
 kvm_vm.py    |   61 ++++++++++++++++++++++++++++++++++++++++++++---------------
 3 files changed, 48 insertions(+), 18 deletions(-)

---

client/tests/kvm_runtest_2/kvm_tests.py renamed from /client/tests/kvm_runtest_2/kvm_tests.py +1 -1
diff -aurp kvm-autotest.orgi//client/tests/kvm_runtest_2/kvm_tests.py kvm-autotest/client/tests/kvm_runtest_2/kvm_tests.py
@@ -81,7 +81,7 @@ def run_migration(test, params, env):
     session.close()
 
     # Define the migration command
-    cmd = "migrate -d tcp:localhost:%d" % dest_vm.migration_port
+    cmd = "migrate -d tcp:%s:%d" % (dest_vm.hostip,dest_vm.migration_port)
     kvm_log.debug("Migration command: %s" % cmd)
 
     # Migrate
client/tests/kvm_runtest_2/kvm_utils.py renamed from /client/tests/kvm_runtest_2/kvm_utils.py +1 -2
diff -aurp kvm-autotest.orgi//client/tests/kvm_runtest_2/kvm_utils.py kvm-autotest/client/tests/kvm_runtest_2/kvm_utils.py
@@ -431,8 +431,7 @@ def remote_login(command, password, prom
                 return None
         elif match == 2:  # "login:"
             kvm_log.debug("Got unexpected login prompt")
-            sub.close()
-            return None
+            return sub
         elif match == 3:  # "Connection closed"
             kvm_log.debug("Got 'Connection closed'")
             sub.close()
client/tests/kvm_runtest_2/kvm_vm.py renamed from /client/tests/kvm_runtest_2/kvm_vm.py +46 -15

145 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · yogi

Hello everyone,

I like to submit patch to add support for "remote migration" in kvm-autotest.

Thanks for the patch, Uri is out on vacation for a while. I'll apply the patch to my test repo and do some validation testing, however may be a little while untill it makes it in.

-D