reboot instance catches exception: libvirtError: Domain not found

Bug #1026029 reported by Xiaolin Zhang
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

I was running into a exception when trying to reboot(automatically) all vm instances after the compute node failover(nova version is Diablo);

this code piece maybe related:
nova/virt/libvirt/connection.py:501
    virt_dom = self._conn.lookupByName(instance['name'])

on the newly up host, there is no virt Domain, the above lookupByName would definitely failed and throw an exception;
to put this calling in a `try except' may be better.

detailed trace:

2012-07-18 15:55:09,422 CRITICAL nova [-] Domain not found: no domain with matching name 'instance-0000007a'
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/usr/bin/nova-compute", line 49, in <module>
(nova): TRACE: service.wait()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/service.py", line 357, in wait
(nova): TRACE: _launcher.wait()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/service.py", line 107, in wait
(nova): TRACE: service.wait()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 166, in wait
(nova): TRACE: return self._exit_event.wait()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/eventlet/event.py", line 116, in wait
(nova): TRACE: return hubs.get_hub().switch()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 177, in switch
(nova): TRACE: return self.greenlet.switch()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 192, in main
(nova): TRACE: result = function(*args, **kwargs)
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/service.py", line 77, in run_server
(nova): TRACE: server.start()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/service.py", line 137, in start
(nova): TRACE: self.manager.init_host()
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 176, in init_host
(nova): TRACE: self.reboot_instance(context, instance['id'])
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 100, in wrapped
(nova): TRACE: return f(*args, **kw)
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 118, in decorated_function
(nova): TRACE: function(self, context, instance_id, *args, **kwargs)
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 636, in reboot_instance
(nova): TRACE: self.driver.reboot(instance_ref, network_info)
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 100, in wrapped
(nova): TRACE: return f(*args, **kw)
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py", line 501, in reboot
(nova): TRACE: virt_dom = self._conn.lookupByName(instance['name'])
(nova): TRACE: File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1870, in lookupByName
(nova): TRACE: if ret is None:raise libvirtError('virDomainLookupByName() failed', conn=self)
(nova): TRACE: libvirtError: Domain not found: no domain with matching name 'instance-0000007a'

description: updated
Revision history for this message
Yaguang Tang (heut2008) wrote :

I don't excetly know whether this version is still be maintanced,but I strongly suggest you update to esssex version.there are still
many bugs in diablo .

Revision history for this message
Xiaolin Zhang (zhangxiaolins) wrote :

As I going through the source code with essex version as well as the master branch,
I found this problem is still there, both _soft_reboot and _hard_reboot are using none try-except
lookupByName.

Actually, I have made a change in code to deal with `Domain not running' kind of thing in case of
virt_dom is None, and rebuild xml from db; and then all vms are rebooted successfully no matter
there is virt_dom or not.

I wonder if anyone else has encountered the same error as me.

Revision history for this message
Xiaolin Zhang (zhangxiaolins) wrote :

I made a simple patch and fixed my problem.

Changed in nova:
assignee: nobody → Xiaolin Zhang (zhangxiaolins)
status: New → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote :

Looks like you're not working on that anymore. Please set back to InProgress and reassign to you if you're working on proposing a change for merging.

Changed in nova:
assignee: Xiaolin Zhang (zhangxiaolins) → nobody
status: In Progress → Triaged
Revision history for this message
wangpan (hzwangpan) wrote :

I think this bug was fixed in Folsom, so change it to fix released.

Changed in nova:
status: Triaged → Fix Released
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.