如何使用“NetworkNotFound”从nova-compute崩溃中恢复?

时间:2012-05-03 01:51:29

标签: ubuntu cloud openstack

我(尝试)在Ubuntu 12.04服务器上测试新的OpenStack Essex安装,截至本文已完全更新。当我启动我的第一个VM时,由于配置错误导致了一些网络问题,所以我删除了固定的IPv4网络定义。显然这是一个错误,因为尝试启动图像的nova-compute节点在守护程序启动时因“NetworkNotFound”错误而崩溃,可能是因为它无法找到我必须删除的错误配置的网络ID。我已经发布了“新星删除”来删除虚拟机,但它仍然显示“nova list ...”等。(我猜测因为nova-compute无法启动,所以无法检查删除损坏图像的队列。那么......如何让nova-compute再次启动,并删除VM的所有痕迹?

2012-05-02 15:46:02 TRACE nova Traceback (most recent call last):
2012-05-02 15:46:02 TRACE nova   File "/usr/bin/nova-compute", line 49, in <module>
2012-05-02 15:46:02 TRACE nova     service.wait()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/service.py", line 413, in wait
2012-05-02 15:46:02 TRACE nova     _launcher.wait()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/service.py", line 131, in wait
2012-05-02 15:46:02 TRACE nova     service.wait()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 166, in wait
2012-05-02 15:46:02 TRACE nova     return self._exit_event.wait()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/eventlet/event.py", line 116, in wait
2012-05-02 15:46:02 TRACE nova     return hubs.get_hub().switch()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 177, in switch
2012-05-02 15:46:02 TRACE nova     return self.greenlet.switch()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 192, in main
2012-05-02 15:46:02 TRACE nova     result = function(*args, **kwargs)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/service.py", line 101, in run_server
2012-05-02 15:46:02 TRACE nova     server.start()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/service.py", line 162, in start
2012-05-02 15:46:02 TRACE nova     self.manager.init_host()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 247, in init_host
2012-05-02 15:46:02 TRACE nova     self.reboot_instance(context, instance['uuid'])
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 114, in wrapped
2012-05-02 15:46:02 TRACE nova     return f(*args, **kw)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 153, in decorated_function
2012-05-02 15:46:02 TRACE nova     function(self, context, instance_uuid, *args, **kwargs)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 177, in decorated_function
2012-05-02 15:46:02 TRACE nova     sys.exc_info())
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
2012-05-02 15:46:02 TRACE nova     self.gen.next()
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 171, in decorated_function
2012-05-02 15:46:02 TRACE nova     return function(self, context, instance_uuid, *args, **kwargs)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 896, in reboot_instance
2012-05-02 15:46:02 TRACE nova     network_info = self._get_instance_nw_info(context, instance)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 313, in _get_instance_nw_info
2012-05-02 15:46:02 TRACE nova     instance)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/network/api.py", line 219, in get_instance_nw_info
2012-05-02 15:46:02 TRACE nova     'args': args})
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/rpc/__init__.py", line 68, in call
2012-05-02 15:46:02 TRACE nova     return _get_impl().call(context, topic, msg, timeout)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/rpc/impl_kombu.py", line 674, in call
2012-05-02 15:46:02 TRACE nova     return rpc_amqp.call(context, topic, msg, timeout, Connection.pool)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 338, in call
2012-05-02 15:46:02 TRACE nova     rv = list(rv)
2012-05-02 15:46:02 TRACE nova   File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 306, in __iter__
2012-05-02 15:46:02 TRACE nova     raise result
2012-05-02 15:46:02 TRACE nova RemoteError: Remote error: NetworkNotFound Network 3 could not be found.
2012-05-02 15:46:02 TRACE nova [u'Traceback (most recent call last):\n', u'  File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 252, in _process_data\n    rval = node_func(context=ctxt, **node_args)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/network/manager.py", line 258, in wrapped\n    return func(self, context, *args, **kwargs)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/network/manager.py", line 957, in get_instance_nw_info\n    network = self._get_network_by_id(context, vif[\'network_id\'])\n', u'  File "/usr/lib/python2.7/dist-packages/nova/network/manager.py", line 1733, in _get_network_by_id\n    network_id)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/network/manager.py", line 1549, in _get_network_by_id\n    return self.db.network_get(context, network_id)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/db/api.py", line 755, in network_get\n    return IMPL.network_get(context, network_id)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 120, in wrapper\n    return f(*args, **kwargs)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 1920, in network_get\n    raise exception.NetworkNotFound(network_id=network_id)\n', u'NetworkNotFound: Network 3 could not be found.\n'].

1 个答案:

答案 0 :(得分:0)

我的OpenStack部署遇到了类似的问题。解决方案非常简单:转到Nova数据库,在网络表中创建一个新网络,但手动设置id,在您的情况下为id = 3。 在此之后,您可以尝试再次删除该实例,它应该正确终止。 删除所有错误配置的实例后,再次从数据库中删除网络。