docker driver reports hypervisor version in wrong format

Bug #1253960 reported by Michael Gliwinski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Matt Riedemann

Bug Description

devstack, `nova --version` reports 2.15.0.81
VIRT_DRIVER=docker
database: PostgreSQL

when starting nova-compute I'm getting an exception:

2013-11-20 11:41:27.413 DEBUG nova.openstack.common.lockutils [-] Semaphore / lock released "update_available_resource" from (pid=15320) inner /opt/stack/nova/nova/openstack/common/lockutils.py:251
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/queue.py", line 107, in switch
    self.greenlet.switch(value)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 194, in main
    result = function(*args, **kwargs)
  File "/opt/stack/nova/nova/openstack/common/service.py", line 448, in run_service
    service.start()
  File "/opt/stack/nova/nova/service.py", line 164, in start
    self.manager.pre_start_hook()
  File "/opt/stack/nova/nova/compute/manager.py", line 788, in pre_start_hook
    self.update_available_resource(nova.context.get_admin_context())
  File "/opt/stack/nova/nova/compute/manager.py", line 5065, in update_available_resource
    rt.update_available_resource(context)
  File "/opt/stack/nova/nova/openstack/common/lockutils.py", line 248, in inner
    return f(*args, **kwargs)
  File "/opt/stack/nova/nova/compute/resource_tracker.py", line 326, in update_available_resource
    self._sync_compute_node(context, resources)
  File "/opt/stack/nova/nova/compute/resource_tracker.py", line 349, in _sync_compute_node
    self._create(context, resources)
  File "/opt/stack/nova/nova/compute/resource_tracker.py", line 365, in _create
    values)
  File "/opt/stack/nova/nova/conductor/api.py", line 236, in compute_node_create
    return self._manager.compute_node_create(context, values)
  File "/opt/stack/nova/nova/conductor/rpcapi.py", line 356, in compute_node_create
    return cctxt.call(context, 'compute_node_create', values=values)
  File "/opt/stack/nova/nova/rpcclient.py", line 85, in call
    return self._invoke(self.proxy.call, ctxt, method, **kwargs)
  File "/opt/stack/nova/nova/rpcclient.py", line 63, in _invoke
    return cast_or_call(ctxt, msg, **self.kwargs)
  File "/opt/stack/nova/nova/openstack/common/rpc/proxy.py", line 126, in call
    result = rpc.call(context, real_topic, msg, timeout)
  File "/opt/stack/nova/nova/openstack/common/rpc/__init__.py", line 139, in call
    return _get_impl().call(CONF, context, topic, msg, timeout)
  File "/opt/stack/nova/nova/openstack/common/rpc/impl_kombu.py", line 816, in call
    rpc_amqp.get_connection_pool(conf, Connection))
  File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 574, in call
    rv = list(rv)
  File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 539, in __iter__
    raise result
RemoteError: Remote error: DBError (DataError) invalid input syntax for integer: "1.0"
LINE 1: ...L, NULL, 0, 5, 1, 11953, 54, 0, 512, 0, 'docker', '1.0', 'hg...
                                                             ^

(should be in fixed-width font, the circumflex accent points to '1.0')

This appears to be the same issue as #1195139 but with docker driver. Also related to https://blueprints.launchpad.net/nova/+spec/save-hypervisor-version-as-string

nova-compute starts up OK after applying a similar change as for #1195139 :

--- nova/virt/docker/driver.py.orig
+++ nova/virt/docker/driver.py
@@ -159,7 +159,7 @@
             'local_gb_used': disk['used'] / unit.Gi,
             'disk_available_least': disk['available'] / unit.Gi,
             'hypervisor_type': 'docker',
- 'hypervisor_version': '1.0',
+ 'hypervisor_version': utils.convert_version_to_int('1.0'),
             'hypervisor_hostname': self._nodename,
             'cpu_info': '?',
             'supported_instances': jsonutils.dumps([

Tags: powervm docker
Matt Riedemann (mriedem)
tags: added: docker
Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :

So if the powervm driver doesn't die, this also impacts the powervm driver.

tags: added: powervm
Revision history for this message
Matt Riedemann (mriedem) wrote :

Not that anyone is using it in production, but the fake virt driver in nova has this issue also.

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
importance: Undecided → High
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/58110

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/58110
Committed: http://github.com/openstack/nova/commit/1588de2714a0f28a0da219f319d6a7ac6c1f9bab
Submitter: Jenkins
Branch: master

commit 1588de2714a0f28a0da219f319d6a7ac6c1f9bab
Author: Matt Riedemann <email address hidden>
Date: Sat Nov 23 14:00:48 2013 -0800

    docker: return hypervisor_version as an int rather than a string

    The compute_nodes.hypervisor_version type in the database is an integer
    so the docker driver needs to return the hypervisor_version as an
    integer rather than a string.

    Also adds the missing unit test for get_available_resource.

    Closes-Bug: #1253960

    Change-Id: I4e2ac13f9203b54e71f1f5cd8e15311921dd85c5

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