# they will be able to reach 169.254.169.254 through a router.
# This option requires enable_isolated_metadata = True
# enable_metadata_network = False
-
-# The Quantum DHCP agent manager.
-# dhcp_agent_manager = quantum.agent.dhcp_agent.DhcpAgent
# Show debugging output in log (sets DEBUG log level output)
# debug = True
-# The Quantum L3 Agent manager
-# l3_agent_manager = quantum.agent.l3_agent.L3NATAgent
-
# L3 requires that an interface driver be set. Choose the one that best
# matches your plugin.
help=_("Allows for serving metadata requests from a "
"dedicate network. Requires "
"enable isolated_metadata = True ")),
- cfg.StrOpt('dhcp_agent_manager',
- default='quantum.agent.dhcp_agent.DhcpAgent',
- help=_("The Quantum DHCP agent manager.")),
]
def __init__(self, host=None):
'agent_type': constants.AGENT_TYPE_DHCP}
report_interval = cfg.CONF.AGENT.report_interval
if report_interval:
- heartbeat = loopingcall.LoopingCall(self._report_state)
- heartbeat.start(interval=report_interval)
+ self.heartbeat = loopingcall.LoopingCall(self._report_state)
+ self.heartbeat.start(interval=report_interval)
def _report_state(self):
try:
ctx = context.get_admin_context_without_session()
self.state_rpc.report_state(ctx,
self.agent_state)
+ except AttributeError:
+ # This means the server does not support report_state
+ LOG.warn(_("Quantum server does not support state report."
+ " State report for this agent will be disabled."))
+ self.heartbeat.stop()
+ self.run()
+ return
except Exception:
LOG.exception(_("Failed reporting state!"))
return
server = quantum_service.Service.create(
binary='quantum-dhcp-agent',
topic=topics.DHCP_AGENT,
- report_interval=cfg.CONF.AGENT.report_interval)
+ report_interval=cfg.CONF.AGENT.report_interval,
+ manager='quantum.agent.dhcp_agent.DhcpAgentWithStateReport')
service.launch(server).wait()
cfg.StrOpt('gateway_external_network_id', default='',
help=_("UUID of external network for routers implemented "
"by the agents.")),
- cfg.StrOpt('l3_agent_manager',
- default='quantum.agent.l3_agent.L3NATAgent',
- help=_("The Quantum L3 Agent manager.")),
]
def __init__(self, host, conf=None):
'agent_type': l3_constants.AGENT_TYPE_L3}
report_interval = cfg.CONF.AGENT.report_interval
if report_interval:
- heartbeat = loopingcall.LoopingCall(self._report_state)
- heartbeat.start(interval=report_interval)
+ self.heartbeat = loopingcall.LoopingCall(self._report_state)
+ self.heartbeat.start(interval=report_interval)
def _report_state(self):
num_ex_gw_ports = 0
self.state_rpc.report_state(self.context,
self.agent_state)
self.agent_state.pop('start_flag', None)
+ except AttributeError:
+ # This means the server does not support report_state
+ LOG.warn(_("Quantum server does not support state report."
+ " State report for this agent will be disabled."))
+ self.heartbeat.stop()
+ return
except Exception:
LOG.exception(_("Failed reporting state!"))
server = quantum_service.Service.create(
binary='quantum-l3-agent',
topic=topics.L3_AGENT,
- report_interval=cfg.CONF.AGENT.report_interval)
+ report_interval=cfg.CONF.AGENT.report_interval,
+ manager='quantum.agent.l3_agent.L3NATAgentWithStateReport')
service.launch(server).wait()
topic=topic, default_version=self.BASE_RPC_API_VERSION)
def report_state(self, context, agent_state):
- return self.cast(context,
+ return self.call(context,
self.make_msg('report_state',
agent_state={'agent_state':
agent_state}),