[PATCH 0 of 4] [TEST][RFC] Added new tc to verify remote live migration.

Verified with KVM. The test case will not pass for KVM since the guest information needs to have emulator information without which the remote migration fails. The support to pass the emulator information via VirtualSystemMigrationSettingData is not yet available. As a workaround for verification of the tc. ------------------------------------------- 1) create a KVM VM which has the emulator information outside the tc on the comman line. 2) comment out the setup_guest() call, also comment the undefine and destroy lines at the end of the tc. 3) specify the name of the guest create in test_dom before calling local_remote_migrate(). Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com>

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1236948993 25200 # Node ID c504e1a011d7891cb974702ca249bc7b5ab1fffa # Parent b50635aae0979d8770435cc1d5e6b478ef0d8853 [TEST[RFC] Adding option to main.py to accept target machine info for Migration Tests. New option can be specified as below: CIM_NS=root/virt CIM_USER=userid CIM_PASS=pass ./runtests libvirt-cim -i localhost -c -v KVM -g VirtualSystemMigrationService -t 06_remote_migration.py --target_url <hostname> or CIM_NS=root/virt CIM_USER=userid CIM_PASS=pass ./runtests libvirt-cim -i localhost -c -v KVM -g VirtualSystemMigrationService -t 06_remote_migration.py -m <hostname> Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r b50635aae097 -r c504e1a011d7 suites/libvirt-cim/main.py --- a/suites/libvirt-cim/main.py Fri Mar 13 05:50:45 2009 -0700 +++ b/suites/libvirt-cim/main.py Fri Mar 13 05:56:33 2009 -0700 @@ -44,6 +44,8 @@ parser = OptionParser() parser.add_option("-i", "--ip", dest="ip", default="localhost", help="IP address of machine to test (default: localhost)") +parser.add_option("-m", "--target_url", dest="t_url", default="localhost:5988", + help="URL of destination host for remote migration ") parser.add_option("-p", "--port", dest="port", type="int", default=5988, help="CIMOM port (default: 5988)") parser.add_option("-g", "--group", dest="group", @@ -199,6 +201,14 @@ # with a different port if options.port: os.environ['CIMOM_PORT'] = str(options.port) + + # src and target host info to be able to use + # in the tc for comparison in remote migration case + if ":" in options.ip: + (options.ip, port) = options.ip.split(":") + + if ":" in options.t_url: + (options.t_url, port) = options.t_url.split(":") if options.report: to_addr = options.report @@ -243,8 +253,9 @@ t_path = os.path.join(TEST_SUITE, test['group']) os.environ['CIM_TC'] = test['test'] cdto = 'cd %s' % t_path - run = 'python %s -i %s -v %s %s' % (test['test'], options.ip, - options.virt, dbg) + run = 'python %s -i %s -v %s %s -m %s' % (test['test'], options.ip, + options.virt, dbg, + options.t_url) cmd = cdto + ' && ' + ' ' + run status, output = commands.getstatusoutput(cmd)

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1236949057 25200 # Node ID a7843fdcb24f71bfa7749d9bd96431ceef0e3e32 # Parent c504e1a011d7891cb974702ca249bc7b5ab1fffa [TEST][RFC]Modifying emulator information to be used for KVM. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r c504e1a011d7 -r a7843fdcb24f suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Fri Mar 13 05:56:33 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Fri Mar 13 05:57:37 2009 -0700 @@ -82,10 +82,12 @@ Xen_default_mac = '11:22:33:aa:bb:cc' # vxml.KVMXML -if fv_cap(CIM_IP): - KVM_default_emulator = '/usr/bin/qemu-kvm' -else: - KVM_default_emulator = '/usr/bin/qemu' +KVM_default_emulator = '/usr/local/bin/qemu-system-x86_64' +if not os.path.exists(KVM_default_emulator): + if fv_cap(CIM_IP): + KVM_default_emulator = '/usr/bin/qemu-kvm' + else: + KVM_default_emulator = '/usr/bin/qemu' KVM_disk_path = os.path.join(_image_dir, 'default-kvm-dimage') KVM_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') KVM_default_disk_dev = 'hda' @@ -115,6 +117,8 @@ parser = OptionParser() parser.add_option("-i", "--ip", dest="ip", default="localhost", help="IP address of machine to test, default: localhost") +parser.add_option("-m", "--target_url", dest="t_url", default="localhost:5988", + help="URL of destination host for remote migration ") parser.add_option("-v", "--virt", dest="virt", type="choice", choices=['Xen', 'KVM', 'XenFV', 'LXC'], default="Xen", help="Virt type, select from: 'Xen' & 'KVM' & 'XenFV' & 'LXC', default: Xen")

