Bug 927349

Summary: dnsmasq seems to run the dhcp-script only on startup.
Product: Red Hat OpenStack Reporter: David Hill <dhill>
Component: openstack-novaAssignee: Brent Eagles <beagles>
Status: CLOSED WORKSFORME QA Contact: Ami Jeain <ajeain>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: beagles, dallan, ndipanov, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-13 19:53:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 947775    
Attachments:
Description Flags
nova-dhcpbridge
none
Sample testing script none

Description David Hill 2013-03-25 17:45:01 UTC
Description of problem:
dnsmasq seems to run the dhcp-script only on startup but never when a lease is added or removed.

Version-Release number of selected component (if applicable):
2.48-13.el6

How reproducible:
Everytime

Steps to Reproduce:
1. Create a new instance in openstack
2. The leased column in the fixed_ip table will not get updated.
3. Delete the new instance in openstack
  
Actual results:
leased=0


Expected results:
leased=1


Additional info:
dnsmasq-2.62-1 solves the problem...

Comment 1 Tomáš Hozza 2013-03-26 07:05:21 UTC
(In reply to comment #0)
> Steps to Reproduce:
> 1. Create a new instance in openstack
> 2. The leased column in the fixed_ip table will not get updated.
> 3. Delete the new instance in openstack

Please attach options and configuration files that dnsmasq is started with.
As I'm not familiar with setting up openstack I don't want to spend a lot
of time with openstack but rather with fixing dnsmasq. Please also attach
scripts that are supposed to run on startup/when lease is added/when lease
is removed.

Thank you.

Comment 2 David Hill 2013-03-27 17:41:10 UTC
/usr/sbin/dnsmasq --strict-order --bind-interfaces --conf-file=/etc/dnsmasq.conf --domain=novalocal --pid-file=/var/lib/nova/networks/nova-br100.pid --listen-address=172.0.0.1 --except-interface=lo --dhcp-range=set:'private',172.0.0.2,static,255.255.248.0,600s --dhcp-lease-max=2048 --dhcp-hostsfile=/var/lib/nova/networks/nova-br100.conf --dhcp-script=/usr/bin/nova-dhcpbridge --leasefile-ro

Comment 3 David Hill 2013-03-27 17:41:40 UTC
Created attachment 717182 [details]
nova-dhcpbridge

Comment 4 Tomáš Hozza 2013-04-04 09:28:46 UTC
Created attachment 731497 [details]
Sample testing script

Comment 5 Tomáš Hozza 2013-04-04 09:50:45 UTC
I tested dnsmasq-2.48-13.el6 with my simple testing script (the attached one) on RHEL-6.4. I got the following output:

[root@rhel-64-virtual ~]# dnsmasq -d --strict-order --bind-interfaces --conf-file=/etc/dnsmasq.conf --domain=novalocal --listen-address=192.168.133.2 --except-interface=lo --dhcp-range=set:'private',192.168.133.3,static,255.255.255.0,600s --dhcp-lease-max=251 --dhcp-script=/root/script.sh --leasefile-ro --dhcp-hostsfile=/root/hosts.conf
dnsmasq: started, version 2.48 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus no-I18N DHCP TFTP "--bind-interfaces with SO_BINDTODEVICE"
dnsmasq-dhcp: DHCP, static leases only on 192.168.133.3, lease time 10m
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 192.168.122.1#53
dnsmasq: read /etc/hosts - 2 addresses
dnsmasq: read /root/hosts.conf
dnsmasq-dhcp: DHCPDISCOVER(eth2) 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPOFFER(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPREQUEST(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPACK(eth2) 192.168.133.10 52:54:00:91:cf:62 
SCRIPT CALLED WITH PARAMETERS: add 52:54:00:91:cf:62 192.168.133.10 
dnsmasq-dhcp: DHCPDISCOVER(eth2) 52:54:00:38:7e:6c 
dnsmasq-dhcp: DHCPOFFER(eth2) 192.168.133.20 52:54:00:38:7e:6c 
dnsmasq-dhcp: DHCPREQUEST(eth2) 192.168.133.20 52:54:00:38:7e:6c 
dnsmasq-dhcp: DHCPACK(eth2) 192.168.133.20 52:54:00:38:7e:6c 
SCRIPT CALLED WITH PARAMETERS: add 52:54:00:38:7e:6c 192.168.133.20 
dnsmasq-dhcp: DHCPRELEASE(eth2) 192.168.133.20 52:54:00:38:7e:6c 
SCRIPT CALLED WITH PARAMETERS: del 52:54:00:38:7e:6c 192.168.133.20 
dnsmasq-dhcp: DHCPREQUEST(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPACK(eth2) 192.168.133.10 52:54:00:91:cf:62 
SCRIPT CALLED WITH PARAMETERS: old 52:54:00:91:cf:62 192.168.133.10 
dnsmasq-dhcp: DHCPDISCOVER(eth2) 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPOFFER(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPREQUEST(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPACK(eth2) 192.168.133.10 52:54:00:91:cf:62 
SCRIPT CALLED WITH PARAMETERS: old 52:54:00:91:cf:62 192.168.133.10 
dnsmasq-dhcp: DHCPREQUEST(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPACK(eth2) 192.168.133.10 52:54:00:91:cf:62 
SCRIPT CALLED WITH PARAMETERS: old 52:54:00:91:cf:62 192.168.133.10 
dnsmasq-dhcp: DHCPDISCOVER(eth2) 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPOFFER(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPREQUEST(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPACK(eth2) 192.168.133.10 52:54:00:91:cf:62 
SCRIPT CALLED WITH PARAMETERS: old 52:54:00:91:cf:62 192.168.133.10 
dnsmasq-dhcp: DHCPREQUEST(eth2) 192.168.133.10 52:54:00:91:cf:62 
dnsmasq-dhcp: DHCPACK(eth2) 192.168.133.10 52:54:00:91:cf:62 
SCRIPT CALLED WITH PARAMETERS: old 52:54:00:91:cf:62 192.168.133.10


From my point of view dnsmasq is working properly. Changing Product to Red Hat OpenStack.

Comment 7 David Hill 2013-04-04 10:41:22 UTC
For some reasons, it seems to run the script only once when starting dnsmasq.
I've tried replacing the openstack nova-dhcpbridge script by a shell script (like in your test) and it was called only one at startup and then, nothing more happened.

Comment 8 Brent Eagles 2013-05-13 19:02:21 UTC
As this pretty much works for everybody else, it would seem that there may be something going on with your environment. What does "nova show" on the instance you created show? Is there any unusual output in any of the log files related to the leased address?

Comment 9 David Hill 2013-05-13 19:08:25 UTC
Well, since we're using 2.62 instead of 2.48 it's working fine... also, it appears that you may be right and that the lab we're using has some weird bugs ... but I've just looked at a freshly updated node in our production environment and I see DHCPRELEASE messages !

For some reasons puppet didn't update the package on that node and it's still using 2.48-13 !

I guess you can close this bug report.

Thanks.