23147222 Floating IP allocation fails even when there are addresses available s11u3-sru
authorchaithan.prakash@oracle.com <chaithan.prakash@oracle.com>
Mon, 25 Jul 2016 14:27:35 -0700
branchs11u3-sru
changeset 6474 b66997b06bc1
parent 6466 7e3ad86b966b
child 6479 5730eca693a9
23147222 Floating IP allocation fails even when there are addresses available
components/openstack/neutron/Makefile
components/openstack/neutron/patches/07-floatingip-remove-port-on-failed-create.patch
--- a/components/openstack/neutron/Makefile	Fri Jul 22 04:36:18 2016 -0700
+++ b/components/openstack/neutron/Makefile	Mon Jul 25 14:27:35 2016 -0700
@@ -48,7 +48,8 @@
 	03-metadata-driver-solaris.patch \
 	04-requirements.patch \
 	05-alembic-migrations.patch \
-	06-dhcp-agent-warning-fix.patch
+	06-dhcp-agent-warning-fix.patch \
+	07-floatingip-remove-port-on-failed-create.patch
 
 TPNO=			25791
 TPNO_VPNAAS=		27275
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/neutron/patches/07-floatingip-remove-port-on-failed-create.patch	Mon Jul 25 14:27:35 2016 -0700
@@ -0,0 +1,35 @@
+Patch to make call to plugin's delete_port() when floatingip creation fails
+after the plugin has created the port. These changes will eventually be
+proposed upstream.
+
+*** neutron-2015.1.2/neutron/db/l3_db.py	Tue Oct 13 10:35:16 2015
+--- new/neutron/db/l3_db.py	Fri Jul 22 20:25:31 2016
+***************
+*** 954,963 ****
+                  floating_ip_address=floating_ip_address,
+                  floating_port_id=external_port['id'])
+              fip['tenant_id'] = tenant_id
+!             # Update association with internal port
+!             # and define external IP address
+!             self._update_fip_assoc(context, fip,
+!                                    floatingip_db, external_port)
+              context.session.add(floatingip_db)
+  
+          return self._make_floatingip_dict(floatingip_db)
+--- 954,969 ----
+                  floating_ip_address=floating_ip_address,
+                  floating_port_id=external_port['id'])
+              fip['tenant_id'] = tenant_id
+!             try:
+!                 # Update association with internal port
+!                 # and define external IP address
+!                 self._update_fip_assoc(context, fip,
+!                                        floatingip_db, external_port)
+!             except:
+!                 with excutils.save_and_reraise_exception():
+!                     self._core_plugin.delete_port(context.elevated(),
+!                                                   external_port['id'],
+!                                                   l3_port_check=False)
+              context.session.add(floatingip_db)
+  
+          return self._make_floatingip_dict(floatingip_db)