@@ -82,10 +82,12 @@ Xen_default_mac = '11:22:33:aa:bb:cc'
# vxml.KVMXML -if fv_cap(CIM_IP): - KVM_default_emulator = '/usr/bin/qemu-kvm' -else: - KVM_default_emulator = '/usr/bin/qemu' +KVM_default_emulator = '/usr/local/bin/qemu-system-x86_64' +if not os.path.exists(KVM_default_emulator): + if fv_cap(CIM_IP): + KVM_default_emulator = '/usr/bin/qemu-kvm' + else: + KVM_default_emulator = '/usr/bin/qemu' KVM_disk_path = os.path.join(_image_dir, 'default-kvm-dimage') KVM_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') KVM_default_disk_dev = 'hda'
I just worked up a patch that adds the Emulator attribute. So now cim_define() needs to be modified to set the Emulator attribute of the VSSD reference. Also, I tested this set on Xen - looks good. I think this is ready to be resubmitted (with the emulator change). -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1236951243 25200 # Node ID c272bb5f4c9fcbceb6e70d0b5a0cd0ea40359e72 # Parent a7843fdcb24f71bfa7749d9bd96431ceef0e3e32 [TEST][RFC] #2 Adding support for remote migration in the vsmigrations library. Updates: -------- Patch2: ------- 1) Added log messages for printing JobStatus 2) Removed the vsmservice param to local_remote_migrate and created it locally in the same function. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r a7843fdcb24f -r c272bb5f4c9f suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Fri Mar 13 05:57:37 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Fri Mar 13 06:34:03 2009 -0700 @@ -3,6 +3,7 @@ # # Authors: # Guolian Yun <yunguol@cn.ibm.com> +# Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -18,34 +19,59 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -import pywbem -import time +# + +from time import sleep +from pywbem import WBEMConnection, CIMInstanceName from CimTest.CimExt import CIMMethodClass, CIMClassMOF -from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS from CimTest.ReturnCodes import PASS, FAIL -from XenKvmLib.test_doms import destroy_and_undefine_domain -from CimTest.Globals import logger, CIM_ERROR_ENUMERATE from XenKvmLib import enumclass -from XenKvmLib.classes import get_typed_class +from XenKvmLib.classes import get_typed_class, virt_types from XenKvmLib.xm_virt_util import domain_list from XenKvmLib.const import get_provider_version +from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, \ + CIM_ERROR_ENUMERATE +# Migration constants +CIM_MIGRATE_OFFLINE=1 +CIM_MIGRATE_LIVE=2 +CIM_MIGRATE_RESUME=3 +CIM_MIGRATE_RESTART=4 + +CIM_JOBSTATE_STARTING=3 +CIM_JOBSTATE_COMPLETE=7 +CIM_JOBSTATE_RUNNING=4 libvirt_mig_changes = 668 +def eval_cls(basename): + def func(f): + def body(virt): + if virt in virt_types: + return eval(get_typed_class(virt, basename)) + return body + return func + + class CIM_VirtualSystemMigrationService(CIMMethodClass): conn = None inst = None - def __init__(self, server, hyp): - self.conn = pywbem.WBEMConnection('http://%s' % server, - (CIM_USER, CIM_PASS), CIM_NS) + def __init__(self, server, virt='Xen'): + self.conn = WBEMConnection('http://%s' % server, + (CIM_USER, CIM_PASS), CIM_NS) - self.inst = hyp + '_VirtualSystemMigrationService' + self.inst = get_typed_class(virt, 'VirtualSystemMigrationService') +@eval_cls('VirtualSystemMigrationService') +def get_vs_mig_setting_class(virt): + pass + class Xen_VirtualSystemMigrationService(CIM_VirtualSystemMigrationService): - def __init__(self, server): - CIM_VirtualSystemMigrationService.__init__(self, server, 'Xen') + pass + +class KVM_VirtualSystemMigrationService(CIM_VirtualSystemMigrationService): + pass # classes to define VirtualSystemMigrationSettingData parameters class CIM_VirtualSystemMigrationSettingData(CIMClassMOF): @@ -56,118 +82,242 @@ self.Priority = priority class Xen_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData): - def __init__(self, type, priority): - CIM_VirtualSystemMigrationSettingData.__init__(self, type, - priority) + pass class KVM_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData): - def __init__(self, type, priority): - CIM_VirtualSystemMigrationSettingData.__init__(self, type, - priority) + pass +def get_msd(virt, mtype='live', mpriority=0): + if mtype == "live": + mtype = CIM_MIGRATE_LIVE + elif mtype == "resume": + mtype = CIM_MIGRATE_RESUME + elif mtype == "restart": + mtype = CIM_MIGRATE_RESTART + elif mtype == "offline": + mtype = CIM_MIGRATE_OFFLINE + else: + logger.error("Invalid migration type '%s' specified", mtype) + return None + try: + vsmsd_cn = get_typed_class(virt, "VirtualSystemMigrationSettingData") + msd = eval(vsmsd_cn)(type=mtype, priority=mpriority) + except Exception, details: + logger.error("In get_msd() Exception details: %s", details) + return None + + return msd.mof() + +def get_guest_ref(guest, virt): + guest_cn = get_typed_class(virt, "ComputerSystem") + keys = { 'Name' : guest, 'CreationClassName' : guest_cn } + cs_ref = None + + try: + cs_ref = CIMInstanceName(guest_cn, keybindings=keys) + + except Exception, details: + logger.error("In fn get_guest_ref() Exception details: %s", details) + return None + + return cs_ref + +#Remove this once vsms.02_host_migrate_type.py uses get_msd() def default_msd_str(mtype=3, mpriority=0): msd = Xen_VirtualSystemMigrationSettingData(type=mtype, priority=mpriority) return msd.mof() -def check_possible_host_migration(service, cs_ref, ip): - rc = None +def check_possible_host_migration(service, cs_ref, ip, msd=None): + res = None try: - rc = service.CheckVirtualSystemIsMigratableToHost(ComputerSystem=cs_ref, - DestinationHost=ip) + checkfn_name = 'service.CheckVirtualSystemIsMigratableToHost' + if msd == None: + res = eval(checkfn_name)(ComputerSystem=cs_ref, DestinationHost=ip) + else: + res = eval(checkfn_name)(ComputerSystem=cs_ref, + DestinationHost=ip, + MigrationSettingData=msd) except Exception, details: - logger.error("Error invoke 'CheckVirtualSystemIsMigratableToHost\'.") + logger.error("Error invoke 'CheckVirtualSystemIsMigratableToHost'.") logger.error("%s", details) return FAIL - if rc == None or rc[1]['IsMigratable'] != True: + if res == None or res[1]['IsMigratable'] != True: + logger.error("Migration check failed") return FAIL return PASS -def migrate_guest_to_host(service, ref, ip, msd=None): + +def migrate_guest_to_host(service, cs_ref, dest_ip, msd=None): ret = [] try: if msd == None: - ret = service.MigrateVirtualSystemToHost(ComputerSystem=ref, - DestinationHost=ip) + ret = service.MigrateVirtualSystemToHost(ComputerSystem=cs_ref, + DestinationHost=dest_ip) else: - ret = service.MigrateVirtualSystemToHost(ComputerSystem=ref, - DestinationHost=ip, + ret = service.MigrateVirtualSystemToHost(ComputerSystem=cs_ref, + DestinationHost=dest_ip, MigrationSettingData=msd) except Exception, details: - logger.error("Error invoke method 'MigrateVirtualSystemToHost\'.") - logger.error("%s", details) + logger.error("Failed to invoke method 'MigrateVirtualSystemToHost'.") + logger.error("Exception in fn migrate_guest_to_host() %s", details) return FAIL, ret if len(ret) == 0: logger.error("MigrateVirtualSystemToHost returns an empty list") return FAIL, ret + return PASS, ret -def get_migration_job_instance(ip, virt, id): +def get_migration_job_instance(src_ip, virt, id): job = [] - key_list = ["instanceid"] - curr_cim_rev, changeset = get_provider_version(virt, ip) + curr_cim_rev, changeset = get_provider_version(virt, src_ip) if curr_cim_rev < libvirt_mig_changes: mig_job_cn = 'Virt_MigrationJob' else: mig_job_cn = get_typed_class(virt, 'MigrationJob') try: - job = enumclass.EnumInstances(ip, mig_job_cn) + job = enumclass.EnumInstances(src_ip, mig_job_cn) + if len(job) < 1: + logger.error("'%s' returned empty list", mig_job_cn) + return FAIL, None + + for i in range(0, len(job)): + if job[i].InstanceID == id: + break + elif i == len(job)-1 and job[i].InstanceID != id: + logger.error("%s err: can't find expected job inst", mig_job_cn) + return FAIL, None except Exception, details: logger.error(CIM_ERROR_ENUMERATE, mig_job_cn) - logger.error(details) + logger.error("Exception in fn get_migration_job_instance() " \ + "details: %s", details) return FAIL, None - if len(job) < 1: - return FAIL, None - - for i in range(0, len(job)): - if job[i].InstanceID == id: - break - elif i == len(job)-1 and job[i].InstanceID != id: - logger.error("%s err: can't find expected job inst", mig_job_cn) - return FAIL, None - return PASS, job[i] -def verify_domain_list(list, local_migrate, test_dom): - status = PASS - if local_migrate == 0 and test_dom not in list: - status = FAIL - if local_migrate == 1 and test_dom in list: +def verify_domain_list(virt, remote_migrate, test_dom, src_ip, target_ip): + status = FAIL + list_src = domain_list(src_ip, virt) + if remote_migrate == 0: + if test_dom in list_src: + status = PASS + elif remote_migrate == 1 : + list_target = domain_list(target_ip, virt) + if test_dom not in list_src and test_dom in list_target: + status = PASS + else: + logger.error("Invalid migration option") + + if status != PASS: + logger.error("Migration verification for '%s' failed", test_dom) + return status + + return status + +def check_migration_job(src_ip, id, target_ip, test_dom, + remote_migrate, virt='Xen', timeout=50): + try: + status, job_inst = get_migration_job_instance(src_ip, virt, id) + if status != PASS: + logger.error("Unable to get mig_job instance for '%s'", test_dom) + return FAIL + status = FAIL - if status != PASS: - logger.error("%s migrate failed", test_dom) + for i in range(0, timeout): + if job_inst.JobState == CIM_JOBSTATE_COMPLETE: + sleep(3) + if job_inst.Status != "Completed": + logger.error("JobStatus for dom '%s' has '%s' instead of "\ + "'Completed'", test_dom, job_inst.Status) + return FAIL + else: + status = verify_domain_list(virt, remote_migrate, test_dom, + src_ip, target_ip) + if status != FAIL: + logger.info("Migration for '%s' succeeded.", test_dom) + logger.info("Migration job status is : %s", + job_inst.Status) + return status + elif job_inst.JobState == CIM_JOBSTATE_RUNNING and i < (timeout-1): + sleep(3) + status, job_inst = get_migration_job_instance(src_ip, virt, id) + if status != PASS: + logger.error("Could not get mig_job instance for '%s'", + test_dom) + return status + else: + logger.error("Migration timed out.... ") + logger.error("Increase timeout > %s and try again..", timeout) + return FAIL + + except Exception, details: + logger.error("In check_migration_job() Exception details: %s", details) + return FAIL + +# Desc: +# Fn Name : local_remote_migrate() +# +# Parameters: +# This fn executes local/remote migration depending on the +# value of remote_migrate. +# Parameters used: +# vsmservice = VSMigrationService Instance +# s_sysname = src host on which migration is initiated +# t_sysname = Target machine for migration +# virt = Xen, KVM +# remote_migrate = 1 [for remote migration, 0 for local] +# mtype = live/resume/offline/restart +# mpriority=0 by default +# guest_name = name of the guest to be migrated +# time_out = time for which migration is tried. +# +def local_remote_migrate(s_sysname, t_sysname, virt='KVM', + remote_migrate=1, mtype='live', mpriority=0, + guest_name=None, time_out=40): + + if guest_name == None: + logger.error("Guest to be migrated not specified.") + return FAIL + + # Get the guest ref + guest_ref = get_guest_ref(guest_name, virt) + if guest_ref == None or guest_ref['Name'] != guest_name: + logger.error("Failed to get the guest refernce to be migrated") + return FAIL + + # Get MigrationSettingData information + msd = get_msd(virt, mtype, mpriority) + if msd == None: return FAIL - return PASS + # Get VirtualSystemMigrationService object + vsms_cn = get_vs_mig_setting_class(virt) + vsmservice = vsms_cn(s_sysname, virt) -def check_migration_job(ip, id, target_ip, test_dom, local_migrate, virt='Xen'): - status, job_inst = get_migration_job_instance(ip, virt, id) + # Verify is destination(t_sysname) can be used for migration + status = check_possible_host_migration(vsmservice, guest_ref, + t_sysname, msd) if status != PASS: return FAIL - for i in range(0, 50): - if job_inst.JobState == 7: - if job_inst.Status != "Completed": - logger.error("%s migrate failed", test_dom) - return FAIL - list_after = domain_list(ip) - status = verify_domain_list(list_after, local_migrate, test_dom) - break - elif job_inst.JobState == 4 and i < 49: - time.sleep(3) - status, job_inst = get_migration_job_instance(ip, virt, id) - if status != PASS: - return FAIL - else: - logger.error("MigrateVirtualSystemToHost took too long") - return FAIL + logger.info("Migrating %s.. this will take some time.", guest_name) + # Migrate the guest to t_sysname + status, ret = migrate_guest_to_host(vsmservice, guest_ref, t_sysname, msd) + if status == FAIL: + logger.error("Failed to Migrate guest '%s' from '%s' to '%s'", + guest_name, s_sysname, t_sysname) + return status + elif len(ret) == 2: + id = ret[1]['Job'].keybindings['InstanceID'] - return PASS + # Verify if migration status + status = check_migration_job(s_sysname, id, t_sysname, guest_name, + remote_migrate, virt, timeout=time_out) + return status

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1237188257 25200 # Node ID 8a282c8879a9986c2bdde0238a4307ea3378ee4b # Parent c272bb5f4c9fcbceb6e70d0b5a0cd0ea40359e72 [TEST][RFC] #2 Added new tc to verify remote live migration. Updates: -------- Patch 2: ------- 1) Moved the VSMS object creation to vsmigration.py local_remote_migrate() fn. 2) Added check for domains on src and target, Undefined & destoryed domain on src and target depending on their existence. Verified with KVM. The test case will not pass for KVM since the guest information needs to have emulator information without which the remote migration fails. The support to pass the emulator information via VirtualSystemMigrationSettingData is not yet available. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r c272bb5f4c9f -r 8a282c8879a9 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/06_remote_live_migration.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/06_remote_live_migration.py Mon Mar 16 00:24:17 2009 -0700 @@ -0,0 +1,116 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# This testcase is used to verify the live remote migration. +# +# Date : 12-03-09 +# + +import sys +import os +from socket import gethostname, gethostbyaddr +from XenKvmLib import vxml +from XenKvmLib.xm_virt_util import domain_list +from XenKvmLib.common_util import poll_for_state_change +from CimTest.Globals import logger +from XenKvmLib.const import do_main +from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.classes import get_typed_class +from XenKvmLib.vsmigrations import local_remote_migrate + +sup_types = ['KVM', 'Xen'] + +REQUESTED_STATE = 2 + +def setup_guest(test_dom, ip, virt): + virt_xml = vxml.get_class(virt) + cxml = virt_xml(test_dom) + ret = cxml.cim_define(ip) + if not ret: + logger.error("Error define domain %s", test_dom) + return FAIL, cxml + + status = cxml.cim_start(ip) + if status != PASS: + cxml.undefine(test_dom) + logger.error("Error to start domain %s", test_dom) + return FAIL, cxml + + status, dom_cs = poll_for_state_change(ip, virt, test_dom, + REQUESTED_STATE) + if status != PASS: + cxml.cim_destroy(test_dom) + cxml.undefine(test_dom) + logger.error("'%s' didn't change state as expected" % test_dom) + return FAIL, cxml + + return PASS, cxml + +@do_main(sup_types) +def main(): + options = main.options + virt = options.virt + s_sysname = gethostbyaddr(options.ip)[0] + t_sysname = gethostbyaddr(options.t_url)[0] + if options.virt == 'KVM' and (t_sysname == s_sysname or \ + t_sysname in s_sysname): + logger.info("Libvirt does not support local migratoin for KVM") + return SKIP + + status = FAIL + test_dom = 'VM_frm_' + gethostname() + + try: + status, cxml = setup_guest(test_dom, s_sysname, virt) + if status != PASS: + logger.error("Error setting up the guest") + return status + + # Migrate the test_dom to t_sysname. + # local_remote_migrate executes live migration by default + # Enable remote migration by setting remote_migrate=1 + status = local_remote_migrate(s_sysname, t_sysname, virt, + remote_migrate=1, guest_name=test_dom) + except Exception, details: + logger.error("Exception details :%s", details) + status = FAIL + + # Clean the domain on target machine. + # This req when migration is successful, also when migration is not + # completely successful VM might be created on the target machine + # and hence need to clean. + target_list = domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: + cxml.cim_destroy(t_sysname) + cxml.undefine(t_sysname) + + # Remote Migration not Successful, clean the domain on src machine + src_list = domain_list(s_sysname, virt) + if src_list != None and test_dom in src_list: + cxml.cim_destroy(s_sysname) + cxml.undefine(s_sysname) + + return status + +if __name__ == "__main__": + sys.exit(main())

