From 31e141b7336c646af63b674414f8c27cf6746bb3 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Thu, 25 Oct 2018 18:33:19 +0200 Subject: [PATCH] Added support of PARAVIRT interface type following IM change 6688 Change-Id: If6d9d486c2a78b55e6c1218b6292896b0707ca78 Signed-off-by: garciadeblas --- osm_ro/nfvo.py | 2 +- osm_ro/openmano_schemas.py | 4 ++-- osm_ro/vimconn_openvim.py | 2 +- osm_ro/vimconn_vmware.py | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index c956f958..f4a2d798 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -1072,7 +1072,7 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor): if iface.get("virtual-interface").get("type") == "OM-MGMT": db_interface["type"] = "mgmt" - elif iface.get("virtual-interface").get("type") in ("VIRTIO", "E1000"): + elif iface.get("virtual-interface").get("type") in ("VIRTIO", "E1000", "PARAVIRT"): db_interface["type"] = "bridge" db_interface["model"] = get_str(iface.get("virtual-interface"), "type", 12) elif iface.get("virtual-interface").get("type") in ("SR-IOV", "PCI-PASSTHROUGH"): diff --git a/osm_ro/openmano_schemas.py b/osm_ro/openmano_schemas.py index 00a5b51c..f717a4a6 100644 --- a/osm_ro/openmano_schemas.py +++ b/osm_ro/openmano_schemas.py @@ -465,7 +465,7 @@ bridge_interfaces_schema={ "bandwidth":bandwidth_schema, "vpci":pci_schema, "mac_address": mac_schema, - "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139"]}, + "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139", "paravirt"]}, "port-security": {"type" : "boolean"}, "floating-ip": {"type" : "boolean"} }, @@ -1220,4 +1220,4 @@ sdn_external_port_schema = { "mac": mac_schema }, "required": ["port"] -} \ No newline at end of file +} diff --git a/osm_ro/vimconn_openvim.py b/osm_ro/vimconn_openvim.py index 34c1b8c0..f6d22376 100644 --- a/osm_ro/vimconn_openvim.py +++ b/osm_ro/vimconn_openvim.py @@ -846,7 +846,7 @@ class vimconnector(vimconn.vimconnector): if net.get("vpci"): net_dict["vpci"] = net["vpci"] if net.get("model"): - if net["model"] == "VIRTIO": + if net["model"] == "VIRTIO" or net["model"] == "paravirt": net_dict["model"] = "virtio" else: net_dict["model"] = net["model"] diff --git a/osm_ro/vimconn_vmware.py b/osm_ro/vimconn_vmware.py index 169df3ac..dd3bba5f 100644 --- a/osm_ro/vimconn_vmware.py +++ b/osm_ro/vimconn_vmware.py @@ -1917,8 +1917,9 @@ class vimconnector(vimconn.vimconnector): if 'type' in net and net['type'] not in type_list: # fetching nic type from vnf if 'model' in net: - if net['model'] is not None and net['model'].lower() == 'virtio': - nic_type = 'VMXNET3' + if net['model'] is not None: + if net['model'].lower() == 'paravirt' or net['model'].lower() == 'virtio': + nic_type = 'VMXNET3' else: nic_type = net['model'] -- 2.25.1