xenapi's check_can_live_migrate_destination should not return None

Bug #1158603 reported by Senhua Huang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Hans Lindgren

Bug Description

check_can_live_migration_destination should return a dictionary, which is used by check_can_live_migration_source in nova/compute/manager.py (line 3002 and 3023). But nova/virt/xenapi/vomps.py (line 1668) returns None if the block_migration is set to false. This will raise a NoneType exception.

Tags: xenapi
Revision history for this message
Chuck Short (zulcss) wrote :

Can attach the traceback please?

Changed in nova:
status: New → Incomplete
Revision history for this message
Senhua Huang (senhuang) wrote :

Hi Chuck,

I don't have a traceback. But here is my analysis.
nova.compute.manager.ComputeManager's check_can_live_migrate_destination method will first call nova.virt.driver.check_can_live_migrate_destination method, and store the returned data in dest_check_data. For xenapi, if the block_migrate is set to be false, this method call will return None to dest_check_data. Then, it will call nova.compute.rpcapi.check_can_live_migrate_source method. If this method call invokes nova.compute.manager.ComputeManager's check_can_live_migrate_source, it will pase None as the dest_check_data to check_can_live_migrate_source. On line 3023 of nova/compute/manager.py, this check_can_live_migrate_source will try the following:
        dest_check_data['is_volume_backed'] = is_volume_backed
If my understanding of the API call flow is correct, this will raise a NoneType exception if dest_check_data is None. But I could be totally wrong.. Please let me know. Thanks!

Changed in nova:
status: Incomplete → New
Revision history for this message
Hans Lindgren (hanlind) wrote :

The same was reported for Hyper-V a while ago.
See https://bugs.launchpad.net/nova/+bug/1129091.

This should be fixed in ComputeManager instead of requiring drivers to return an empty dict.

Changed in nova:
assignee: nobody → Hans Lindgren (hanlind)
importance: Undecided → High
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/25284

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/25284
Committed: http://github.com/openstack/nova/commit/56252f4d7e8fbc481b6382a657dac659b6582fe0
Submitter: Jenkins
Branch: master

commit 56252f4d7e8fbc481b6382a657dac659b6582fe0
Author: Hans Lindgren <email address hidden>
Date: Mon Mar 25 15:53:12 2013 +0100

    NoneType exception thrown if driver live-migration check returns None

    XenAPI driver live-migration checks must return dicts as required by
    the virt api interface.

    Resolves bug 1158603.

    Change-Id: I0db364a17e3069b0b7e3f19030afc35283edecfb

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.