Need set compute driver's flag capabilities correctly

Bug #1261636 reported by ChangBo Guo(gcb)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
ChangBo Guo(gcb)

Bug Description

1.Back ground:
Class ComputeDriver, base of all compute drivers, has dictionary capabilities
to indicate if the compute driver implements some functions. The 'supports_recreate'
flag needs the driver to support the evacuate operation. The 'has_imagecache' flag
needs the driver to implement the 'manage_image_cache' method.[1] Compute manger will
check this with capabilities['has_imagecache'] [2]or capabilities['supports_recreate']
[3]directly.

2. Problems:
1)Docker does not currently support these two functions, so the capabilities flags
should not be set.[4]
2)Baremetal only set 'has_imagecache', there is code path leading KeyError.
Need set capabilities explicitly to avoid this.[5]

3.Solution:
Set or unset compute driver's capabilities explicitly.

[1] https://github.com/openstack/nova/blob/master/nova/virt/driver.py#L128
[2] https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L5168
[3] https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2142
[4] https://github.com/openstack/nova/blob/master/nova/virt/docker/driver.py#L62
[5] https://github.com/openstack/nova/blob/master/nova/virt/baremetal/driver.py#L114

Changed in nova:
status: New → In Progress
assignee: nobody → ChangBo Guo (guochbo)
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/59258
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6a932aebbc68989485d4867920a6a6bbf536f6c6
Submitter: Jenkins
Branch: master

commit 6a932aebbc68989485d4867920a6a6bbf536f6c6
Author: Chang Bo Guo <email address hidden>
Date: Sat Nov 30 01:04:06 2013 -0800

    Remove docker's unsupported capabilities

    The 'supports_recreate' flag needs the driver to support the evacuate
    operation. The 'has_imagecache' flag needs the driver to implement the
    'manage_image_cache' method. Docker does not currently support these
    two functions, so the capabilities flags should not be set.

    Partial-Bug: #1261636

    Change-Id: I191d0d8cd35aece52462c0477f2d89897bb762c1

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 2014.1
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.