From 8a9604b3a1ccc9fec2c4c3b1af84973e53164c2c Mon Sep 17 00:00:00 2001 From: Yuvaraja Mariappan Date: Thu, 29 Sep 2016 16:00:47 -0700 Subject: [PATCH] schema changes for ecmp(native) loadbalancer 1. instance-ip can be a parent to floating-ip 2. floating-ip has the list-property of port-mappings(src and dst port) 3. floating-ip-port-mappings-enable boolean to enable/disable port-mappings. defaule value is false. Change-Id: I6fb9ed0ffde9d47e2be1cc48cd1381364ac65cd4 Partial-bug: 1629128 --- src/config/api-server/vnc_cfg_types.py | 12 ++++++++++++ src/schema/vnc_cfg.xsd | 27 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/config/api-server/vnc_cfg_types.py b/src/config/api-server/vnc_cfg_types.py index a43709594de..8f134d03028 100644 --- a/src/config/api-server/vnc_cfg_types.py +++ b/src/config/api-server/vnc_cfg_types.py @@ -222,6 +222,9 @@ def pre_dbe_update(cls, id, fq_name, obj_dict, db_conn, **kwargs): class FloatingIpServer(Resource, FloatingIp): @classmethod def pre_dbe_create(cls, tenant_name, obj_dict, db_conn): + if obj_dict['parent_type'] == 'instance-ip': + return True, "" + vn_fq_name = obj_dict['fq_name'][:-2] req_ip = obj_dict.get("floating_ip_address") if req_ip and cls.addr_mgmt.is_ip_allocated(req_ip, vn_fq_name): @@ -252,6 +255,9 @@ def undo(): @classmethod def post_dbe_delete(cls, id, obj_dict, db_conn): + if obj_dict['parent_type'] == 'instance-ip': + return True, "" + vn_fq_name = obj_dict['fq_name'][:-2] fip_addr = obj_dict['floating_ip_address'] db_conn.config_log('AddrMgmt: free FIP %s for vn=%s' @@ -265,6 +271,9 @@ def post_dbe_delete(cls, id, obj_dict, db_conn): @classmethod def dbe_create_notification(cls, obj_ids, obj_dict): + if obj_dict['parent_type'] == 'instance-ip': + return + fip_addr = obj_dict['floating_ip_address'] vn_fq_name = obj_dict['fq_name'][:-2] cls.addr_mgmt.ip_alloc_notify(fip_addr, vn_fq_name) @@ -272,6 +281,9 @@ def dbe_create_notification(cls, obj_ids, obj_dict): @classmethod def dbe_delete_notification(cls, obj_ids, obj_dict): + if obj_dict['parent_type'] == 'instance-ip': + return + fip_addr = obj_dict['floating_ip_address'] vn_fq_name = obj_dict['fq_name'][:-2] cls.addr_mgmt.ip_free_notify(fip_addr, vn_fq_name) diff --git a/src/schema/vnc_cfg.xsd b/src/schema/vnc_cfg.xsd index ee7f0896583..3f97a05d542 100644 --- a/src/schema/vnc_cfg.xsd +++ b/src/schema/vnc_cfg.xsd @@ -153,6 +153,19 @@ targetNamespace="http://www.contrailsystems.com/2012/VNC-CONFIG/0"> + + + + + + + + + + + + + Link('floating-ip-virtual-machine-interface', 'floating-ip', 'virtual-machine-interface', ['ref'], 'optional', 'CRUD', 'Reference to virtual machine interface to which this floating ip is attached.') --> + + + + + +