Implement feature 5949
Enable dynamic connectivity setup in multi-site Network Services
The code required to implement the feature is contained in `osm_ro/wim`
as much as possible.
* `wim/engine.py` works together with `nfvo.py` to implement the
feature
* `wim/persistence.py` is equivalent to `nfvo_db.py` and try to
encapsulate most of the SQL-specific code, implementing a persistence
layer
* `wim/http_handler.py` extends `httpserver.py` adding WIM-related HTTP
routes
* `wim/wim_thread.py` is similar to `vim_thread.py` and controls the
execution of WIM-related tasks
* `wim/actions.py` and `wim/wan_link_actions.py` implement the action
handling specific code, calling instances of the `wim/wimconn.py`
subclasses
WIM connectors are still a work in progress
Individual change details (newer to older)
- Add errors for inconsistent state
- Delay re-scheduled tasks
- Move lock to inside the persistence object
- Better errors for connector failures
- Try to cache the wan_link information before it is deleted from the database
- Integrate WanLinkDelete to NFVO
- Add WanLinkDelete implementation draft with some tests
- Add basic wim network creation
- Add minimal documentation for actions
- Add checks to the create action
- Improve documentation, rearrange insert_pending and remove unused functions on WimThread
- Integrate Action classes in refresh_tasks
- Add Action classes to avoid intricate conditions
- Adding Proposed License
- Move grouping of actions to persistence
- Change WimThread to use SQL to do the heavy lifting
- Simplify WimThread reload_actions
- Add tests for derive_wan_links
- Implement find_common_wim(s)
- Add tests for create_wim_account
- Add migration scripts for version 33
- Changes to WIM and VIM threads for vim_wim_actions
- Implement wim_account management according to the discussion
- Add WimHandler integration inside httpserver
- Add quick instructions to run the tests
- Add WIM functional tests using real database
- Add DB WIM port mapping
- RO WIM-related console scripts
- Add WIM integration to NFVO
- Improve database support focusing on tests
- RO NBI WIM-related commands in HTTP server
- Adding WIM tables to MANO DB
- Add wim http handler initial implementation
- Move http utility functions to separated files
This separation allows the code to be reused more easily and avoids
circular dependencies.
(The httpserver can import other modules implementing http routes,
and those modules can then use the utility functions without having
to import back httpserver)
- Add a HTTP handler class and custom route decorator
These tools can be used to create independent groups of bottle
routes/callbacks in a OOP fashion
- Extract http error codes and related logic to separated file
Change-Id: Icd5fc9fa345852b8cf571e48f427dc10bdbd24c5
Signed-off-by: Anderson Bravalheri <a.bravalheri@bristol.ac.uk>
diff --git a/openmanod b/openmanod
index 3fd1ae0..4ebac75 100755
--- a/openmanod
+++ b/openmanod
@@ -27,7 +27,7 @@
Main program that implements a reference NFVO (Network Functions Virtualisation Orchestrator).
It interfaces with an NFV VIM through its API and offers a northbound interface, based on REST (openmano API),
where NFV services are offered including the creation and deletion of VNF templates, VNF instances,
-network service templates and network service instances.
+network service templates and network service instances.
It loads the configuration file and launches the http_server thread that will listen requests using openmano API.
"""
@@ -44,13 +44,15 @@
from osm_ro import httpserver, nfvo, nfvo_db
from osm_ro.openmano_schemas import config_schema
from osm_ro.db_base import db_base_Exception
+from osm_ro.wim.engine import WimEngine
+from osm_ro.wim.persistence import WimPersistence
import osm_ro
__author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes"
__date__ = "$26-aug-2014 11:09:29$"
-__version__ = "0.5.78-r588"
+__version__ = "0.6.00"
version_date = "Sep 2018"
-database_version = 32 # expected database schema version
+database_version = 34 # expected database schema version
global global_config
@@ -106,7 +108,7 @@
def console_port_iterator():
- '''this iterator deals with the http_console_ports
+ '''this iterator deals with the http_console_ports
returning the ports one by one
'''
index = 0
@@ -287,7 +289,7 @@
logger.critical("Starting openmano server version: '%s %s' command: '%s'",
__version__, version_date, " ".join(sys.argv))
- for log_module in ("nfvo", "http", "vim", "db", "console", "ovim"):
+ for log_module in ("nfvo", "http", "vim", "wim", "db", "console", "ovim"):
log_level_module = "log_level_" + log_module
log_file_module = "log_file_" + log_module
logger_module = logging.getLogger('openmano.' + log_module)
@@ -334,9 +336,18 @@
pass # if tenant exist (NfvoException error 409), ignore
else: # otherwise print and error and continue
logger.error("Cannot create tenant '{}': {}".format(create_tenant, e))
- nfvo.start_service(mydb)
- httpthread = httpserver.httpserver(mydb, False, global_config['http_host'], global_config['http_port'])
+ # WIM module
+ wim_persistence = WimPersistence(mydb)
+ wim_engine = WimEngine(wim_persistence)
+ # ---
+ nfvo.start_service(mydb, wim_persistence, wim_engine)
+
+ httpthread = httpserver.httpserver(
+ mydb, False,
+ global_config['http_host'], global_config['http_port'],
+ wim_persistence, wim_engine
+ )
httpthread.start()
if 'http_admin_port' in global_config: