2016-12-06 11:11:22.593 1505 INFO nova.scheduler.client.report [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] Compute_service record updated for ('compute1', 'compute1')
2016-12-06 11:11:22.880 1505 INFO nova.virt.libvirt.driver [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] Creating image
2016-12-06 11:11:26.564 1505 ERROR nova.compute.manager [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] Instance failed to spawn
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] Traceback (most recent call last):
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2461, in _build_resources
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] yield resources
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2333, in _build_and_run_instance
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] block_device_info=block_device_info)
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 2382, in spawn
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] write_to_disk=True)
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4183, in _get_guest_xml
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] context)
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4054, in _get_guest_config
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] flavor, virt_type)
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/vif.py", line 374, in get_config
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] _("Unexpected vif_type=%s") % vif_type)
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] NovaException: Unexpected vif_type=binding_failed
2016-12-06 11:11:26.564 1505 TRACE nova.compute.manager [instance: feb05de2-184e-4b62-91d3-04c8229ce01e]
2016-12-06 11:11:26.566 1505 INFO nova.compute.manager [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] Terminating instance
2016-12-06 11:11:26.570 1505 INFO nova.virt.libvirt.driver [-] [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] During wait destroy, instance disappeared.
2016-12-06 11:11:26.583 1505 INFO nova.virt.libvirt.driver [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] Deleting instance files /var/lib/nova/instances/feb05de2-184e-4b62-91d3-04c8229ce01e_del
2016-12-06 11:11:26.584 1505 INFO nova.virt.libvirt.driver [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] [instance: feb05de2-184e-4b62-91d3-04c8229ce01e] Deletion of /var/lib/nova/instances/feb05de2-184e-4b62-91d3-04c8229ce01e_del complete
2016-12-06 11:11:26.771 1505 INFO nova.scheduler.client.report [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] Compute_service record updated for ('compute1', 'compute1')
2016-12-06 11:11:26.805 1505 ERROR nova.network.neutronv2.api [req-43897fe4-800f-436a-a13b-1a0098c8a185 9af8ba41636b4480beeeaa40ba827867 ee6f7bc35fc5497cbb6d3c7e6589d0b9 - - -] Unable to clear device ID for port 'None'
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api Traceback (most recent call last):
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 366, in _unbind_ports
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api port_client.update_port(port_id, port_req_body)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 102, in with_params
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api ret = self.function(instance, *args, **kwargs)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 549, in update_port
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api return self.put(self.port_path % (port), body=body)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 302, in put
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api headers=headers, params=params)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 270, in retry_request
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api headers=headers, params=params)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 211, in do_request
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api self._handle_fault_response(status_code, replybody)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 185, in _handle_fault_response
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api exception_handler_v20(status_code, des_error_body)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 83, in exception_handler_v20
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api message=message)
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api NeutronClientException: 404 Not Found
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api The resource could not be found.
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api
2016-12-06 11:11:26.805 1505 TRACE nova.network.neutronv2.api
【问题分析】
此问题出现根本是因为在compute节点创建的vm的时候不能创建qbr导致的,是由于qbr不存在,生成的tap端口无法链接到qbr上,所以导致vif_type=binding_failed。
此问题出现间接是因为配置文件(ml2)没有配置正确
qbra2942116-dc 为vm连接的linux bridge。如果没有这个bridge vm的网卡就不能连接,因此vm的traffic就不能出去,就会报错
]# ip addr
.... 14: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether d4:85:64:4e:4b:bc brd ff:ff:ff:ff:ff:ff
inet 10.68.125.240/24 scope global br-ex
valid_lft forever preferred_lft forever
inet6 fe80::383d:cff:fee2:3642/64 scope link
valid_lft forever preferred_lft forever
24: qbra2942116-dc: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 8e:60:b9:5c:01:19 brd ff:ff:ff:ff:ff:ff
inet6 fe80::8c60:b9ff:fe5c:119/64 scope link
valid_lft forever preferred_lft forever
25: qvoa2942116-dc: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP qlen 1000
link/ether 6e:4d:49:4d:b6:91 brd ff:ff:ff:ff:ff:ff
inet6 fe80::6c4d:49ff:fe4d:b691/64 scope link
valid_lft forever preferred_lft forever
26: qvba2942116-dc: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master qbra2942116-dc state UP qlen 1000
link/ether 8e:60:b9:5c:01:19 brd ff:ff:ff:ff:ff:ff
inet6 fe80::8c60:b9ff:fe5c:119/64 scope link
valid_lft forever preferred_lft forever
27: tapa2942116-dc: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master qbra2942116-dc state UNKNOWN qlen 500
link/ether fe:16:3e:f6:01:0a brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc16:3eff:fef6:10a/64 scope link
valid_lft forever preferred_lft forever
===============================================
由于自己的环境配置的vlan,所以在配置ml2的时候最好不配置flat_networks.
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types = vlan
mechanism_drivers = openvswitch
[ml2_type_flat] //不用配置
[ml2_type_vlan]
network_vlan_ranges = physnet1:100:130 //physnet1是指的网络别名,指的是所有tenant网络的别名,范围在100-130之间
[ml2_type_gre]
[ml2_type_vxlan]
[securitygroup]
enable_security_group = True
enable_ipset = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[ovs]
bridge_mappings = physnet1:br-ex //映射上面tenant网络vlan范围内的到网桥br-ex ,因为br-ex添加了物理网卡,traffic就出去了。。。
[agent]
以上配置为出现问题恢复后的配置详细信息供参考