Deepti B. Kalakeri wrote:
Verified with KVM. The test case will not pass for KVM since the guest information needs to have emulator information without which the remote migration fails. The support to pass the emulator information via VirtualSystemMigrationSettingData is not yet available.
As a workaround for verification of the tc. ------------------------------------------- 1) create a KVM VM which has the emulator information outside the tc on the comman line. 2) comment out the setup_guest() call, also comment the undefine and destroy lines at the end of the tc. 3) specify the name of the guest create in test_dom before calling local_remote_migrate().
Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com>
This set looks good! I haven't had a chance to test on Xen yet. Also, if you are planning to include all of the migration types in one test, you'll want to change the test name from 06_remote_live_migration.py to something more generic. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

Kaitlin Rupert wrote:
Deepti B. Kalakeri wrote:
Verified with KVM. The test case will not pass for KVM since the guest information needs to have emulator information without which the remote migration fails. The support to pass the emulator information via VirtualSystemMigrationSettingData is not yet available.
As a workaround for verification of the tc. ------------------------------------------- 1) create a KVM VM which has the emulator information outside the tc on the comman line. 2) comment out the setup_guest() call, also comment the undefine and destroy lines at the end of the tc. 3) specify the name of the guest create in test_dom before calling local_remote_migrate().
Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com>
This set looks good! I haven't had a chance to test on Xen yet. Also, if you are planning to include all of the migration types in one test, you'll want to change the test name from 06_remote_live_migration.py to something more generic.
I would prefer to have different test cases for different types, otherwise tracking the issues would be more problematic, the test case will be lengthier and complex keeping the scenarios separate gives a ready to use tc for verifying regression for different migration types if any. Thoughts ?? -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik@linux.vnet.ibm.com

