[Libvirt-cim] [PATCH 4 of 4] [TEST][RFC] Added new tc to verify remote live migration

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Mar 12 23:34:34 UTC 2009


Deepti B. Kalakeri wrote:
> # HG changeset patch
> # User Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
> # Date 1236853868 25200
> # Node ID 89db4ac2378c90fd89845dd09836bfb39cc6e6ed
> # Parent  caae383c83ec70e6cb6de9b6e5ccf6d2fcbecb45
> [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.

I haven't verified this on Xen yet.

> +def main():
> +    options = main.options
> +    virt = options.virt
> +    s_sysname = os.environ['SRC_IP']

You already know the source IP from options.ip - do you need to set an 
environment variable for it?

> +    t_sysname = os.environ['TARGET_IP']

Shouldn't you be able to the target ip from main.options the same way we 
get the source IP?

> +    if options.virt == 'KVM' and t_sysname == s_sysname:
> +        logger.info("Libvirt does not support local migratoin for KVM")
> +        return SKIP
> +
> +    status = FAIL
> +    test_dom = 'VM_frm_' + socket.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
> +        vsms_cn = get_vs_mig_setting_class(virt) 
> +        vsmservice = vsms_cn(s_sysname, virt)
> +        status = local_remote_migrate(vsmservice, s_sysname, t_sysname, virt,
> +                                      remote_migrate=1, guest_name=test_dom)

Why not have local_remote_migrate() get its own 
VirtualSystemMigrationService object?  There's no need to pass it in 
here because it's not used later on..

Or are you planning to have future tests use it for something?

> +    except Exception,details:
> +        logger.error("Exception details :%s", details)
> +        cxml.cim_destroy(s_sysname)
> +        cxml.undefine(s_sysname)
> +        return FAIL
> +
> +    if status == PASS:
> +        # Remote Migration Successful, clean the domain on target machine
> +        cxml.cim_destroy(t_sysname)
> +        cxml.undefine(t_sysname)
> +    else:
> +        # Remote Migration not Successful, clean the domain on src machine
> +        cxml.cim_destroy(s_sysname)
> +        cxml.undefine(s_sysname)
> +

Technically, if the migration fails partway through migrating a guest, 
it's possible for the guest to end up on both systems.  So it'd be good 
to check both the source and the target to see if the guest exists (and 
remove it if it does).


-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list