一、现象描述
openstack平台中创建虚拟机后,虚拟机在web页面中显示获取到了ip,但是打开虚拟机控制台后查看网络状态,虚拟机没有ip地址,下图为故障截图:
二、分析思路
1、查看neutron服务状态,确保DHCP服务是否正常运行
[root@ren3 ~]# neutron agent-list neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. +----------+------------+------+-------------------+-------+----------------+-----------+ | id | agent_type | host | availability_zone | alive | admin_state_up | binary | +----------+------------+------+-------------------+-------+----------------+-----------+ | 8279aaae | Open | ren3 | | :-) | True | neutron-o | | -eb89-4c | vSwitch | | | | | penvswitc | | 71-bbae- | agent | | | | | h-agent | | 009971a6 | | | | | | | | 97e3 | | | | | | | | 954aaea4 | L3 agent | ren3 | nova | :-) | True | neutron-l | | -b4c3-4d | | | | | | 3-agent | | bc-b104- | | | | | | | | 76917908 | | | | | | | | 7cd0 | | | | | | | | a1b7aee2 | Metadata | ren3 | | :-) | True | neutron- | | -2881-4d | agent | | | | | metadata- | | 85-b119- | | | | | | agent | | 1bf8195f | | | | | | | | 66fc | | | | | | | | e67163c1 | DHCP agent | ren3 | nova | :-) | True | neutron- | | -8513-4f | | | | | | dhcp- | | d7-be6a- | | | | | | agent | | ae8e0acf | | | | | | | | 83ce | | | | | | | | ed288124 | Open | ren4 | | :-) | True | neutron-o | | -f0ab- | vSwitch | | | | | penvswitc | | 4a63 | agent | | | | | h-agent | | -aa4e-a2 | | | | | | | | 04051ef8 | | | | | | | | b8 | | | | | | | +----------+------------+------+-------------------+-------+----------------+-----------+
2、查看dnsmasq进程是否正常
[root@ren3 ~]# ps aux |grep dnsmasq nobody 24061 0.0 0.0 53900 920 ? S 08:48 0:00 dnsmasq --no-hosts --no-resolv --strict-order --except-interface=lo --pid-file=/var/lib/neutron/dhcp/266e6738-3092-4929-801d-de8cea1266b5/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/266e6738-3092-4929-801d-de8cea1266b5/host --addn-hosts=/var/lib/neutron/dhcp/266e6738-3092-4929-801d-de8cea1266b5/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/266e6738-3092-4929-801d-de8cea1266b5/opts --dhcp-leasefile=/var/lib/neutron/dhcp/266e6738-3092-4929-801d-de8cea1266b5/leases --dhcp-match=set:ipxe,175 --bind-interfaces --interface=tap2119082d-5b --dhcp-range=set:tag0,192.168.11.0,static,86400s --dhcp-option-force=option:mtu,1450 --dhcp-lease-max=256 --conf-file= --domain=openstacklocal nobody 24064 0.0 0.0 53900 864 ? S 08:48 0:00 dnsmasq --no-hosts --no-resolv --strict-order --except-interface=lo --pid-file=/var/lib/neutron/dhcp/5717a706-54d9-4f03-8936-e8a27e8aaa3a/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/5717a706-54d9-4f03-8936-e8a27e8aaa3a/host --addn-hosts=/var/lib/neutron/dhcp/5717a706-54d9-4f03-8936-e8a27e8aaa3a/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/5717a706-54d9-4f03-8936-e8a27e8aaa3a/opts --dhcp-leasefile=/var/lib/neutron/dhcp/5717a706-54d9-4f03-8936-e8a27e8aaa3a/leases --dhcp-match=set:ipxe,175 --bind-interfaces --interface=tap6ceaf383-ff --dhcp-range=set:tag0,12.12.12.0,static,86400s --dhcp-option-force=option:mtu,1450 --dhcp-lease-max=256 --conf-file= --domain=openstacklocal root 30097 0.0 0.0 112728 976 pts/0 R+ 14:26 0:00 grep --color=auto dnsmasq
3、检查ovs网桥中的br-int集成网桥是否有tap设备连接到了dhcp-agent的namespace上