This set looks good! I haven't had a chance to test on Xen yet. Also, if you are planning to include all of the migration types in one test, you'll want to change the test name from 06_remote_live_migration.py to something more generic.
I would prefer to have different test cases for different types, otherwise tracking the issues would be more problematic, the test case will be lengthier and complex keeping the scenarios separate gives a ready to use tc for verifying regression for different migration types if any.
Thoughts ??
These are good arguments. I'm fine with either approach. The single test approach means there is less code duplication across multiple tests (because each test will basically be the same, right?). So it's less of a maintenance headache if things change later on. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

Kaitlin Rupert wrote:
This set looks good! I haven't had a chance to test on Xen yet. Also, if you are planning to include all of the migration types in one test, you'll want to change the test name from 06_remote_live_migration.py to something more generic.
I would prefer to have different test cases for different types, otherwise tracking the issues would be more problematic, the test case will be lengthier and complex keeping the scenarios separate gives a ready to use tc for verifying regression for different migration types if any.
Thoughts ??
These are good arguments. I'm fine with either approach. The single test approach means there is less code duplication across multiple tests (because each test will basically be the same, right?). So it's less of a maintenance headache if things change later on.
Since most of the code in the test cases is to do with guest defining/starting/destroying and then passing appropriate migration info I think these would not change much. Also, for the new tests I will see if I can include more scenarios in the same test case. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik@linux.vnet.ibm.com

Deepti B Kalakeri wrote:
Kaitlin Rupert wrote:
This set looks good! I haven't had a chance to test on Xen yet. Also, if you are planning to include all of the migration types in one test, you'll want to change the test name from 06_remote_live_migration.py to something more generic.
I would prefer to have different test cases for different types, otherwise tracking the issues would be more problematic, the test case will be lengthier and complex keeping the scenarios separate gives a ready to use tc for verifying regression for different migration types if any.
Thoughts ??
These are good arguments. I'm fine with either approach. The single test approach means there is less code duplication across multiple tests (because each test will basically be the same, right?). So it's less of a maintenance headache if things change later on.
Since most of the code in the test cases is to do with guest defining/starting/destroying and then passing appropriate migration info I think these would not change much. Also, for the new tests I will see if I can include more scenarios in the same test case.
This is fine by me =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (3)
-
Deepti B Kalakeri
-
Deepti B. Kalakeri
-
Kaitlin Rupert