def __init__(self, conf, controllertype): super(OpenFlowController, self).__init__(conf, controllertype) self.cfg = conf self.controllertype = controllertype self.ctx = context.get_admin_context() self.hostname = utils.get_hostname() self.sync_active_state = False self.sync_all = True self.l3_app = None self.heartbeat = None self.open_flow_hand = None
def __init__(self, host=None): if host is None: host = neutron_utils.get_hostname() super(ApicTopologyService, self).__init__(host=host) self.apic_manager = ma.APICMechanismDriver.get_apic_manager(False) self.peers = {} self.conf = cfg.CONF.ml2_cisco_apic self.conn = None self.invalid_peers = [] self.dispatcher = None self.state = None self.state_agent = None self.topic = arpc.TOPIC_APIC_SERVICE
def __init__(self, host=None): if host is None: host = neutron_utils.get_hostname() super(ApicTopologyAgent, self).__init__(host=host) self.conf = cfg.CONF.ml2_cisco_apic self.count_current = 0 self.count_force_send = AGENT_FORCE_UPDATE_COUNT self.interfaces = {} self.lldpcmd = None self.peers = {} self.port_desc_re = map(re.compile, ACI_PORT_DESCR_FORMATS) self.service_agent = ApicTopologyServiceNotifierApi() self.state = None self.state_agent = None self.topic = TOPIC_APIC_SERVICE self.uplink_ports = [] self.invalid_peers = []
cfg.IntOpt('max_dns_nameservers', default=5, help=_("Maximum number of DNS nameservers")), cfg.IntOpt('max_subnet_host_routes', default=20, help=_("Maximum number of host routes per subnet")), cfg.IntOpt('max_fixed_ips_per_port', default=5, help=_("Maximum number of fixed ips per port")), cfg.IntOpt('dhcp_lease_duration', default=86400, deprecated_name='dhcp_lease_time', help=_("DHCP lease duration (in seconds). Use -1 to tell " "dnsmasq to use infinite lease times.")), cfg.BoolOpt('dhcp_agent_notification', default=True, help=_("Allow sending resource operation" " notification to DHCP agent")), cfg.BoolOpt('allow_overlapping_ips', default=False, help=_("Allow overlapping IP support in Neutron")), cfg.StrOpt('host', default=utils.get_hostname(), help=_("Hostname to be used by the neutron server, agents and" "services running on this machine. All the agents and " "services running on this machine must use the same " "host value.")), cfg.BoolOpt('force_gateway_on_subnet', default=True, help=_("Ensure that configured gateway is on subnet. " "For IPv6, validate only if gateway is not a link " "local address. Deprecated, to be removed during the " "K release, at which point the check will be " "mandatory.")), cfg.BoolOpt('notify_nova_on_port_status_changes', default=True, help=_("Send notification to nova when port status changes")), cfg.BoolOpt('notify_nova_on_port_data_changes', default=True, help=_("Send notification to nova when port data (fixed_ips/" "floatingip) changes so nova can update its cache.")),
help=_("DHCP lease duration (in seconds). Use -1 to tell " "dnsmasq to use infinite lease times.")), cfg.StrOpt('dns_domain', default='openstacklocal', help=_('Domain to use for building the hostnames')), cfg.StrOpt('external_dns_driver', help=_('Driver for external DNS integration.')), cfg.BoolOpt('dhcp_agent_notification', default=True, help=_("Allow sending resource operation" " notification to DHCP agent")), cfg.BoolOpt('allow_overlapping_ips', default=False, help=_("Allow overlapping IP support in Neutron. " "Attention: the following parameter MUST be set to " "False if Neutron is being used in conjunction with " "Nova security groups.")), cfg.StrOpt('host', default=utils.get_hostname(), sample_default='example.domain', help=_("Hostname to be used by the Neutron server, agents and " "services running on this machine. All the agents and " "services running on this machine must use the same " "host value.")), cfg.BoolOpt('notify_nova_on_port_status_changes', default=True, help=_("Send notification to nova when port status changes")), cfg.BoolOpt('notify_nova_on_port_data_changes', default=True, help=_("Send notification to nova when port data (fixed_ips/" "floatingip) changes so nova can update its cache.")), cfg.IntOpt('send_events_interval', default=2, help=_('Number of seconds between sending events to nova if ' 'there are any events to send.')), cfg.BoolOpt('advertise_mtu', default=True, deprecated_for_removal=True,
cfg.IntOpt('max_fixed_ips_per_port', default=5, help=_("Maximum number of fixed ips per port")), cfg.IntOpt('dhcp_lease_duration', default=86400, deprecated_name='dhcp_lease_time', help=_("DHCP lease duration")), cfg.BoolOpt('dhcp_agent_notification', default=True, help=_("Allow sending resource operation" " notification to DHCP agent")), cfg.BoolOpt('allow_overlapping_ips', default=False, help=_("Allow overlapping IP support in Neutron")), cfg.StrOpt('host', default=utils.get_hostname(), help=_("The hostname Neutron is running on")), cfg.BoolOpt('force_gateway_on_subnet', default=False, help=_("Ensure that configured gateway is on subnet")), cfg.BoolOpt('notify_nova_on_port_status_changes', default=True, help=_("Send notification to nova when port status changes")), cfg.BoolOpt('notify_nova_on_port_data_changes', default=True, help=_("Send notification to nova when port data (fixed_ips/" "floatingip) changes so nova can update its cache.")), cfg.StrOpt('nova_url', default='http://127.0.0.1:8774', help=_('URL for connection to nova')), cfg.StrOpt('nova_admin_username',
cfg.StrOpt('server_auth', default=None, secret=True, help=_("The username and password for authenticating against " " the BigSwitch or Floodlight controller.")), cfg.BoolOpt('server_ssl', default=False, help=_("If True, Use SSL when connecting to the BigSwitch or " "Floodlight controller.")), cfg.BoolOpt('sync_data', default=False, help=_("Sync data on connect")), cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), cfg.StrOpt('neutron_id', default='neutron-' + utils.get_hostname(), deprecated_name='quantum_id', help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), ] router_opts = [ cfg.MultiStrOpt('tenant_default_router_rule', default=['*:any:any:permit'], help=_("The default router rules installed in new tenant " "routers. Repeat the config option for each rule. " "Format is <tenant>:<source>:<destination>:<action>" " Use an * to specify default for all tenants.")), cfg.IntOpt('max_router_rules',
help=_("Sync data on connect")), cfg.BoolOpt('auto_sync_on_failure', default=True, help=_("If neutron fails to create a resource because " "the backend controller doesn't know of a dependency, " "automatically trigger a full data synchronization " "to the controller.")), cfg.IntOpt('consistency_interval', default=60, help=_("Time between verifications that the backend controller " "database is consistent with Neutron")), cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), cfg.IntOpt('thread_pool_size', default=4, help=_("Maximum number of threads to spawn to handle large " "volumes of port creations.")), cfg.StrOpt('neutron_id', default='neutron-' + utils.get_hostname(), deprecated_name='quantum_id', help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), ] router_opts = [ cfg.MultiStrOpt('tenant_default_router_rule', default=['*:any:any:permit'], help=_("The default router rules installed in new tenant " "routers. Repeat the config option for each rule. " "Format is <tenant>:<source>:<destination>:<action>" " Use an * to specify default for all tenants.")), cfg.IntOpt('max_router_rules', default=200, help=_("Maximum number of router rules")), ]
help=_("The username and password for authenticating against " " the BigSwitch or Floodlight controller."), ), cfg.BoolOpt( "server_ssl", default=False, help=_("If True, Use SSL when connecting to the BigSwitch or " "Floodlight controller."), ), cfg.BoolOpt("sync_data", default=False, help=_("Sync data on connect")), cfg.IntOpt( "server_timeout", default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete."), ), cfg.StrOpt( "neutron_id", default="neutron-" + utils.get_hostname(), deprecated_name="quantum_id", help=_("User defined identifier for this Neutron deployment"), ), cfg.BoolOpt( "add_meta_server_route", default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM"), ), ] cfg.CONF.register_opts(restproxy_opts, "RESTPROXY") router_opts = [ cfg.MultiStrOpt(
"The maximum number of items returned in a single " "response, value was 'infinite' or negative integer " "means no limit" ), ), cfg.IntOpt("max_dns_nameservers", default=5, help=_("Maximum number of DNS nameservers")), cfg.IntOpt("max_subnet_host_routes", default=20, help=_("Maximum number of host routes per subnet")), cfg.IntOpt("max_fixed_ips_per_port", default=5, help=_("Maximum number of fixed ips per port")), cfg.IntOpt("dhcp_lease_duration", default=86400, deprecated_name="dhcp_lease_time", help=_("DHCP lease duration")), cfg.BoolOpt( "dhcp_agent_notification", default=True, help=_("Allow sending resource operation" " notification to DHCP agent"), ), cfg.BoolOpt("allow_overlapping_ips", default=False, help=_("Allow overlapping IP support in Neutron")), cfg.StrOpt("host", default=utils.get_hostname(), help=_("The hostname Neutron is running on")), cfg.BoolOpt("force_gateway_on_subnet", default=False, help=_("Ensure that configured gateway is on subnet")), ] core_cli_opts = [ cfg.StrOpt( "state_path", default="/var/lib/neutron", help=_("Where to store Neutron state files. " "This directory must be writable by the agent."), ) ] # Register the configuration options cfg.CONF.register_opts(core_opts) cfg.CONF.register_cli_opts(core_cli_opts)
help=_("Sync data on connect")), cfg.BoolOpt('auto_sync_on_failure', default=True, help=_("If neutron fails to create a resource because " "the backend controller doesn't know of a dependency, " "the plugin automatically triggers a full data " "synchronization to the controller.")), cfg.IntOpt('consistency_interval', default=60, help=_("Time between verifications that the backend controller " "database is consistent with Neutron. (0 to disable)")), cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), cfg.IntOpt('thread_pool_size', default=4, help=_("Maximum number of threads to spawn to handle large " "volumes of port creations.")), cfg.StrOpt('neutron_id', default='neutron-' + utils.get_hostname(), deprecated_name='quantum_id', help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), cfg.StrOpt('auth_url', help=_("Authentication URL")), cfg.StrOpt('auth_user', help=_("Admin username")), cfg.StrOpt('auth_password', help=_("Admin password")), cfg.StrOpt('auth_tenant', help=_("Admin tenant name")), cfg.IntOpt('keystone_sync_interval', default=60, help=_("Time between that keystone queries to sync " "Openstack tenants. (0 to disable)")), ] router_opts = [ cfg.MultiStrOpt('tenant_default_router_rule', default=['*:any:any:permit'],
cfg.IntOpt("max_fixed_ips_per_port", default=5, help=_("Maximum number of fixed ips per port")), cfg.IntOpt( "dhcp_lease_duration", default=86400, deprecated_name="dhcp_lease_time", help=_("DHCP lease duration (in seconds). Use -1 to tell " "dnsmasq to use infinite lease times."), ), cfg.BoolOpt( "dhcp_agent_notification", default=True, help=_("Allow sending resource operation" " notification to DHCP agent"), ), cfg.BoolOpt("allow_overlapping_ips", default=False, help=_("Allow overlapping IP support in Neutron")), cfg.StrOpt( "host", default=utils.get_hostname(), help=_( "Hostname to be used by the neutron server, agents and" "services running on this machine. All the agents and " "services running on this machine must use the same " "host value." ), ), cfg.BoolOpt( "force_gateway_on_subnet", default=True, help=_( "Ensure that configured gateway is on subnet. " "For IPv6, validate only if gateway is not a link " "local address. Deprecated, to be removed during the " "K release, at which point the check will be "
def _sync_routers_task(self, context): LOG.debug(_("Starting _sync_routers_task - fullsync:%s"), self.fullsync) if not self.fullsync: return try: self.local_ip, self.dvr_base_mac, self.priority = self.agent_rpc.get_init_info(context, uts.get_hostname()) LOG.debug(_("sync task:local_ip is %s, dvr_base_mac is %s, priority is %s"), self.local_ip, self.dvr_base_mac, self.priority) # rebuild default flows self.tun_br.remove_all_flows() self.gw_br.remove_all_flows() self.setup_tunnel_flows() self.setup_gateway_flows() self.setup_default_flows() try: self.keepalived_pro = KeepalivedProcess(self.root_helper, self.local_ip, self.priority, conf=self.conf) self.keepalived_pro.create_keepalived_cfg() self.keepalived_pro.start_keepalived() except Exception, e: LOG.error(_("start keepalived failed : %s"), e) if self.routersync: timestamp = timeutils.utcnow() # l3_agent will send vm_ip_mac while get_routers routers = self.agent_rpc.get_routers(context) LOG.debug(_('Processing :%r'), routers) for r in routers: if not r.get("ext_net_info"): continue subnets = r.get("subnets") for subnet in subnets: temp = copy.deepcopy(r) temp["subnets"] = [subnet] update = RouterUpdate(r.get("router_id"), PRIORITY_SYNC_ROUTERS_TASK, temp, action=self.ROUTER_INTERFACE_ADD, timestamp=timestamp) self._queue.add(update) routes = r.get("routes") for route in routes: temp = copy.deepcopy(r) temp["routes"] = [route] temp["subnets"] = [] update = RouterUpdate(r.get("router_id"), PRIORITY_SYNC_ROUTERS_TASK, temp, action=self.ROUTER_ROUTE_ADD, timestamp=timestamp) self._queue.add(update) self.fullsync = False LOG.debug(_("_sync_routers_task successfully completed"))