分享

OpenStack Domain not found的bug修复

nettman 发表于 2014-1-19 00:55:34 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 5657
本帖最后由 nettman 于 2014-1-19 00:57 编辑

1.错误日志:
  1. 2012-10-25 03:10:35 INFO nova.virt.libvirt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] [instance: fecb44a4-5094-465d-91e1-0c051cd271eb] Called setup_basic_filtering in nwfilter
  2. 2012-10-25 03:10:35 INFO nova.virt.libvirt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] [instance: fecb44a4-5094-465d-91e1-0c051cd271eb] Ensuring static filters
  3. 2012-10-25 03:10:56 INFO nova.virt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] Using cidr u’0.0.0.0/0′
  4. 2012-10-25 03:10:56 INFO nova.virt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] Using fw_rules: ['-m state --state INVALID -j DROP', '-m state --state ESTABLISHED,RELATED -j ACCEPT', '-j $provider', u'-s 10.0.0.1 -p udp --sport 67 --dport 68 -j ACCEPT', u'-s 10.0.0.0/24 -j ACCEPT', u'-j ACCEPT -p tcp -m multiport --dports 1:65535 -s 0.0.0.0/0']
  5. 2012-10-25 03:10:56 INFO nova.virt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] Using cidr u’0.0.0.0/0′
  6. 2012-10-25 03:10:56 INFO nova.virt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] Using fw_rules: ['-m state --state INVALID -j DROP', '-m state --state ESTABLISHED,RELATED -j ACCEPT', '-j $provider', u'-s 10.0.0.1 -p udp --sport 67 --dport 68 -j ACCEPT', u'-s 10.0.0.0/24 -j ACCEPT', u'-j ACCEPT -p tcp -m multiport --dports 1:65535 -s 0.0.0.0/0', u'-j ACCEPT -p udp -m multiport --dports 1:65535 -s 0.0.0.0/0']
  7. 2012-10-25 03:10:56 INFO nova.virt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] Using cidr u’0.0.0.0/0′
  8. 2012-10-25 03:10:56 INFO nova.virt.firewall [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] Using fw_rules: ['-m state --state INVALID -j DROP', '-m state --state ESTABLISHED,RELATED -j ACCEPT', '-j $provider', u'-s 10.0.0.1 -p udp --sport 67 --dport 68 -j ACCEPT', u'-s 10.0.0.0/24 -j ACCEPT', u'-j ACCEPT -p tcp -m multiport --dports 1:65535 -s 0.0.0.0/0', u'-j ACCEPT -p udp -m multiport --dports 1:65535 -s 0.0.0.0/0', u'-j ACCEPT -p icmp -s 0.0.0.0/0']
  9. 2012-10-25 03:11:02 INFO nova.compute.manager [req-e805b920-1164-48d5-a9f7-0f97f7f69ba9 None None] [instance: db03b184-b44b-4305-986f-845295ed07e1] Rebooting instance after nova-compute restart.
  10. 2012-10-25 03:11:03 INFO nova.virt.libvirt.connection [-] [instance: fecb44a4-5094-465d-91e1-0c051cd271eb] Instance rebooted successfully.
  11. 2012-10-25 03:11:03 CRITICAL nova [-] Domain not found: no domain with matching name ‘instance-00000010′
复制代码
2.编辑libvirt/connection.py
/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py
  1. reboot happens, as the guest OS cannot ignore this action.
  2. """
  3. - virt_dom = self._conn.lookupByName(instance['name'])
  4. + # NOTE: In case of no domain up
  5. + try:
  6. + virt_dom = self._conn.lookupByName(instance['name'])
  7. + except Exception, e:
  8. + virt_dom = None
  9. if not xml:
  10. - xml = virt_dom.XMLDesc(0)
  11. + if virt_dom:
  12. + xml = virt_dom.XMLDesc(0)
  13. + else:
  14. + xml = self.to_xml(instance, network_info)
  15. - self.destroy(instance, network_info, cleanup=False)
  16. + if virt_dom:
  17. + self.destroy(instance, network_info, cleanup=False)
  18. self.plug_vifs(instance, network_info)
  19. self.firewall_driver.setup_basic_filtering(instance, network_info)
  20. self.firewall_driver.prepare_instance_filter(instance, network_info)
复制代码
3.最后请切换到/path/to/instances/
cd instance-000000XXX
virsh define libvirt.xml

4.reboot instance
加微信w3aboutyun,可拉入技术爱好者群

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条