CentOS 7 虚拟机创建失败解决(3)

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]  File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4312, in _create_domain

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]    domain.createWithFlags(launch_flags)

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]  File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 183, in doit

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]    result = proxy_call(self._autowrap, f, *args, **kwargs)

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]  File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 141, in proxy_call

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]    rv = execute(f, *args, **kwargs)

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]  File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 122, in execute

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]    six.reraise(c, e, tb)

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]  File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 80, in tworker

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]    rv = meth(*args, **kwargs)

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 996, in createWithFlags

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]    if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c] libvirtError: internal error: referenced filter 'no-mac-spoofing' is missing

2015-08-10 22:06:57.469 707 TRACE nova.compute.manager [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c]

2015-08-10 22:06:57.472 707 INFO nova.compute.manager [req-c4498aca-20cc-4950-8484-2ea9da8670c9 a9ba5e68a0db48fdbf5ab664f6f25ca0 a506166979e641dd9f44a25351515014 - - -] [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c] Terminating instance

2015-08-10 22:06:57.480 707 INFO nova.virt.libvirt.driver [-] [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c] Instance destroyed successfully.

2015-08-10 22:06:57.715 707 INFO nova.virt.libvirt.driver [req-5028a584-b5fb-4260-b3f8-cb145d6a2088 - - - - -] [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c] Deleting instance files /var/lib/nova/instances/e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c_del

2015-08-10 22:06:57.716 707 INFO nova.virt.libvirt.driver [req-5028a584-b5fb-4260-b3f8-cb145d6a2088 - - - - -] [instance: e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c] Deletion of /var/lib/nova/instances/e8b32dc2-4dd1-4956-9cab-a6c6c0d5655c_del complete

根据日志记录,发现错误关键字:

libvirtError: internal error: referenced filter 'no-mac-spoofing' is missing

经过上网搜索以后,发现问题与libvirt的nwfilter功能相关。

查看计算节点libvirt 相关的nwfilter信息

root@localhost ~]# virsh nwfilter-list

UUID                                  Name

------------------------------------------------------------------

4e221669-6d5a-43a9-b5eb-98dd70e3a157  nova-allow-dhcp-server

0f103d9e-20fb-4533-a3b5-edcaad5c2137  nova-base

ad6f6e51-5981-49d0-892a-3409f1da58cf  nova-instance-instance-00000005-fa163e28d503

fda64645-7a74-4b44-9949-c4c126672466  nova-instance-instance-00000006-fa163edda044

c7a96409-7c16-4e18-bdef-29980aaa8c8f  nova-instance-instance-00000007-fa163eb3fb99

500220cc-3738-4076-a71f-79aa9dc59802  nova-no-nd-reflection

de0e1a3a-94df-4331-8cd4-e5a8e143e6d8  nova-nodhcp

dab8b452-098e-4019-a5d2-b053d46d0091  nova-vpn

发现nwfilter缺少no-mac-spoofing信息。

解决:安装nwfilter软件包

yum install libvirt-daemon-config-nwfilter

软件包安装后,重启libvirtd服务:

service libvirtd restart

再次查看libvirt的network filter

[root@localhost ~]# virsh nwfilter-list

UUID                                  Name

------------------------------------------------------------------

7d26d9b6-1c05-4875-9d3c-d4ddc3e7157c  allow-arp

5fd0997d-978a-42cb-bb55-83b195a1ee02  allow-dhcp

26412da7-4cc1-47ad-a8bd-1ece211ac451  allow-dhcp-server

cf070932-efdd-4647-b517-e31b08d5b27d  allow-incoming-ipv4

59937e6f-d676-49c0-98c8-28313f54fbc7  allow-ipv4

3f558bed-627e-4ae7-b245-7662476673c9  clean-traffic

6350f1ca-d24a-4097-abee-04d04456d0bc  no-arp-ip-spoofing

29337093-9041-4765-bd54-b0225e3d373c  no-arp-mac-spoofing

8c508085-3af2-4355-84d9-7c0ed9baa97d  no-arp-spoofing

6dd04710-0d3f-48ff-ace0-04ff4c540dac  no-ip-multicast

b1f0c2ce-320e-41fd-9985-53c3fa27d226  no-ip-spoofing

8cdd6e3d-35e2-4958-87e6-aa17ee04ea7e  no-mac-broadcast

5aab9582-e0ac-4eb8-9b6f-e4a20eced81e  no-mac-spoofing

19bb746c-2062-4128-a2d1-93e3177d967c  no-other-l2-traffic

afe58c32-67e0-4f15-a31d-bb722344b89f  no-other-rarp-traffic

4e221669-6d5a-43a9-b5eb-98dd70e3a157  nova-allow-dhcp-server

0f103d9e-20fb-4533-a3b5-edcaad5c2137  nova-base

ad6f6e51-5981-49d0-892a-3409f1da58cf  nova-instance-instance-00000005-fa163e28d503

fda64645-7a74-4b44-9949-c4c126672466  nova-instance-instance-00000006-fa163edda044

c7a96409-7c16-4e18-bdef-29980aaa8c8f  nova-instance-instance-00000007-fa163eb3fb99

500220cc-3738-4076-a71f-79aa9dc59802  nova-no-nd-reflection

de0e1a3a-94df-4331-8cd4-e5a8e143e6d8  nova-nodhcp

dab8b452-098e-4019-a5d2-b053d46d0091  nova-vpn

b81a5aa6-0045-49ec-b5fb-d5ae62245ef9  qemu-announce-self

2dbff157-d88d-42fd-ae93-052efdd27af7  qemu-announce-self-rarp

此时创建虚拟机即可成功。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/16037.html