From d29b1d39bb739424a674030d11aa9c7e6f17fbb2 Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 25 Jan 2017 11:02:52 +0100 Subject: [PATCH] new option for avoid reaching VIMS at new VNF Change-Id: Ib27ca4c14a59b391cb73994055a51ab80713e6b5 Signed-off-by: tierno --- nfvo.py | 12 ++++++------ openmano_schemas.py | 1 + openmanod.cfg | 5 ++++- openmanod.py | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/nfvo.py b/nfvo.py index ba670c74..84aec649 100644 --- a/nfvo.py +++ b/nfvo.py @@ -547,6 +547,7 @@ def new_vnf(mydb, tenant_id, vnf_descriptor): # Step 1. Check the VNF descriptor check_vnf_descriptor(vnf_descriptor, vnf_descriptor_version=1) # Step 2. Check tenant exist + vims = {} if tenant_id != "any": check_tenant(mydb, tenant_id) if "tenant_id" in vnf_descriptor["vnf"]: @@ -556,9 +557,8 @@ def new_vnf(mydb, tenant_id, vnf_descriptor): else: vnf_descriptor['vnf']['tenant_id'] = tenant_id # Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter - vims = get_vim(mydb, tenant_id) - else: - vims={} + if global_config["auto_push_VNF_to_VIMs"]: + vims = get_vim(mydb, tenant_id) # Step 4. Review the descriptor and add missing fields #print vnf_descriptor @@ -681,6 +681,7 @@ def new_vnf_v02(mydb, tenant_id, vnf_descriptor): # Step 1. Check the VNF descriptor check_vnf_descriptor(vnf_descriptor, vnf_descriptor_version=2) # Step 2. Check tenant exist + vims = {} if tenant_id != "any": check_tenant(mydb, tenant_id) if "tenant_id" in vnf_descriptor["vnf"]: @@ -690,9 +691,8 @@ def new_vnf_v02(mydb, tenant_id, vnf_descriptor): else: vnf_descriptor['vnf']['tenant_id'] = tenant_id # Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter - vims = get_vim(mydb, tenant_id) - else: - vims={} + if global_config["auto_push_VNF_to_VIMs"]: + vims = get_vim(mydb, tenant_id) # Step 4. Review the descriptor and add missing fields #print vnf_descriptor diff --git a/openmano_schemas.py b/openmano_schemas.py index 7404022c..1ea64f63 100644 --- a/openmano_schemas.py +++ b/openmano_schemas.py @@ -80,6 +80,7 @@ config_schema = { "http_port": port_schema, "http_admin_port": port_schema, "http_host": nameshort_schema, + "auto_push_VNF_to_VIMs": {"type":"boolean"}, "vnf_repository": path_schema, "db_host": nameshort_schema, "db_user": nameshort_schema, diff --git a/openmanod.cfg b/openmanod.cfg index 76e93d58..ebcee2b6 100644 --- a/openmanod.cfg +++ b/openmanod.cfg @@ -48,8 +48,11 @@ db_name: mano_db # Name of the MANO DB #other MANO parameters # Folder where the VNF descriptors will be stored # The folder will be created in the execution folder if it does not exist -#vnf_repository: "./vnfrepo" # Use an absolute path to avoid misunderstandings +#vnf_repository: "./vnfrepo" # Use an absolute path to avoid misunderstandings +# Indicates if at VNF onboarding, flavors and images are loaded at all related VIMs, +# in order to speed up the later instantiation. +auto_push_VNF_to_VIMs: False # by default True #general logging parameters #choose among: DEBUG, INFO, WARNING, ERROR, CRITICAL diff --git a/openmanod.py b/openmanod.py index 2eddb20e..5ec3650b 100755 --- a/openmanod.py +++ b/openmanod.py @@ -33,7 +33,7 @@ It loads the configuration file and launches the http_server thread that will li ''' __author__="Alfonso Tierno, Gerardo Garcia, Pablo Montes" __date__ ="$26-aug-2014 11:09:29$" -__version__="0.5.7-r517" +__version__="0.5.8-r518" version_date="Jan 2017" database_version="0.19" #expected database schema version @@ -64,6 +64,7 @@ def load_configuration(configuration_file): 'http_console_host': None, 'log_level': 'DEBUG', 'log_socket_port': 9022, + 'auto_push_VNF_to_VIMs': True } try: #Check config file exists -- 2.25.1