Ironic: Driver should validate the node's properties

Bug #1447642 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

The Ironic nova driver will look at the Ironic node to fetch the amount of CPUs, memory, disk etc... But it doesn't validate any of this properties making it fail horribly if the node is misconfigured. It should be more resilient to failures.

Traceback:

Apr 21 11:11:33 nova-compute[32119]: Traceback (most recent call last):
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/eventlet/queue.py", line 117, in switch
Apr 21 11:11:33 nova-compute[32119]: self.greenlet.switch(value)
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main
Apr 21 11:11:33 nova-compute[32119]: result = function(*args, **kwargs)
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/nova/openstack/common/service.py", line 497, in run_service
Apr 21 11:11:33 nova-compute[32119]: service.start()
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/nova/service.py", line 183, in start
Apr 21 11:11:33 nova-compute[32119]: self.manager.pre_start_hook()
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1250, in pre_start_hook
Apr 21 11:11:33 nova-compute[32119]: self.update_available_resource(nova.context.get_admin_context())
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 6197, in update_available_resource
Apr 21 11:11:33 nova-compute[32119]: rt.update_available_resource(context)
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 376, in update_available_resource
Apr 21 11:11:33 nova-compute[32119]: resources = self.driver.get_available_resource(self.nodename)
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/nova/virt/ironic/driver.py", line 535, in get_available_resource
Apr 21 11:11:33 nova-compute[32119]: return self._node_resource(node)
Apr 21 11:11:33 nova-compute[32119]: File "/usr/lib/python2.7/site-packages/nova/virt/ironic/driver.py", line 228, in _node_resource
Apr 21 11:11:33 nova-compute[32119]: vcpus = int(node.properties.get('cpus', 0))
Apr 21 11:11:33 nova-compute[32119]: ValueError: invalid literal for int() with base 10: 'None'

+------------------------+-------------------------------------------------------------------------+
| Property | Value |
+------------------------+-------------------------------------------------------------------------+
...
| properties | {u'memory_mb': u'None', u'cpu_arch': None, u'local_gb': u'None', |
| | u'cpus': u'None', u'capabilities': u'boot_option:local'} |
...

Tags: ironic
Changed in nova:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
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/176890

Changed in nova:
status: New → In Progress
Changed in nova:
status: In Progress → Confirmed
status: Confirmed → In Progress
Michael Still (mikal)
tags: added: ironic
aeva black (tenbrae)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/176890
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3b7cedb33445624788950146997dafca7e57638b
Submitter: Jenkins
Branch: master

commit 3b7cedb33445624788950146997dafca7e57638b
Author: Lucas Alvares Gomes <email address hidden>
Date: Thu Apr 23 16:22:09 2015 +0100

    Ironic: Parse and validate Node's properties

    This patch makes the Ironic driver more resilient to failures when
    parsing the Node's properties.

    Closes-Bug: #1447642
    Change-Id: Id31374a39e850b7ae922558f52e8bc658447c7fd

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

Other bug subscribers