Skip to content

Commit

Permalink
LBAASv2: FIP disassociate and associate
Browse files Browse the repository at this point in the history
FIP disassociate and associate to vip port doesnt add fip
refs to the SI right VMI interfaces. This is because the
code refered only to the virtual_ip link from v1. We need
to add link to loadbalancer for v2.

Change-Id: I8062ba3402541d2b7e92ad7f43167298dc0a9514
Closes-Bug: #1538396
  • Loading branch information
rrugge committed Jan 27, 2016
1 parent 0022e08 commit f867a61
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/config/svc-monitor/svc_monitor/config_db.py
Expand Up @@ -363,6 +363,7 @@ def __init__(self, uuid, obj_dict=None):
self.params = None
self.if_type = None
self.virtual_ip = None
self.loadbalancer = None
self.virtual_network = None
self.virtual_machine = None
self.loadbalancer_pool = None
Expand Down Expand Up @@ -393,6 +394,7 @@ def update(self, obj=None):
if self.aaps:
self.aaps = self.aaps.get('allowed_address_pair', None)
self.update_single_ref('virtual_ip', obj)
self.update_single_ref('loadbalancer', obj)
self.update_single_ref('loadbalancer_pool', obj)
self.update_multiple_refs('instance_ip', obj)
self.update_multiple_refs('floating_ip', obj)
Expand All @@ -417,6 +419,7 @@ def delete(cls, uuid):
return
obj = cls._dict[uuid]
obj.update_single_ref('virtual_ip', {})
obj.update_single_ref('loadbalancer', {})
obj.update_single_ref('loadbalancer_pool', {})
obj.update_multiple_refs('instance_ip', {})
obj.update_multiple_refs('floating_ip', {})
Expand Down
7 changes: 5 additions & 2 deletions src/config/svc-monitor/svc_monitor/instance_manager.py
Expand Up @@ -153,9 +153,12 @@ def _link_and_update_iip(self, si, vmi_obj, iip_obj, iipv6_obj):

def _link_fip_to_vmi(self, vmi_obj, fip_id):
fip = FloatingIpSM.get(fip_id)
if fip:
if not fip:
return

if vmi_obj.uuid not in fip.virtual_machine_interfaces:
self._vnc_lib.ref_update('floating-ip', fip_id,
'virtual-machine-interface', vmi_obj.uuid, None, 'ADD')
'virtual-machine-interface', vmi_obj.uuid, None, 'ADD')

def _set_static_routes(self, nic, si):
static_routes = nic['static-routes']
Expand Down
2 changes: 2 additions & 0 deletions src/config/svc-monitor/svc_monitor/svc_monitor.py
Expand Up @@ -326,6 +326,8 @@ def _vnc_subscribe_actions(self, oper_info):
vmi = VirtualMachineInterfaceSM.get(vmi_id)
if vmi and vmi.virtual_ip:
self.netns_manager.add_fip_to_vip_vmi(vmi, fip)
elif vmi and vmi.loadbalancer:
self.netns_manager.add_fip_to_vip_vmi(vmi, fip)

for lr_id in dependency_tracker.resources.get('logical_router', []):
lr = LogicalRouterSM.get(lr_id)
Expand Down

0 comments on commit f867a61

Please sign in to comment.