instance cannot get ip automatically under FlatDHCP mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I installed the folsom-2012.2 nova/glance/
except for that the instance can't get their private fixed IP via DHCP protocol under FlatDHCP network mode.
After I used vnc to get access to vm instance and use command `ip addr add %FIXED-
the ip address for instance manually, the network of the instance became to work.
(the image of the instances is debian-
Then I tried to use tcpdump to capture the udp packets on br100(which nova-network is using), found that the dnsmasq(which acted as dhcp server)
didn't respond to the DHCPDISCOVER requests send by dhcp client inside the instance.
I also found similar problem reported by others, but in this case my server's kernel version is 3.2
DHCP broken for Openstack Nova instances since kernel v3.3
https:/
Bellow are debug infos, can anyone give some help? thx
kernel version
hzzhanggy % uname -a
Linux DEV6 3.2.0-3-amd64 #1 SMP Mon Jul 23 02:45:17 UTC 2012 x86_64 GNU/Linux
dnsmasq version
hzzhanggy % sudo aptitude show dnsmasq
Package: dnsmasq
State: installed
Automatically installed: no
Version: 2.63-4
Priority: optional
Section: net
Maintainer: Simon Kelley <email address hidden>
Architecture: all
Uncompressed Size: 39.9 k
Depends: netbase, dnsmasq-base (>= 2.63-4)
Suggests: resolvconf
Conflicts: resolvconf (< 1.15)
Description: Small caching DNS proxy and DHCP/TFTP server
Dnsmasq is a lightweight, easy to configure, DNS forwarder and DHCP server. It is designed to provide DNS and optionally, DHCP, to a small network. It can serve the names of local machines which are
not in the global DNS. The DHCP server integrates with the DNS server and allows machines with DHCP-allocated addresses to appear in the DNS with names configured either in each host or in a central
configuration file. Dnsmasq supports static and dynamic DHCP leases and BOOTP/TFTP for network booting of diskless machines.
network interface
hzzhanggy % ip a
1: lo: <LOOPBACK,
inet 127.0.0.1/8 scope host lo
inet 169.254.169.254/32 scope link lo
inet6 ::1/128 scope host
2: eth0: <BROADCAST,
link/ether 5c:f3:fc:98:97:d8 brd ff:ff:ff:ff:ff:ff
inet xxx.xxx.xxx.6/24 brd xxx.xxx.xxx.255 scope global eth0
inet6 fe80::5ef3:
3: eth1: <BROADCAST,
link/ether 5c:f3:fc:98:97:da brd ff:ff:ff:ff:ff:ff
inet6 fe80::5ef3:
4: usb0: <BROADCAST,
link/ether 5e:f3:fc:9c:97:db brd ff:ff:ff:ff:ff:ff
78: br101: <BROADCAST,
link/ether 2a:bc:e5:2f:4b:4c brd ff:ff:ff:ff:ff:ff
inet 10.120.33.1/25 brd 10.120.33.127 scope global br101
81: br100: <BROADCAST,
link/ether 5c:f3:fc:98:97:da brd ff:ff:ff:ff:ff:ff
inet 10.120.33.1/25 brd 10.120.33.127 scope global br100
inet6 fe80::5ef3:
102: vnet1: <BROADCAST,
link/ether fe:16:3e:06:c4:71 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc16:
103: vnet0: <BROADCAST,
link/ether fe:16:3e:08:1d:0d brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc16:
dnsmasq process
hzzhanggy % ps aux|grep dnsmasq
nobody 24867 0.0 0.0 21360 952 ? SN 17:49 0:00 /usr/sbin/dnsmasq --strict-order --bind-interfaces --conf-file= --domain=novalocal --pid-file=
root 24868 0.0 0.0 21332 420 ? SN 17:49 0:00 /usr/sbin/dnsmasq --strict-order --bind-interfaces --conf-file= --domain=novalocal --pid-file=
the dnamasq listening port
hzzhanggy % sudo netstat -anpu|grep dns
udp 0 0 10.120.33.1:53 0.0.0.0:* 24867/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 24867/dnsmasq
the content of dhcp-hostsfile
hzzhanggy % cat ~/lib/nova/
fa:
fa:
run dhclient in instance with mac "fa:16:
just DHCPDISCOVER packets captured.
root # dhclient eth0
hzzhanggy % sudo tcpdump -v -i br100 udp
22:01:03.347651 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
22:01:05.351754 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
22:01:05.443905 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
22:01:06.346870 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
trace iptables, the dhcp request matched an ACCEPT rule
hzzhanggy % dmesg|grep "fa:16:
[1481865.
[1481865.
[1481865.
[1481865.
[1481865.
[1481865.
[1481865.
[1481865.
[1481865.
[1481865.
hzzhanggy % sudo iptables-save|grep nova-network-INPUT
:nova-
-A INPUT -j nova-network-INPUT
-A nova-network-INPUT -i br100 -p udp -m udp --dport 67 -j ACCEPT
-A nova-network-INPUT -i br100 -p tcp -m tcp --dport 67 -j ACCEPT
-A nova-network-INPUT -i br100 -p udp -m udp --dport 53 -j ACCEPT
-A nova-network-INPUT -i br100 -p tcp -m tcp --dport 53 -j ACCEPT
strace dnsmasq, found that the dnsmasq wait at the "select" operation, seemded not data reveiced
hzzhanggy % sudo strace -p 24867
time(NULL) = 1351256984
fcntl(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
recvmsg(4, {msg_name(
recvmsg(4, {msg_name(
fcntl(4, F_SETFL, O_RDWR) = 0
select(8, [3 4 5 6 7], [], [], NULL
lsof result of dnsmasq
hzzhanggy % sudo lsof -p 24867
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dnsmasq 24867 nobody cwd DIR 8,1 4096 2 /
dnsmasq 24867 nobody rtd DIR 8,1 4096 2 /
dnsmasq 24867 nobody txt REG 8,1 253592 81988 /usr/sbin/dnsmasq
dnsmasq 24867 nobody mem REG 8,1 14768 123450 /lib/x86_
dnsmasq 24867 nobody mem REG 8,1 31744 123456 /lib/x86_
dnsmasq 24867 nobody mem REG 8,1 131107 123454 /lib/x86_
dnsmasq 24867 nobody mem REG 8,1 1583120 123435 /lib/x86_
dnsmasq 24867 nobody mem REG 8,1 211376 123191 /usr/lib/
dnsmasq 24867 nobody mem REG 8,1 24712 82068 /usr/lib/
dnsmasq 24867 nobody mem REG 8,1 96520 123284 /usr/lib/
dnsmasq 24867 nobody mem REG 8,1 286488 123894 /lib/x86_
dnsmasq 24867 nobody mem REG 8,1 136936 123458 /lib/x86_
dnsmasq 24867 nobody mem REG 8,6 217016 851971 /var/cache/
dnsmasq 24867 nobody mem REG 8,6 217016 851970 /var/cache/
dnsmasq 24867 nobody mem REG 8,1 1534672 92791 /usr/lib/
dnsmasq 24867 nobody mem REG 8,1 26066 123643 /usr/lib/
dnsmasq 24867 nobody 0u CHR 1,3 0t0 1028 /dev/null
dnsmasq 24867 nobody 1u CHR 1,3 0t0 1028 /dev/null
dnsmasq 24867 nobody 2u CHR 1,3 0t0 1028 /dev/null
dnsmasq 24867 nobody 3u IPv4 387210551 0t0 UDP *:bootps
dnsmasq 24867 nobody 4u netlink 0t0 387210552 ROUTE
dnsmasq 24867 nobody 5u IPv4 387210563 0t0 UDP 10.120.33.1:domain
dnsmasq 24867 nobody 6u IPv4 387210564 0t0 TCP 10.120.33.1:domain (LISTEN)
dnsmasq 24867 nobody 7r FIFO 0,8 0t0 387208289 pipe
dnsmasq 24867 nobody 8w FIFO 0,8 0t0 387208289 pipe
dnsmasq 24867 nobody 9u unix 0xffff880665f44c40 0t0 387210157 socket
dnsmasq 24867 nobody 12w FIFO 0,8 0t0 387210158 pipe
but when I kill the dnsmasq process and use nc to listen on udp 67 port, it definately could received something.
hzzhanggy % _ nc -l -u -p 67|xxd
0000000: 0101 0600 c12f 2d0f 0014 0000 0000 0000 ...../-.........
0000010: 0000 0000 0000 0000 0000 0000 fa16 3e75 ..............>u
0000020: 38c3 0000 0000 0000 0000 0000 0000 0000 8...............
0000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000e0: 0000 0000 0000 0000 0000 0000 6382 5363 ............c.Sc
00000f0: 3501 0137 0d01 1c02 030f 0677 0c2c 2f1a 5..7.......w.,/.
0000100: 792a ff00 0000 0000 0000 0000 0000 0000 y*..............
0000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
Changed in nova: | |
status: | Incomplete → Invalid |
Any chance your guest images are configured to change the mac address of the primary ethernet adapter via udev or similar? What image are you trying and where did you get it? Does CirrOS work?