Can't spawn instance anymore.. if ret == -1: raise libvirtError

Asked by Warik

Hi stackers!

Here is my problem, I am on Precise and I installed OpenStack with the packages (2012.1-0ubuntu2.1)
Everything used to work fine, until I wanted to reset the nova DB. I dumped the DB to be safe. Then I deleted nova DB, re-created it, nova-manage db sync to populate the DB and log into the dashboard. It all looked the same (what I mean by that is no issues are displayed), so I tried to launched an instance and here what happens:

2012-05-09 17:31:21 ERROR nova.compute.manager [req-cb16289e-b1d6-4e57-a2cf-6ab143a0bccc f75661ae18a14bfdb77cdd07bcc8500c 0765acf7a3334a249a42781a2b5da7e1] [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] Instance failed to spawn#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] Traceback (most recent call last):#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 592, in _spawn#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] self._legacy_nw_info(network_info), block_device_info)#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 114, in wrapped#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] return f(*args, **kw)#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py", line 922, in spawn#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] self._create_new_domain(xml)#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py", line 1575, in _create_new_domain#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] domain.createWithFlags(launch_flags)#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] File "/usr/lib/python2.7/dist-packages/libvirt.py", line 581, in createWithFlags#0122012-05-09 17:31:21 TRACE nova.compute.manager [instance: 4968ab2d-04b5-41ea-b324-7651b625e7b8] if ret == -1: raise libvirtError ('virDomainCreateWithFlags() faile

May 9 17:31:21 server 2012-05-09 17:31:21 ERROR nova.rpc.amqp [req-cb16289e-b1d6-4e57-a2cf-6ab143a0bccc f75661ae18a14bfdb77cdd07bcc8500c 0765acf7a3334a249a42781a2b5da7e1] Exception during message handling#0122012-05-09 17:31:21 TRACE nova.rpc.amqp Traceback (most recent call last):#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 252, in _process_data#0122012-05-09 17:31:21 TRACE nova.rpc.amqp rval = node_func(context=ctxt, **node_args)#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 114, in wrapped#0122012-05-09 17:31:21 TRACE nova.rpc.amqp return f(*args, **kw)#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 177, in decorated_function#0122012-05-09 17:31:21 TRACE nova.rpc.amqp sys.exc_info())#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__#0122012-05-09 17:31:21 TRACE nova.rpc.amqp self.gen.next()#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 171, in decorated_function#0122012-05-09 17:31:21 TRACE nova.rpc.amqp return function(self, context, instance_uuid, *args, **kwargs)#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 651, in run_instance#0122012-05-09 17:31:21 TRACE nova.rpc.amqp do_run_instance()#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 945, in inner#0122012-05-09 17:31:21 TRACE nova.rpc.amqp retval = f(*args, **kwargs)#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 650, in do_run_instance#0122012-05-09 17:31:21 TRACE nova.rpc.amqp self._run_instance(context, instance_uuid, **kwargs)#0122012-05-09 17:31:21 TRACE nova.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/compute/mana

May 9 17:31:22 server 2012-05-09 17:31:22 DEBUG nova.api.openstack.common [req-21e29313-d0d2-43ed-ac65-7a9c7aab700a f75661ae18a14bfdb77cdd07bcc8500c 0765acf7a3334a249a42781a2b5da7e1] Generated ERROR from vm_state=error task_state=spawning. from (pid=1181) status_from_state /usr/lib/python2.7/dist-packages/nova/api/openstack/common.py:96

I tried to look for : if ret == -1: raise libvirtError ('virDomainCreateWithFlags() faile in Google and on the Openstack forum but no luck..

Let me know if you can help me.
Thanks a lot

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Warik
Solved:
Last query:
Last reply:
Revision history for this message
Alex Nehaichik (nab) said :
#1

In my case problem were in /var/lib/nova/CA. You can remove it and delete/sync nova db again. FYI, this workaround is not for production use.

Revision history for this message
Warik (warik) said :
#2

Thanks Alex, that was the issue!