23506589 Need to modify args passed to dnsmasq in solaris/dhcp.py s11u3-sru
authorVardhnee Ramanujam Ravi <vardhnee.ramanujam.ravi@oracle.com>
Thu, 21 Jul 2016 09:32:01 -0700
branchs11u3-sru
changeset 6444 bf62eba2612a
parent 6443 54dc57734e1c
child 6452 6faecea5219e
23506589 Need to modify args passed to dnsmasq in solaris/dhcp.py 23515020 Need to address logic error in neutron-dhcp-agent 23179502 Confusing namespaces warning message from neutron-dhcp 23488001 neutron l3 agent fails to update the NAT rules for floating IP reassignment
components/openstack/neutron/Makefile
components/openstack/neutron/files/agent/evs_l3_agent.py
components/openstack/neutron/files/agent/solaris/dhcp.py
components/openstack/neutron/patches/06-dhcp-agent-warning-fix.patch
--- a/components/openstack/neutron/Makefile	Thu Jul 14 13:57:27 2016 -0700
+++ b/components/openstack/neutron/Makefile	Thu Jul 21 09:32:01 2016 -0700
@@ -47,7 +47,8 @@
 	02-l3-agent-add-solaris.patch \
 	03-metadata-driver-solaris.patch \
 	04-requirements.patch \
-	05-alembic-migrations.patch
+	05-alembic-migrations.patch \
+	06-dhcp-agent-warning-fix.patch
 
 TPNO=			25791
 TPNO_VPNAAS=		27275
--- a/components/openstack/neutron/files/agent/evs_l3_agent.py	Thu Jul 14 13:57:27 2016 -0700
+++ b/components/openstack/neutron/files/agent/evs_l3_agent.py	Thu Jul 21 09:32:01 2016 -0700
@@ -319,7 +319,6 @@
             fixed_cidr = str(fip['fixed_ip_address']) + '/32'
             nat_rule = 'bimap %s %s -> %s' % (interface_name, fixed_cidr,
                                               fip_cidr)
-
             if fip_cidr not in existing_cidrs:
                 try:
                     ipintf.create_address(fip_cidr)
@@ -335,6 +334,33 @@
                     LOG.warn(_("Unable to configure IP address for "
                                "floating IP: %s: %s") % (fip['id'], err))
                     continue
+            else:
+                # check if existing fip has been reassigned
+                fip_reassigned = False
+                for rule in existing_nat_rules:
+                    if not rule.startswith('bimap'):
+                        continue
+                    if fip_ip not in rule:
+                        continue
+                    if fixed_cidr not in rule:
+                        fip_reassigned = True
+                        break
+
+                if fip_reassigned:
+                    LOG.debug("Floating ip '%s' reassigned to '%s'",
+                              fip_ip, fip['fixed_ip_address'])
+                    # remove the old nat rule and
+                    # add a new one for the new fixed_ip
+                    try:
+                        self.ipfilters_manager.remove_nat_rules([rule])
+                        existing_nat_rules.remove(rule)
+                        self.ipfilters_manager.add_nat_rules([nat_rule])
+                    except Exception as err:
+                        fip_statuses[fip['id']] = (
+                            l3_constants.FLOATINGIP_STATUS_ERROR)
+                        LOG.warn(_("Unable to configure IP address for "
+                                   "floating IP: %s: %s") % (fip['id'], err))
+                        continue
             fip_statuses[fip['id']] = (
                 l3_constants.FLOATINGIP_STATUS_ACTIVE)
             LOG.debug("Floating ip %(id)s added, status %(status)s",
--- a/components/openstack/neutron/files/agent/solaris/dhcp.py	Thu Jul 14 13:57:27 2016 -0700
+++ b/components/openstack/neutron/files/agent/solaris/dhcp.py	Thu Jul 21 09:32:01 2016 -0700
@@ -3,7 +3,7 @@
 # Copyright 2012 OpenStack Foundation
 # All Rights Reserved.
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
 #    not use this file except in compliance with the License. You may obtain
@@ -56,8 +56,7 @@
             '--dhcp-hostsfile=%s' % self.get_conf_file_name('host'),
             '--addn-hosts=%s' % self.get_conf_file_name('addn_hosts'),
             '--dhcp-optsfile=%s' % self.get_conf_file_name('opts'),
-            '--leasefile-ro',
-            '--dhcp-authoritative'
+            '--dhcp-leasefile=%s' % self.get_conf_file_name('leases')
         ]
 
         possible_leases = 0
@@ -266,7 +265,7 @@
             else:
                 addrconf = True
 
-            self.driver.init_l3(interface_name, ip_cidrs, addrconf=addrconf)
+        self.driver.init_l3(interface_name, ip_cidrs, addrconf=addrconf)
 
         return interface_name
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/neutron/patches/06-dhcp-agent-warning-fix.patch	Thu Jul 21 09:32:01 2016 -0700
@@ -0,0 +1,14 @@
+In-house patch to remove confusing namespace warning message in the log file.
+
+--- neutron-2015.1.2/neutron/agent/common/config.py.orig	Tue Jul 12 13:31:47 2016
++++ neutron-2015.1.2/neutron/agent/common/config.py	Tue Jul 12 13:32:04 2016
+@@ -54,8 +54,7 @@
+ USE_NAMESPACES_OPTS = [
+     cfg.BoolOpt('use_namespaces', default=True,
+                 help=_("Allow overlapping IP. This option is deprecated and "
+-                       "will be removed in a future release."),
+-                deprecated_for_removal=True),
++                       "will be removed in a future release.")),
+ ]
+ 
+ IPTABLES_OPTS = [