get_memory_mb_total in nova/virt/libvirt/connection.py not working for Xen/libvirt

Bug #1019993 reported by Christian Berendt
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

After upgrading from 2012.1 to 2012.1.1 nova-compute with libvirt/Xen is not working because of a static method using self.

satsuma:~ # nova-compute
2012-07-02 10:50:20 AUDIT nova.service [-] Starting compute node (version 2012.1.1-LOCALBRANCH:LOCALREVISION)
2012-07-02 10:50:21 WARNING nova.utils [req-b67d9038-0ceb-46e5-9fb3-108ff512f9ff None None] /usr/lib64/python2.6/site-packages/sqlalchemy/pool.py:639: SADeprecationWarning: The 'listeners' argument to Pool (and create_engine()) is deprecated. Use event.listen().
  Pool.__init__(self, creator, **kw)

2012-07-02 10:50:21 WARNING nova.utils [req-b67d9038-0ceb-46e5-9fb3-108ff512f9ff None None] /usr/lib64/python2.6/site-packages/sqlalchemy/pool.py:145: SADeprecationWarning: Pool.add_listener is deprecated. Use event.listen()
  self.add_listener(l)

Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/eventlet/hubs/hub.py", line 336, in fire_timers
    timer()
  File "/usr/lib64/python2.6/site-packages/eventlet/hubs/timer.py", line 56, in __call__
    cb(*args, **kw)
  File "/usr/lib64/python2.6/site-packages/eventlet/greenthread.py", line 192, in main
    result = function(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/nova/service.py", line 101, in run_server
    server.start()
  File "/usr/lib64/python2.6/site-packages/nova/service.py", line 174, in start
    self.manager.update_available_resource(ctxt)
  File "/usr/lib64/python2.6/site-packages/nova/compute/manager.py", line 2415, in update_available_resource
    self.driver.update_available_resource(context, self.host)
  File "/usr/lib64/python2.6/site-packages/nova/virt/libvirt/connection.py", line 1941, in update_available_resource
    'memory_mb': self.get_memory_mb_total(),
  File "/usr/lib64/python2.6/site-packages/nova/virt/libvirt/connection.py", line 1718, in get_memory_mb_total
    meminfo = self._conn.getInfo()[1]
NameError: global name 'self' is not defined

Revision history for this message
Christian Berendt (berendt) wrote :

can be fixed for 2012.1.1 with this patch, i'll check if bug is available in trunk, too, and commit the patch if trunk is affected.

--- nova/virt/libvirt/connection.py.orig 2012-07-02 10:51:10.000000000 +0200
+++ nova/virt/libvirt/connection.py 2012-07-02 10:51:57.000000000 +0200
@@ -1703,8 +1703,7 @@
                        "This error can be safely ignored for now."))
             return 0

- @staticmethod
- def get_memory_mb_total():
+ def get_memory_mb_total(self):
         """Get the total memory size(MB) of physical computer.

         :returns: the total amount of memory(MB).

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.