When DHCP agent is used with ML2 plugin that doesn't yet support extra_dhcp_opt extension, it fails to serve IP adresses.
Here is the log:
2013-09-02 17:51:14.232 9079 DEBUG neutron.agent.linux.dhcp [-] Unable to access /opt/stack/data/neutron/dhcp/6b7f26d9-a1a4-44f9-b63c-1001f5f0d0ad/pid _get_value_from_conf_file /opt/stack/neutron/neutron/agent/linux/dhcp.py:217 2013-09-02 17:51:14.233 9079 ERROR neutron.agent.dhcp_agent [-] Unable to enable dhcp. 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent Traceback (most recent call last): 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent File "/opt/stack/neutron/neutron/agent/dhcp_agent.py", line 126, in call_driver 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent getattr(driver, action)(**action_kwargs) 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 165, in enable 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent self.restart() 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 122, in restart 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent self.enable() 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 168, in enable 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent self.spawn_process() 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 319, in spawn_process 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent '--dhcp-hostsfile=%s' % self._output_hosts_file(), 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 401, in _output_hosts_file 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent if port.extra_dhcp_opts: 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent AttributeError: 'DictModel' object has no attribute 'extra_dhcp_opts' 2013-09-02 17:51:14.233 9079 TRACE neutron.agent.dhcp_agent
Changing "if port.extra_dhcp_opts:" to "if hasattr(port, 'extra_dhcp_opts') and port.extra_dhcp_opts:" in the following places seems to fix the issue.
https://github.com/openstack/neutron/blob/master/neutron/agent/linux/dhcp.py#L401 https://github.com/openstack/neutron/blob/master/neutron/agent/linux/dhcp.py#L466
When DHCP agent is used with ML2 plugin that doesn't yet support extra_dhcp_opt extension, it fails to serve IP adresses.
Here is the log:
2013-09-02 17:51:14.232 9079 DEBUG neutron. agent.linux. dhcp [-] Unable to access /opt/stack/ data/neutron/ dhcp/6b7f26d9- a1a4-44f9- b63c-1001f5f0d0 ad/pid _get_value_ from_conf_ file /opt/stack/ neutron/ neutron/ agent/linux/ dhcp.py: 217 agent.dhcp_ agent [-] Unable to enable dhcp. agent.dhcp_ agent Traceback (most recent call last): agent.dhcp_ agent File "/opt/stack/ neutron/ neutron/ agent/dhcp_ agent.py" , line 126, in call_driver agent.dhcp_ agent getattr(driver, action) (**action_ kwargs) agent.dhcp_ agent File "/opt/stack/ neutron/ neutron/ agent/linux/ dhcp.py" , line 165, in enable agent.dhcp_ agent self.restart() agent.dhcp_ agent File "/opt/stack/ neutron/ neutron/ agent/linux/ dhcp.py" , line 122, in restart agent.dhcp_ agent self.enable() agent.dhcp_ agent File "/opt/stack/ neutron/ neutron/ agent/linux/ dhcp.py" , line 168, in enable agent.dhcp_ agent self.spawn_ process( ) agent.dhcp_ agent File "/opt/stack/ neutron/ neutron/ agent/linux/ dhcp.py" , line 319, in spawn_process agent.dhcp_ agent '--dhcp- hostsfile= %s' % self._output_ hosts_file( ), agent.dhcp_ agent File "/opt/stack/ neutron/ neutron/ agent/linux/ dhcp.py" , line 401, in _output_hosts_file agent.dhcp_ agent if port.extra_ dhcp_opts: agent.dhcp_ agent AttributeError: 'DictModel' object has no attribute 'extra_dhcp_opts' agent.dhcp_ agent
2013-09-02 17:51:14.233 9079 ERROR neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
2013-09-02 17:51:14.233 9079 TRACE neutron.
Changing "if port.extra_ dhcp_opts: " to "if hasattr(port, 'extra_dhcp_opts') and port.extra_ dhcp_opts: " in the following places seems to fix the issue.
https:/ /github. com/openstack/ neutron/ blob/master/ neutron/ agent/linux/ dhcp.py# L401 /github. com/openstack/ neutron/ blob/master/ neutron/ agent/linux/ dhcp.py# L466
https:/