Ejemplo n.º 1
0
 def _setup_nsx_dhcp_metadata(self):
     self._check_services_requirements()
     nsx_svc.register_dhcp_opts(cfg)
     nsx_svc.register_metadata_opts(cfg)
     lsnmanager.register_lsn_opts(cfg)
     lsn_manager = lsnmanager.PersistentLsnManager(self.safe_reference)
     self.lsn_manager = lsn_manager
     if cfg.CONF.NSX.agent_mode == config.AgentModes.AGENTLESS:
         notifier = nsx_svc.DhcpAgentNotifyAPI(self.safe_reference,
                                               lsn_manager)
         self.agent_notifiers[const.AGENT_TYPE_DHCP] = notifier
         # In agentless mode, ports whose owner is DHCP need to
         # be special cased; so add it to the list of special
         # owners list
         if const.DEVICE_OWNER_DHCP not in self.port_special_owners:
             self.port_special_owners.append(const.DEVICE_OWNER_DHCP)
     elif cfg.CONF.NSX.agent_mode == config.AgentModes.COMBINED:
         # This becomes ineffective, as all new networks creations
         # are handled by Logical Services Nodes in NSX
         cfg.CONF.set_override('network_auto_schedule', False)
         LOG.warning(_LW('network_auto_schedule has been disabled'))
         notifier = combined.DhcpAgentNotifyAPI(self.safe_reference,
                                                lsn_manager)
         self.supported_extension_aliases.append(lsn.EXT_ALIAS)
         # Add the capability to migrate dhcp and metadata services over
         self.migration_manager = (migration.MigrationManager(
             self.safe_reference, lsn_manager, notifier))
     return notifier
Ejemplo n.º 2
0
 def __init__(self, plugin, manager):
     super(DhcpAgentNotifyAPI, self).__init__(topic=topics.DHCP_AGENT)
     self.agentless_notifier = nsx_svc.DhcpAgentNotifyAPI(plugin, manager)