elif vld.get("vim-network-name"):
db_sce_net["vim_network_name"] = get_str(vld, "vim-network-name", 255)
-
# table sce_interfaces (vld:vnfd-connection-point-ref)
for iface in vld.get("vnfd-connection-point-ref").values():
# Check if there are VDUs in the descriptor
"'nsd':'constituent-vnfd'".format(
str(nsd["id"]), str(vld["id"]), str(iface["member-vnf-index-ref"])),
httperrors.Bad_Request)
-
+
existing_ifaces = mydb.get_rows(SELECT=('i.uuid as uuid', 'i.type as iface_type'),
FROM="interfaces as i join vms on i.vm_id=vms.uuid",
WHERE={'vnf_id': vnf_index2vnf_uuid[vnf_index],
"sce_net_id": sce_net_uuid,
"interface_id": interface_uuid,
"ip_address": iface_ip_address,
- }
+ }
db_sce_interfaces.append(db_sce_interface)
if not db_sce_net["type"]:
db_sce_net["type"] = "bridge"
return vim_action_get(mydb, tenant_id, datacenter, item, content)
def sdn_controller_create(mydb, tenant_id, sdn_controller):
- wim_id = ovim.new_of_controller(sdn_controller)
-
- thread_name = get_non_used_vim_name(sdn_controller['name'], wim_id, wim_id, None)
- new_thread = vim_thread(task_lock, plugins, thread_name, wim_id, None, db=db)
- new_thread.start()
- thread_id = wim_id
- vim_threads["running"][thread_id] = new_thread
- logger.debug('New SDN controller created with uuid {}'.format(wim_id))
- return wim_id
+ try:
+ wim_id = ovim.new_of_controller(sdn_controller)
+
+ # Load plugin if not previously loaded
+ controller_type = sdn_controller.get("type")
+ plugin_name = "rosdn_" + controller_type
+ if plugin_name not in plugins:
+ _load_plugin(plugin_name, type="sdn")
+
+ thread_name = get_non_used_vim_name(sdn_controller['name'], wim_id, wim_id, None)
+ new_thread = vim_thread(task_lock, plugins, thread_name, wim_id, None, db=db)
+ new_thread.start()
+ thread_id = wim_id
+ vim_threads["running"][thread_id] = new_thread
+ logger.debug('New SDN controller created with uuid {}'.format(wim_id))
+ return wim_id
+ except ovimException as e:
+ raise NfvoException(e) from e
def sdn_controller_update(mydb, tenant_id, controller_id, sdn_controller):
data = ovim.edit_of_controller(controller_id, sdn_controller)