From: garciadeblas Date: Thu, 29 Sep 2016 14:01:52 +0000 (+0000) Subject: v0.4.60: fixed bug when using ip profiles in openstack, improved logs in case od... X-Git-Tag: v1.0.0~15 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=commitdiff_plain;h=edca7b3cd61081d0d84de9acc4dec39daaa07419 v0.4.60: fixed bug when using ip profiles in openstack, improved logs in case od unexpected exception in REST API, dos2unix vnf examples Signed-off-by: garciadeblas --- diff --git a/.gitignore-common b/.gitignore-common index 233cf38a..c71eced3 100644 --- a/.gitignore-common +++ b/.gitignore-common @@ -1,6 +1,26 @@ -# Created by .ignore support plugin (hsz.mobi) -#this is a template with common files to be igonored, after clone make a copy to .gitignore -#cp .gitignore-common .gitignore +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## + +# This is a template with common files to be igonored, after clone make a copy to .gitignore +# cp .gitignore-common .gitignore *.pyc @@ -10,10 +30,10 @@ #logs of openmano logs -#pycham +#pycharm .idea -#eclpise +#eclipse .project .pydevproject .settings @@ -33,3 +53,4 @@ scenarios/local instance-scenarios/local database_utils/local scripts/local + diff --git a/httpserver.py b/httpserver.py index 43f57242..cd40882f 100644 --- a/httpserver.py +++ b/httpserver.py @@ -322,8 +322,8 @@ def http_get_tenants(): logger.error("http_get_tenants error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '/tenants/', method='GET') @@ -341,8 +341,8 @@ def http_get_tenant_id(tenant_id): logger.error("http_get_tenant_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '/tenants', method='POST') @@ -361,8 +361,8 @@ def http_post_tenants(): logger.error("http_post_tenants error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '/tenants/', method='PUT') @@ -387,8 +387,8 @@ def http_edit_tenant_id(tenant_id): logger.error("http_edit_tenant_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '/tenants/', method='DELETE') @@ -402,8 +402,8 @@ def http_delete_tenant_id(tenant_id): logger.error("http_delete_tenant_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '//datacenters', method='GET') @@ -434,8 +434,8 @@ def http_get_datacenters(tenant_id): logger.error("http_get_datacenters error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '//datacenters/', method='GET') @@ -491,8 +491,9 @@ def http_get_datacenter_id(tenant_id, datacenter_id): logger.error("http_get_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '/datacenters', method='POST') def http_post_datacenters(): @@ -510,8 +511,9 @@ def http_post_datacenters(): logger.error("http_post_datacenters error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '/datacenters/', method='PUT') def http_edit_datacenter_id(datacenter_id_name): @@ -530,8 +532,9 @@ def http_edit_datacenter_id(datacenter_id_name): logger.error("http_edit_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//datacenters//networks', method='GET') #deprecated @bottle.route(url_base + '//datacenters//netmaps', method='GET') @@ -565,8 +568,9 @@ def http_getnetmap_datacenter_id(tenant_id, datacenter_id, netmap_id=None): logger.error("http_getnetwork_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//datacenters//netmaps', method='DELETE') @bottle.route(url_base + '//datacenters//netmaps/', method='DELETE') @@ -594,8 +598,8 @@ def http_delnetmap_datacenter_id(tenant_id, datacenter_id, netmap_id=None): logger.error("http_delnetmap_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '//datacenters//netmaps/upload', method='POST') @@ -611,8 +615,9 @@ def http_uploadnetmap_datacenter_id(tenant_id, datacenter_id): logger.error("http_uploadnetmap_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//datacenters//netmaps', method='POST') def http_postnetmap_datacenter_id(tenant_id, datacenter_id): @@ -634,8 +639,9 @@ def http_postnetmap_datacenter_id(tenant_id, datacenter_id): logger.error("http_postnetmap_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//datacenters//netmaps/', method='PUT') def http_putnettmap_datacenter_id(tenant_id, datacenter_id, netmap_id): @@ -655,8 +661,8 @@ def http_putnettmap_datacenter_id(tenant_id, datacenter_id, netmap_id): logger.error("http_putnettmap_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '//datacenters//action', method='POST') @@ -679,8 +685,8 @@ def http_action_datacenter_id(tenant_id, datacenter_id): logger.error("http_action_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '/datacenters/', method='DELETE') @@ -695,8 +701,9 @@ def http_delete_datacenter_id( datacenter_id): logger.error("http_delete_datacenter_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//datacenters/', method='POST') def http_associate_datacenters(tenant_id, datacenter_id): @@ -719,8 +726,9 @@ def http_associate_datacenters(tenant_id, datacenter_id): logger.error("http_associate_datacenters error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//datacenters/', method='DELETE') def http_deassociate_datacenters(tenant_id, datacenter_id): @@ -733,8 +741,9 @@ def http_deassociate_datacenters(tenant_id, datacenter_id): logger.error("http_deassociate_datacenters error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//vim//', method='GET') @bottle.route(url_base + '//vim///', method='GET') @@ -747,8 +756,9 @@ def http_get_vim_items(tenant_id, datacenter_id, item, name=None): logger.error("http_get_vim_items error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//vim///', method='DELETE') def http_del_vim_items(tenant_id, datacenter_id, item, name): @@ -760,8 +770,9 @@ def http_del_vim_items(tenant_id, datacenter_id, item, name): logger.error("http_del_vim_items error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//vim//', method='POST') def http_post_vim_items(tenant_id, datacenter_id, item): @@ -774,8 +785,9 @@ def http_post_vim_items(tenant_id, datacenter_id, item): logger.error("http_post_vim_items error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//vnfs', method='GET') def http_get_vnfs(tenant_id): @@ -800,8 +812,9 @@ def http_get_vnfs(tenant_id): logger.error("http_get_vnfs error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//vnfs/', method='GET') def http_get_vnf_id(tenant_id,vnf_id): @@ -816,8 +829,9 @@ def http_get_vnf_id(tenant_id,vnf_id): logger.error("http_get_vnf_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//vnfs', method='POST') def http_post_vnfs(tenant_id): @@ -842,8 +856,9 @@ def http_post_vnfs(tenant_id): logger.error("http_post_vnfs error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//vnfs/', method='DELETE') def http_delete_vnf_id(tenant_id,vnf_id): @@ -858,8 +873,9 @@ def http_delete_vnf_id(tenant_id,vnf_id): logger.error("http_delete_vnf_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + #@bottle.route(url_base + '//hosts/topology', method='GET') #@bottle.route(url_base + '//physicalview/Madrid-Alcantara', method='GET') @@ -886,8 +902,8 @@ def http_get_hosts(tenant_id, datacenter): logger.error("http_get_hosts error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '/', method='OPTIONS') @@ -921,8 +937,9 @@ def http_post_deploy(tenant_id): logger.error("http_post_deploy error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//topology/verify', method='POST') def http_post_verify(tenant_id): @@ -961,8 +978,9 @@ def http_post_scenarios(tenant_id): logger.error("http_post_scenarios error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//scenarios//action', method='POST') def http_post_scenario_action(tenant_id, scenario_id): @@ -1002,8 +1020,9 @@ def http_post_scenario_action(tenant_id, scenario_id): logger.error("http_post_scenario_action error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//scenarios', method='GET') def http_get_scenarios(tenant_id): @@ -1029,8 +1048,9 @@ def http_get_scenarios(tenant_id): logger.error("http_get_scenarios error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//scenarios/', method='GET') def http_get_scenario_id(tenant_id, scenario_id): @@ -1049,8 +1069,9 @@ def http_get_scenario_id(tenant_id, scenario_id): logger.error("http_get_scenarios error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//scenarios/', method='DELETE') def http_delete_scenario_id(tenant_id, scenario_id): @@ -1067,8 +1088,8 @@ def http_delete_scenario_id(tenant_id, scenario_id): logger.error("http_delete_scenario_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '//scenarios/', method='PUT') @@ -1088,12 +1109,12 @@ def http_put_scenario_id(tenant_id, scenario_id): logger.error("http_put_scenario_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.route(url_base + '//instances', method='POST') def http_post_instances(tenant_id): - '''take an action over a scenario''' + '''create an instance-scenario''' logger.debug('FROM %s %s %s', bottle.request.remote_addr, bottle.request.method, bottle.request.url) try: #check valid tenant_id @@ -1110,8 +1131,8 @@ def http_post_instances(tenant_id): logger.error("http_post_instances error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) # # INSTANCES @@ -1136,8 +1157,9 @@ def http_get_instances(tenant_id): logger.error("http_get_instances error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//instances/', method='GET') def http_get_instance_id(tenant_id, instance_id): @@ -1164,8 +1186,9 @@ def http_get_instance_id(tenant_id, instance_id): logger.error("http_get_instance_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//instances/', method='DELETE') def http_delete_instance_id(tenant_id, instance_id): @@ -1184,8 +1207,9 @@ def http_delete_instance_id(tenant_id, instance_id): logger.error("http_delete_instance_id error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) + @bottle.route(url_base + '//instances//action', method='POST') def http_post_instance_scenario_action(tenant_id, instance_id): @@ -1212,8 +1236,8 @@ def http_post_instance_scenario_action(tenant_id, instance_id): logger.error("http_post_instance_scenario_action error {}: {}".format(e.http_code, str(e))) bottle.abort(e.http_code, str(e)) except Exception as e: - logger.error("Unexpected exception %s", str(e)) - bottle.abort(HTTP_Internal_Server_Error, str(e)) + logger.error("Unexpected exception: ", exc_info=True) + bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e)) @bottle.error(400) diff --git a/nfvo.py b/nfvo.py index f681f5b7..b0936e27 100644 --- a/nfvo.py +++ b/nfvo.py @@ -1768,7 +1768,10 @@ def create_instance(mydb, tenant_id, instance_dict): ipprofile['dhcp_enabled'] = ipprofile['dhcp'].get('enabled',True) ipprofile['dhcp_count'] = ipprofile['dhcp'].get('count',None) del ipprofile['dhcp'] - update(scenario_net['ip_profile'],ipprofile) + if 'ip_profile' not in scenario_net: + scenario_net['ip_profile'] = ipprofile + else: + update(scenario_net['ip_profile'],ipprofile) for interface in net_instance_desc.get('interfaces', () ): if 'ip_address' in interface: for vnf in scenarioDict['vnfs']: diff --git a/openmanod.py b/openmanod.py index 59a566dc..a5a2a53f 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.4.59-r502" +__version__="0.4.60-r503" version_date="Sep 2016" database_version="0.15" #expected database schema version diff --git a/vimconn_openstack.py b/vimconn_openstack.py index 70f8c012..f44257d4 100644 --- a/vimconn_openstack.py +++ b/vimconn_openstack.py @@ -227,7 +227,9 @@ class vimconnector(vimconn.vimconnector): def new_network(self,net_name, net_type, ip_profile=None, shared=False, vlan=None): '''Adds a tenant network to VIM. Returns the network identifier''' self.logger.debug("Adding a new network to VIM name '%s', type '%s'", net_name, net_type) + #self.logger.debug(">>>>>>>>>>>>>>>>>> IP profile %s", str(ip_profile)) try: + new_net = None self._reload_connection() network_dict = {'name': net_name, 'admin_state_up': True} if net_type=="data" or net_type=="ptp": @@ -255,7 +257,7 @@ class vimconnector(vimconn.vimconnector): } if 'gateway_address' in ip_profile: subnet['gateway_ip'] = ip_profile['gateway_address'] - if 'dns_address' in ip_profile: + if ip_profile.get('dns_address'): #TODO: manage dns_address as a list of addresses separated by commas subnet['dns_nameservers'] = [] subnet['dns_nameservers'].append(ip_profile['dns_address']) @@ -272,9 +274,12 @@ class vimconnector(vimconn.vimconnector): ip_int += ip_profile['dhcp_count'] ip_str = str(netaddr.IPAddress(ip_int)) subnet['allocation_pools'][0]['end'] = ip_str + #self.logger.debug(">>>>>>>>>>>>>>>>>> Subnet: %s", str(subnet)) self.neutron.create_subnet({"subnet": subnet} ) return new_net["network"]["id"] except (neExceptions.ConnectionFailed, ksExceptions.ClientException, neExceptions.NeutronException, ConnectionError) as e: + if new_net: + self.neutron.delete_network(new_net['network']['id']) self._format_exception(e) def get_network_list(self, filter_dict={}): diff --git a/vnfs/examples/dataplaneVNF1.yaml b/vnfs/examples/dataplaneVNF1.yaml index 3d702309..74206049 100644 --- a/vnfs/examples/dataplaneVNF1.yaml +++ b/vnfs/examples/dataplaneVNF1.yaml @@ -1,81 +1,81 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -vnf: - name: dataplaneVNF1 - description: "Example of a dataplane VNF consisting of a single VM for data plane workloads with high I/O performance requirements: 14 HW threads, 16 GB hugepages and 4 10G interfaces" - external-connections: - - name: mgmt - type: mgmt # "mgmt"(autoconnect to management net) - VNFC: dataplaneVNF1-VM - local_iface_name: eth0 - description: Management interface for general use - - name: xe0 - type: data - VNFC: dataplaneVNF1-VM - local_iface_name: xe0 - description: Dataplane interface 1 - - name: xe1 - type: data - VNFC: dataplaneVNF1-VM - local_iface_name: xe1 - description: Dataplane interface 2 - - name: xe2 - type: data - VNFC: dataplaneVNF1-VM - local_iface_name: xe2 - description: Dataplane interface 3 - - name: xe3 - type: data - VNFC: dataplaneVNF1-VM - local_iface_name: xe3 - description: Dataplane interface 4 - VNFC: - - name: dataplaneVNF1-VM - description: "Dataplane VM with high I/O performance requirements: 14 HW threads, 16 GB hugepages and 4 10G interfaces" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/dataplaneVNF1.qcow2 - numas: - - paired-threads: 7 # "cores", "paired-threads", "threads" - paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9], [10,11], [12, 13] ] - memory: 16 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 10 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "yes" - bandwidth: 10 Gbps - - name: xe2 - vpci: "0000:00:13.0" - dedicated: "yes" - bandwidth: 10 Gbps - - name: xe3 - vpci: "0000:00:14.0" - dedicated: "yes" - bandwidth: 10 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +vnf: + name: dataplaneVNF1 + description: "Example of a dataplane VNF consisting of a single VM for data plane workloads with high I/O performance requirements: 14 HW threads, 16 GB hugepages and 4 10G interfaces" + external-connections: + - name: mgmt + type: mgmt # "mgmt"(autoconnect to management net) + VNFC: dataplaneVNF1-VM + local_iface_name: eth0 + description: Management interface for general use + - name: xe0 + type: data + VNFC: dataplaneVNF1-VM + local_iface_name: xe0 + description: Dataplane interface 1 + - name: xe1 + type: data + VNFC: dataplaneVNF1-VM + local_iface_name: xe1 + description: Dataplane interface 2 + - name: xe2 + type: data + VNFC: dataplaneVNF1-VM + local_iface_name: xe2 + description: Dataplane interface 3 + - name: xe3 + type: data + VNFC: dataplaneVNF1-VM + local_iface_name: xe3 + description: Dataplane interface 4 + VNFC: + - name: dataplaneVNF1-VM + description: "Dataplane VM with high I/O performance requirements: 14 HW threads, 16 GB hugepages and 4 10G interfaces" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/dataplaneVNF1.qcow2 + numas: + - paired-threads: 7 # "cores", "paired-threads", "threads" + paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9], [10,11], [12, 13] ] + memory: 16 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 10 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "yes" + bandwidth: 10 Gbps + - name: xe2 + vpci: "0000:00:13.0" + dedicated: "yes" + bandwidth: 10 Gbps + - name: xe3 + vpci: "0000:00:14.0" + dedicated: "yes" + bandwidth: 10 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + diff --git a/vnfs/examples/dataplaneVNF2.yaml b/vnfs/examples/dataplaneVNF2.yaml index 6760ed7f..f03c2080 100644 --- a/vnfs/examples/dataplaneVNF2.yaml +++ b/vnfs/examples/dataplaneVNF2.yaml @@ -1,79 +1,79 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -vnf: - name: dataplaneVNF2 - description: "Example of a dataplane VNF consisting of a single VM for data plane workloads with high I/O performance requirements: 3 cores, 8 GB hugepages, 2 10G interfaces and 1 SR-IOV interface" - external-connections: - - name: mgmt - type: mgmt # "mgmt"(autoconnect to management net) - VNFC: dataplaneVNF2-VM - local_iface_name: eth0 - description: Management interface for general use - - name: control - type: bridge - VNFC: dataplaneVNF2-VM - local_iface_name: eth1 - description: Bridge interface - - name: xe0 - type: data - VNFC: dataplaneVNF2-VM - local_iface_name: xe0 - description: Dataplane interface 1 - - name: xe1 - type: data - VNFC: dataplaneVNF2-VM - local_iface_name: xe1 - description: Dataplane interface 2 - - name: xe2 - type: data - VNFC: dataplaneVNF2-VM - local_iface_name: xe2 - description: Dataplane interface 3 (SR-IOV) - VNFC: - - name: dataplaneVNF2-VM - description: "Dataplane VM with high I/O performance requirements: 3 cores (no hyperthreading), 8 GB hugepages, 2 10G interfaces and 1 SR-IOV interface" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/dataplaneVNF2.qcow2 - numas: - - cores: 3 # "cores", "paired-threads", "threads" - memory: 8 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 10 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "yes" - bandwidth: 10 Gbps - - name: xe2 - vpci: "0000:00:13.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - name: eth1 - vpci: "0000:00:10.0" - bandwidth: 1 Mbps # Optional, informative only - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +vnf: + name: dataplaneVNF2 + description: "Example of a dataplane VNF consisting of a single VM for data plane workloads with high I/O performance requirements: 3 cores, 8 GB hugepages, 2 10G interfaces and 1 SR-IOV interface" + external-connections: + - name: mgmt + type: mgmt # "mgmt"(autoconnect to management net) + VNFC: dataplaneVNF2-VM + local_iface_name: eth0 + description: Management interface for general use + - name: control + type: bridge + VNFC: dataplaneVNF2-VM + local_iface_name: eth1 + description: Bridge interface + - name: xe0 + type: data + VNFC: dataplaneVNF2-VM + local_iface_name: xe0 + description: Dataplane interface 1 + - name: xe1 + type: data + VNFC: dataplaneVNF2-VM + local_iface_name: xe1 + description: Dataplane interface 2 + - name: xe2 + type: data + VNFC: dataplaneVNF2-VM + local_iface_name: xe2 + description: Dataplane interface 3 (SR-IOV) + VNFC: + - name: dataplaneVNF2-VM + description: "Dataplane VM with high I/O performance requirements: 3 cores (no hyperthreading), 8 GB hugepages, 2 10G interfaces and 1 SR-IOV interface" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/dataplaneVNF2.qcow2 + numas: + - cores: 3 # "cores", "paired-threads", "threads" + memory: 8 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 10 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "yes" + bandwidth: 10 Gbps + - name: xe2 + vpci: "0000:00:13.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + - name: eth1 + vpci: "0000:00:10.0" + bandwidth: 1 Mbps # Optional, informative only + diff --git a/vnfs/examples/dataplaneVNF3.yaml b/vnfs/examples/dataplaneVNF3.yaml index 73d2cf9f..87e90e17 100644 --- a/vnfs/examples/dataplaneVNF3.yaml +++ b/vnfs/examples/dataplaneVNF3.yaml @@ -1,65 +1,65 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -vnf: - name: dataplaneVNF3 - description: "Example of a dataplane VNF consisting of one VM with two SR-IOV" - # class: parent # Optional. Used to organize VNFs - external-connections: - - name: mgmt - type: mgmt - VNFC: dataplaneVNF3-VM - local_iface_name: eth0 - description: control interface VM1 - - name: data0 - type: data - VNFC: dataplaneVNF3-VM - local_iface_name: xe0 - description: Dataplane interface - - name: data1 - type: data - VNFC: dataplaneVNF3-VM - local_iface_name: xe1 - description: Dataplane interface - VNFC: - - name: dataplaneVNF3-VM - description: "Dataplane VM with 2 threads, 2 GB hugepages, 2 SR-IOV interface" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/dataplaneVNF3.qcow2 - disk: 10 - numas: - - threads: 2 # "cores", "paired-threads", "threads" - memory: 2 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 1 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +vnf: + name: dataplaneVNF3 + description: "Example of a dataplane VNF consisting of one VM with two SR-IOV" + # class: parent # Optional. Used to organize VNFs + external-connections: + - name: mgmt + type: mgmt + VNFC: dataplaneVNF3-VM + local_iface_name: eth0 + description: control interface VM1 + - name: data0 + type: data + VNFC: dataplaneVNF3-VM + local_iface_name: xe0 + description: Dataplane interface + - name: data1 + type: data + VNFC: dataplaneVNF3-VM + local_iface_name: xe1 + description: Dataplane interface + VNFC: + - name: dataplaneVNF3-VM + description: "Dataplane VM with 2 threads, 2 GB hugepages, 2 SR-IOV interface" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/dataplaneVNF3.qcow2 + disk: 10 + numas: + - threads: 2 # "cores", "paired-threads", "threads" + memory: 2 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 1 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + + diff --git a/vnfs/examples/dataplaneVNF_2VMs.yaml b/vnfs/examples/dataplaneVNF_2VMs.yaml index 1e468feb..8871270c 100644 --- a/vnfs/examples/dataplaneVNF_2VMs.yaml +++ b/vnfs/examples/dataplaneVNF_2VMs.yaml @@ -1,100 +1,100 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -vnf: - name: dataplaneVNF_2VMs - description: "Example of a dataplane VNF consisting of two VMs for data plane workloads with one internal network" - # class: parent # Optional. Used to organize VNFs - internal-connections: - - name: datanet - description: datanet - type: data - elements: - - VNFC: VNF_2VMs-VM1 - local_iface_name: xe0 - - VNFC: VNF_2VMs-VM2 - local_iface_name: xe0 - external-connections: - - name: control0 - type: mgmt - VNFC: VNF_2VMs-VM1 - local_iface_name: eth0 - description: control interface VM1 - - name: control1 - type: mgmt - VNFC: VNF_2VMs-VM2 - local_iface_name: eth0 - description: control interface VM2 - - name: in - type: data - VNFC: VNF_2VMs-VM1 - local_iface_name: xe1 - description: Dataplane interface input - - name: out - type: data - VNFC: VNF_2VMs-VM2 - local_iface_name: xe1 - description: Dataplane interface output - VNFC: - - name: VNF_2VMs-VM1 - description: "Dataplane VM1 with 4 threads, 2 GB hugepages, 2 SR-IOV interface" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 - disk: 10 - numas: - - paired-threads: 2 # "cores", "paired-threads", "threads" - memory: 2 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 1 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - - name: VNF_2VMs-VM2 - description: "Dataplane VM1 with 2 threads, 2 GB hugepages, 2 SR-IOV interface" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 - disk: 10 - numas: - - paired-threads: 1 # "cores", "paired-threads", "threads" - memory: 2 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 1 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +vnf: + name: dataplaneVNF_2VMs + description: "Example of a dataplane VNF consisting of two VMs for data plane workloads with one internal network" + # class: parent # Optional. Used to organize VNFs + internal-connections: + - name: datanet + description: datanet + type: data + elements: + - VNFC: VNF_2VMs-VM1 + local_iface_name: xe0 + - VNFC: VNF_2VMs-VM2 + local_iface_name: xe0 + external-connections: + - name: control0 + type: mgmt + VNFC: VNF_2VMs-VM1 + local_iface_name: eth0 + description: control interface VM1 + - name: control1 + type: mgmt + VNFC: VNF_2VMs-VM2 + local_iface_name: eth0 + description: control interface VM2 + - name: in + type: data + VNFC: VNF_2VMs-VM1 + local_iface_name: xe1 + description: Dataplane interface input + - name: out + type: data + VNFC: VNF_2VMs-VM2 + local_iface_name: xe1 + description: Dataplane interface output + VNFC: + - name: VNF_2VMs-VM1 + description: "Dataplane VM1 with 4 threads, 2 GB hugepages, 2 SR-IOV interface" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 + disk: 10 + numas: + - paired-threads: 2 # "cores", "paired-threads", "threads" + memory: 2 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 1 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + + - name: VNF_2VMs-VM2 + description: "Dataplane VM1 with 2 threads, 2 GB hugepages, 2 SR-IOV interface" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 + disk: 10 + numas: + - paired-threads: 1 # "cores", "paired-threads", "threads" + memory: 2 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 1 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + diff --git a/vnfs/examples/dataplaneVNF_2VMs_v02.yaml b/vnfs/examples/dataplaneVNF_2VMs_v02.yaml index dbd5bd16..bd807617 100644 --- a/vnfs/examples/dataplaneVNF_2VMs_v02.yaml +++ b/vnfs/examples/dataplaneVNF_2VMs_v02.yaml @@ -1,113 +1,113 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -schema_version: "0.2" -vnf: - name: dataplaneVNF_2VMs_v02 - description: "Example of a dataplane VNF consisting of two VMs for data plane workloads with one internal network" - # class: parent # Optional. Used to organize VNFs - internal-connections: - - name: datanet - description: datanet - type: e-lan - implementation: underlay - ip-profile: - ip-version: IPv4 - subnet-address: 192.168.1.0/24 - gateway-address: 192.168.1.1 - dns-address: 8.8.8.8 - dhcp: - enabled: true - start-address: 192.168.1.100 - count: 100 - elements: - - VNFC: VNF_2VMs-VM1 - local_iface_name: xe0 - ip_address: 192.168.1.2 - - VNFC: VNF_2VMs-VM2 - local_iface_name: xe0 - ip_address: 192.168.1.3 - external-connections: - - name: control0 - type: mgmt - VNFC: VNF_2VMs-VM1 - local_iface_name: eth0 - description: control interface VM1 - - name: control1 - type: mgmt - VNFC: VNF_2VMs-VM2 - local_iface_name: eth0 - description: control interface VM2 - - name: in - type: data - VNFC: VNF_2VMs-VM1 - local_iface_name: xe1 - description: Dataplane interface input - - name: out - type: data - VNFC: VNF_2VMs-VM2 - local_iface_name: xe1 - description: Dataplane interface output - VNFC: - - name: VNF_2VMs-VM1 - description: "Dataplane VM1 with 4 threads, 2 GB hugepages, 2 SR-IOV interface" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 - disk: 10 - numas: - - paired-threads: 2 # "cores", "paired-threads", "threads" - memory: 2 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 1 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - - name: VNF_2VMs-VM2 - description: "Dataplane VM1 with 2 threads, 2 GB hugepages, 2 SR-IOV interface" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 - disk: 10 - numas: - - paired-threads: 1 # "cores", "paired-threads", "threads" - memory: 2 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 1 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +schema_version: "0.2" +vnf: + name: dataplaneVNF_2VMs_v02 + description: "Example of a dataplane VNF consisting of two VMs for data plane workloads with one internal network" + # class: parent # Optional. Used to organize VNFs + internal-connections: + - name: datanet + description: datanet + type: e-lan + implementation: underlay + ip-profile: + ip-version: IPv4 + subnet-address: 192.168.1.0/24 + gateway-address: 192.168.1.1 + dns-address: 8.8.8.8 + dhcp: + enabled: true + start-address: 192.168.1.100 + count: 100 + elements: + - VNFC: VNF_2VMs-VM1 + local_iface_name: xe0 + ip_address: 192.168.1.2 + - VNFC: VNF_2VMs-VM2 + local_iface_name: xe0 + ip_address: 192.168.1.3 + external-connections: + - name: control0 + type: mgmt + VNFC: VNF_2VMs-VM1 + local_iface_name: eth0 + description: control interface VM1 + - name: control1 + type: mgmt + VNFC: VNF_2VMs-VM2 + local_iface_name: eth0 + description: control interface VM2 + - name: in + type: data + VNFC: VNF_2VMs-VM1 + local_iface_name: xe1 + description: Dataplane interface input + - name: out + type: data + VNFC: VNF_2VMs-VM2 + local_iface_name: xe1 + description: Dataplane interface output + VNFC: + - name: VNF_2VMs-VM1 + description: "Dataplane VM1 with 4 threads, 2 GB hugepages, 2 SR-IOV interface" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 + disk: 10 + numas: + - paired-threads: 2 # "cores", "paired-threads", "threads" + memory: 2 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 1 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + + - name: VNF_2VMs-VM2 + description: "Dataplane VM1 with 2 threads, 2 GB hugepages, 2 SR-IOV interface" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 + disk: 10 + numas: + - paired-threads: 1 # "cores", "paired-threads", "threads" + memory: 2 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 1 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + diff --git a/vnfs/examples/dataplaneVNF_2VMs_v02_withimagename.yaml b/vnfs/examples/dataplaneVNF_2VMs_v02_withimagename.yaml index 0c546520..674f36cc 100644 --- a/vnfs/examples/dataplaneVNF_2VMs_v02_withimagename.yaml +++ b/vnfs/examples/dataplaneVNF_2VMs_v02_withimagename.yaml @@ -1,113 +1,113 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -schema_version: "0.2" -vnf: - name: dataplaneVNF_2VMs_v02_withimagename - description: "Example of a dataplane VNF consisting of two VMs for data plane workloads with one internal network" - # class: parent # Optional. Used to organize VNFs - internal-connections: - - name: datanet - description: datanet - type: e-lan - implementation: underlay - ip-profile: - ip-version: IPv4 - subnet-address: 192.168.1.0/24 - gateway-address: 192.168.1.1 - dns-address: 8.8.8.8 - dhcp: - enabled: true - start-address: 192.168.1.100 - count: 100 - elements: - - VNFC: VNF_2VMs-VM1 - local_iface_name: xe0 - ip_address: 192.168.1.2 - - VNFC: VNF_2VMs-VM2 - local_iface_name: xe0 - ip_address: 192.168.1.3 - external-connections: - - name: control0 - type: mgmt - VNFC: VNF_2VMs-VM1 - local_iface_name: eth0 - description: control interface VM1 - - name: control1 - type: mgmt - VNFC: VNF_2VMs-VM2 - local_iface_name: eth0 - description: control interface VM2 - - name: in - type: data - VNFC: VNF_2VMs-VM1 - local_iface_name: xe1 - description: Dataplane interface input - - name: out - type: data - VNFC: VNF_2VMs-VM2 - local_iface_name: xe1 - description: Dataplane interface output - VNFC: - - name: VNF_2VMs-VM1 - description: "Dataplane VM1 with 4 threads, 2 GB hugepages, 2 SR-IOV interface" - #Copy the image to a compute path and edit this path - image name: dataplaneVNF_2VMs-image - disk: 10 - numas: - - paired-threads: 2 # "cores", "paired-threads", "threads" - memory: 2 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 1 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - - name: VNF_2VMs-VM2 - description: "Dataplane VM1 with 2 threads, 2 GB hugepages, 2 SR-IOV interface" - #Copy the image to a compute path and edit this path - image name: dataplaneVNF_2VMs-image - disk: 10 - numas: - - paired-threads: 1 # "cores", "paired-threads", "threads" - memory: 2 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 1 Gbps - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "no" - bandwidth: 1 Gbps - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +schema_version: "0.2" +vnf: + name: dataplaneVNF_2VMs_v02_withimagename + description: "Example of a dataplane VNF consisting of two VMs for data plane workloads with one internal network" + # class: parent # Optional. Used to organize VNFs + internal-connections: + - name: datanet + description: datanet + type: e-lan + implementation: underlay + ip-profile: + ip-version: IPv4 + subnet-address: 192.168.1.0/24 + gateway-address: 192.168.1.1 + dns-address: 8.8.8.8 + dhcp: + enabled: true + start-address: 192.168.1.100 + count: 100 + elements: + - VNFC: VNF_2VMs-VM1 + local_iface_name: xe0 + ip_address: 192.168.1.2 + - VNFC: VNF_2VMs-VM2 + local_iface_name: xe0 + ip_address: 192.168.1.3 + external-connections: + - name: control0 + type: mgmt + VNFC: VNF_2VMs-VM1 + local_iface_name: eth0 + description: control interface VM1 + - name: control1 + type: mgmt + VNFC: VNF_2VMs-VM2 + local_iface_name: eth0 + description: control interface VM2 + - name: in + type: data + VNFC: VNF_2VMs-VM1 + local_iface_name: xe1 + description: Dataplane interface input + - name: out + type: data + VNFC: VNF_2VMs-VM2 + local_iface_name: xe1 + description: Dataplane interface output + VNFC: + - name: VNF_2VMs-VM1 + description: "Dataplane VM1 with 4 threads, 2 GB hugepages, 2 SR-IOV interface" + #Copy the image to a compute path and edit this path + image name: dataplaneVNF_2VMs-image + disk: 10 + numas: + - paired-threads: 2 # "cores", "paired-threads", "threads" + memory: 2 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 1 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + + - name: VNF_2VMs-VM2 + description: "Dataplane VM1 with 2 threads, 2 GB hugepages, 2 SR-IOV interface" + #Copy the image to a compute path and edit this path + image name: dataplaneVNF_2VMs-image + disk: 10 + numas: + - paired-threads: 1 # "cores", "paired-threads", "threads" + memory: 2 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 1 Gbps + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "no" + bandwidth: 1 Gbps + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + diff --git a/vnfs/examples/linux.yaml b/vnfs/examples/linux.yaml index 796873fe..a80b71a8 100644 --- a/vnfs/examples/linux.yaml +++ b/vnfs/examples/linux.yaml @@ -1,43 +1,43 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -vnf: - name: linux - description: Single-VM VNF with a traditional cloud VM based on generic Linux OS - external-connections: - - name: eth0 - type: bridge - VNFC: linux-VM - local_iface_name: eth0 - description: General purpose interface - VNFC: - - name: linux-VM - description: Generic Linux Virtual Machine - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/linux.qcow2 - vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). - ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) - disk: 10 - bridge-ifaces: - - name: eth0 - vpci: "0000:00:11.0" - numas: [] - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +vnf: + name: linux + description: Single-VM VNF with a traditional cloud VM based on generic Linux OS + external-connections: + - name: eth0 + type: bridge + VNFC: linux-VM + local_iface_name: eth0 + description: General purpose interface + VNFC: + - name: linux-VM + description: Generic Linux Virtual Machine + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/linux.qcow2 + vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). + ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) + disk: 10 + bridge-ifaces: + - name: eth0 + vpci: "0000:00:11.0" + numas: [] + diff --git a/vnfs/examples/linux_2VMs_v02.yaml b/vnfs/examples/linux_2VMs_v02.yaml index 41b5982f..fa1874be 100644 --- a/vnfs/examples/linux_2VMs_v02.yaml +++ b/vnfs/examples/linux_2VMs_v02.yaml @@ -1,104 +1,104 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -schema_version: "0.2" -vnf: - name: linux_2VMs_v02 - description: "Example of a linux VNF consisting of two VMs with one internal network" - # class: parent # Optional. Used to organize VNFs - internal-connections: - - name: internalnet - description: internalnet - type: e-lan - implementation: overlay - ip-profile: - ip-version: IPv4 - subnet-address: 192.168.1.0/24 - gateway-address: 192.168.1.1 - dns-address: 8.8.8.8 - dhcp: - enabled: true - start-address: 192.168.1.100 - count: 100 - elements: - - VNFC: linux_2VMs-VM1 - local_iface_name: xe0 - ip_address: 192.168.1.2 - - VNFC: linux_2VMs-VM2 - local_iface_name: xe0 - ip_address: 192.168.1.3 - external-connections: - - name: control0 - type: mgmt - VNFC: linux_2VMs-VM1 - local_iface_name: eth0 - description: control interface VM1 - - name: control1 - type: mgmt - VNFC: linux_2VMs-VM2 - local_iface_name: eth0 - description: control interface VM2 - - name: in - type: bridge - VNFC: linux_2VMs-VM1 - local_iface_name: xe1 - description: data interface input - - name: out - type: bridge - VNFC: linux_2VMs-VM2 - local_iface_name: xe1 - description: data interface output - VNFC: - - name: linux_2VMs-VM1 - description: "Linux VM1 with 4 CPUs, 2 GB RAM and 3 bridge interfaces" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/linux_VNF_2VMs.qcow2 - disk: 10 - vcpus: 4 - ram: 2048 - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - name: xe0 - vpci: "0000:00:11.0" - bandwidth: 1 Mbps - - name: xe1 - vpci: "0000:00:12.0" - bandwidth: 1 Mbps - - name: linux_2VMs-VM2 - description: "Linux VM2 with 2 CPUs, 2 GB RAM and 3 bridge interfaces" - #Copy the image to a compute path and edit this path - VNFC image: /path/to/imagefolder/linux_VNF_2VMs.qcow2 - disk: 10 - vcpus: 2 - ram: 2048 - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - name: xe0 - vpci: "0000:00:11.0" - bandwidth: 1 Mbps - - name: xe1 - vpci: "0000:00:12.0" - bandwidth: 1 Mbps - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +schema_version: "0.2" +vnf: + name: linux_2VMs_v02 + description: "Example of a linux VNF consisting of two VMs with one internal network" + # class: parent # Optional. Used to organize VNFs + internal-connections: + - name: internalnet + description: internalnet + type: e-lan + implementation: overlay + ip-profile: + ip-version: IPv4 + subnet-address: 192.168.1.0/24 + gateway-address: 192.168.1.1 + dns-address: 8.8.8.8 + dhcp: + enabled: true + start-address: 192.168.1.100 + count: 100 + elements: + - VNFC: linux_2VMs-VM1 + local_iface_name: xe0 + ip_address: 192.168.1.2 + - VNFC: linux_2VMs-VM2 + local_iface_name: xe0 + ip_address: 192.168.1.3 + external-connections: + - name: control0 + type: mgmt + VNFC: linux_2VMs-VM1 + local_iface_name: eth0 + description: control interface VM1 + - name: control1 + type: mgmt + VNFC: linux_2VMs-VM2 + local_iface_name: eth0 + description: control interface VM2 + - name: in + type: bridge + VNFC: linux_2VMs-VM1 + local_iface_name: xe1 + description: data interface input + - name: out + type: bridge + VNFC: linux_2VMs-VM2 + local_iface_name: xe1 + description: data interface output + VNFC: + - name: linux_2VMs-VM1 + description: "Linux VM1 with 4 CPUs, 2 GB RAM and 3 bridge interfaces" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/linux_VNF_2VMs.qcow2 + disk: 10 + vcpus: 4 + ram: 2048 + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + - name: xe0 + vpci: "0000:00:11.0" + bandwidth: 1 Mbps + - name: xe1 + vpci: "0000:00:12.0" + bandwidth: 1 Mbps + - name: linux_2VMs-VM2 + description: "Linux VM2 with 2 CPUs, 2 GB RAM and 3 bridge interfaces" + #Copy the image to a compute path and edit this path + VNFC image: /path/to/imagefolder/linux_VNF_2VMs.qcow2 + disk: 10 + vcpus: 2 + ram: 2048 + bridge-ifaces: + - name: eth0 + vpci: "0000:00:09.0" + bandwidth: 1 Mbps # Optional, informative only + - name: xe0 + vpci: "0000:00:11.0" + bandwidth: 1 Mbps + - name: xe1 + vpci: "0000:00:12.0" + bandwidth: 1 Mbps + diff --git a/vnfs/vnf-template-2vm.yaml b/vnfs/vnf-template-2vm.yaml index b1615db3..2e0970ab 100644 --- a/vnfs/vnf-template-2vm.yaml +++ b/vnfs/vnf-template-2vm.yaml @@ -1,184 +1,184 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -vnf: - name: TEMPLATE-2VM - description: This is a template to help in the creation of multi-VM VNFs - # class: parent # Optional. Used to organize VNFs - internal-connections: - - name: datanet - description: datanet - type: data - elements: - - VNFC: VirtualMachine-1 - local_iface_name: xe0 - - VNFC: VirtualMachine-2 - local_iface_name: xe0 - - name: controlnet - description: controlnet - type: bridge - elements: - - VNFC: VirtualMachine-1 - local_iface_name: ge0 - - VNFC: VirtualMachine-2 - local_iface_name: ge0 - external-connections: - - name: mgmt0 - type: mgmt # "mgmt" (autoconnect to management net), "bridge", "data" - VNFC: VirtualMachine-1 # Virtual Machine this interface belongs to - local_iface_name: mgmt0 # interface name inside this Virtual Machine (must be defined in the VNFC section) - description: Management interface 1 - - name: mgmt1 - type: mgmt # "mgmt" (autoconnect to management net), "bridge", "data" - VNFC: VirtualMachine-2 # Virtual Machine this interface belongs to - local_iface_name: mgmt0 # interface name inside this Virtual Machine (must be defined in the VNFC section) - description: Management interface 2 - - name: data0 - type: data # "mgmt" (autoconnect to management net), "bridge", "data" - VNFC: VirtualMachine-1 # Virtual Machine this interface belongs to - local_iface_name: xe1 # interface name inside this Virtual Machine (must be defined in the VNFC section) - description: Data interface 1 - - name: data1 - type: data # "mgmt" (autoconnect to management net), "bridge", "data" - VNFC: VirtualMachine-2 # Virtual Machine this interface belongs to - local_iface_name: xe1 # interface name inside this Virtual Machine (must be defined in the VNFC section) - description: Data interface 2 - VNFC: # Virtual machine array - # First Virtual Machine - - name: VirtualMachine-1 # name of Virtual Machine - description: VM 1 in the MultiVM template - VNFC image: /path/to/imagefolder/TEMPLATE-2VM-VM1.qcow2 - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } #Optional - # processor: #Optional - # model: Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz - # features: ["64b", "iommu", "lps", "tlbps", "hwsv", "dioc", "ht"] - # hypervisor: #Optional - # type: QEMU-kvm - # version: "10002|12001|2.6.32-358.el6.x86_64" - # vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). - # ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) - # disk: 10 # disk size in GiB, by default 1 - numas: - - paired-threads: 5 # "cores", "paired-threads", "threads" - paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9] ] # By default follows incremental order - memory: 14 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 10 Gbps - #mac_address: '20:33:45:56:77:44' #avoid this option if possible - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "yes" - bandwidth: 10 Gbps - #mac_address: '20:33:45:56:77:45' #avoid this option if possible - bridge-ifaces: - - name: mgmt0 - vpci: "0000:00:09.0" # Optional. Virtual PCI address - bandwidth: 1 Mbps # Optional. Informative only - # mac_address: '20:33:45:56:77:46' #avoid this option if possible - # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt - - name: ge0 - vpci: "0000:00:10.0" - bandwidth: 1 Mbps - # mac_address: '20:33:45:56:77:47' # avoid this option if possible - # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt - devices: # Optional, order determines device letter asignation (hda, hdb, ...) - - type: disk # "disk","cdrom","xml" - image: /path/to/imagefolder/SECOND-DISK.qcow2 - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } - # vpci: "0000:00:03.0" # Optional, not for disk or cdrom - - type: cdrom - image: /path/to/imagefolder/CDROM-IMAGE.qcow2 - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } - - type: xml - image: /path/to/imagefolder/ADDITIONAL-DISK.qcow2 # Optional, depending on the device type - image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } # Optional, depending on the device type - vpci: "0000:00:03.0" # Optional, depending on the device type (not needed for disk or cdrom) - xml: ' xml text for XML described devices. Do not use single quotes inside - The following words, if found, will be replaced: - __file__ by image path, (image must be provided) - __format__ by qcow2 or raw (image must be provided) - __dev__ by device letter (b, c, d ...) - __vpci__ by vpci (vpci must be provided) - ' - # Second Virtual Machine - - name: VirtualMachine-2 # name of Virtual Machine - description: VM 2 in the MultiVM template - VNFC image: /path/to/imagefolder/TEMPLATE-2VM-VM1.qcow2 # In this case, it is the same as VirtualMachine-1, but it could have been different - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } #Optional - # processor: #Optional - # model: Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz - # features: ["64b", "iommu", "lps", "tlbps", "hwsv", "dioc", "ht"] - # hypervisor: #Optional - # type: QEMU-kvm - # version: "10002|12001|2.6.32-358.el6.x86_64" - # vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). - # ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) - # disk: 10 # disk size in GiB, by default 1 - numas: - - paired-threads: 5 # "cores", "paired-threads", "threads" - paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9] ] # By default follows incremental order - memory: 14 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 10 Gbps - #mac_address: '20:33:45:56:77:44' #avoid this option if possible - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "yes" - bandwidth: 10 Gbps - #mac_address: '20:33:45:56:77:45' #avoid this option if possible - bridge-ifaces: - - name: mgmt0 - vpci: "0000:00:09.0" # Optional - bandwidth: 1 Mbps # Optional, informative only - # mac_address: '20:33:45:56:77:46' #avoid this option if possible - # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt - - name: ge0 - vpci: "0000:00:10.0" - bandwidth: 1 Mbps - # mac_address: '20:33:45:56:77:47' #avoid this option if possible - # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt - devices: # Optional, order determines device letter asignation (hda, hdb, ...) - - type: disk # "disk","cdrom","xml" - image: /path/to/imagefolder/SECOND-DISK.qcow2 - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } - # vpci: "0000:00:03.0" # Optional, not for disk or cdrom - - type: cdrom - image: /path/to/imagefolder/CDROM-IMAGE.qcow2 - #image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } - - type: xml - image: /path/to/imagefolder/ADDITIONAL-DISK.qcow2 # Optional, depending on the device type - image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } # Optional, depending on the device type - vpci: "0000:00:03.0" # Optional, depending on the device type (not needed for disk or cdrom) - xml: ' xml text for XML described devices. Do not use single quotes inside - The following words, if found, will be replaced: - __file__ by image path, (image must be provided) - __format__ by qcow2 or raw (image must be provided) - __dev__ by device letter (b, c, d ...) - __vpci__ by vpci (vpci must be provided) - ' - # Additional Virtual Machines can be included here - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +vnf: + name: TEMPLATE-2VM + description: This is a template to help in the creation of multi-VM VNFs + # class: parent # Optional. Used to organize VNFs + internal-connections: + - name: datanet + description: datanet + type: data + elements: + - VNFC: VirtualMachine-1 + local_iface_name: xe0 + - VNFC: VirtualMachine-2 + local_iface_name: xe0 + - name: controlnet + description: controlnet + type: bridge + elements: + - VNFC: VirtualMachine-1 + local_iface_name: ge0 + - VNFC: VirtualMachine-2 + local_iface_name: ge0 + external-connections: + - name: mgmt0 + type: mgmt # "mgmt" (autoconnect to management net), "bridge", "data" + VNFC: VirtualMachine-1 # Virtual Machine this interface belongs to + local_iface_name: mgmt0 # interface name inside this Virtual Machine (must be defined in the VNFC section) + description: Management interface 1 + - name: mgmt1 + type: mgmt # "mgmt" (autoconnect to management net), "bridge", "data" + VNFC: VirtualMachine-2 # Virtual Machine this interface belongs to + local_iface_name: mgmt0 # interface name inside this Virtual Machine (must be defined in the VNFC section) + description: Management interface 2 + - name: data0 + type: data # "mgmt" (autoconnect to management net), "bridge", "data" + VNFC: VirtualMachine-1 # Virtual Machine this interface belongs to + local_iface_name: xe1 # interface name inside this Virtual Machine (must be defined in the VNFC section) + description: Data interface 1 + - name: data1 + type: data # "mgmt" (autoconnect to management net), "bridge", "data" + VNFC: VirtualMachine-2 # Virtual Machine this interface belongs to + local_iface_name: xe1 # interface name inside this Virtual Machine (must be defined in the VNFC section) + description: Data interface 2 + VNFC: # Virtual machine array + # First Virtual Machine + - name: VirtualMachine-1 # name of Virtual Machine + description: VM 1 in the MultiVM template + VNFC image: /path/to/imagefolder/TEMPLATE-2VM-VM1.qcow2 + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } #Optional + # processor: #Optional + # model: Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz + # features: ["64b", "iommu", "lps", "tlbps", "hwsv", "dioc", "ht"] + # hypervisor: #Optional + # type: QEMU-kvm + # version: "10002|12001|2.6.32-358.el6.x86_64" + # vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). + # ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) + # disk: 10 # disk size in GiB, by default 1 + numas: + - paired-threads: 5 # "cores", "paired-threads", "threads" + paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9] ] # By default follows incremental order + memory: 14 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 10 Gbps + #mac_address: '20:33:45:56:77:44' #avoid this option if possible + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "yes" + bandwidth: 10 Gbps + #mac_address: '20:33:45:56:77:45' #avoid this option if possible + bridge-ifaces: + - name: mgmt0 + vpci: "0000:00:09.0" # Optional. Virtual PCI address + bandwidth: 1 Mbps # Optional. Informative only + # mac_address: '20:33:45:56:77:46' #avoid this option if possible + # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt + - name: ge0 + vpci: "0000:00:10.0" + bandwidth: 1 Mbps + # mac_address: '20:33:45:56:77:47' # avoid this option if possible + # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt + devices: # Optional, order determines device letter asignation (hda, hdb, ...) + - type: disk # "disk","cdrom","xml" + image: /path/to/imagefolder/SECOND-DISK.qcow2 + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } + # vpci: "0000:00:03.0" # Optional, not for disk or cdrom + - type: cdrom + image: /path/to/imagefolder/CDROM-IMAGE.qcow2 + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } + - type: xml + image: /path/to/imagefolder/ADDITIONAL-DISK.qcow2 # Optional, depending on the device type + image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } # Optional, depending on the device type + vpci: "0000:00:03.0" # Optional, depending on the device type (not needed for disk or cdrom) + xml: ' xml text for XML described devices. Do not use single quotes inside + The following words, if found, will be replaced: + __file__ by image path, (image must be provided) + __format__ by qcow2 or raw (image must be provided) + __dev__ by device letter (b, c, d ...) + __vpci__ by vpci (vpci must be provided) + ' + # Second Virtual Machine + - name: VirtualMachine-2 # name of Virtual Machine + description: VM 2 in the MultiVM template + VNFC image: /path/to/imagefolder/TEMPLATE-2VM-VM1.qcow2 # In this case, it is the same as VirtualMachine-1, but it could have been different + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } #Optional + # processor: #Optional + # model: Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz + # features: ["64b", "iommu", "lps", "tlbps", "hwsv", "dioc", "ht"] + # hypervisor: #Optional + # type: QEMU-kvm + # version: "10002|12001|2.6.32-358.el6.x86_64" + # vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). + # ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) + # disk: 10 # disk size in GiB, by default 1 + numas: + - paired-threads: 5 # "cores", "paired-threads", "threads" + paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9] ] # By default follows incremental order + memory: 14 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 10 Gbps + #mac_address: '20:33:45:56:77:44' #avoid this option if possible + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "yes" + bandwidth: 10 Gbps + #mac_address: '20:33:45:56:77:45' #avoid this option if possible + bridge-ifaces: + - name: mgmt0 + vpci: "0000:00:09.0" # Optional + bandwidth: 1 Mbps # Optional, informative only + # mac_address: '20:33:45:56:77:46' #avoid this option if possible + # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt + - name: ge0 + vpci: "0000:00:10.0" + bandwidth: 1 Mbps + # mac_address: '20:33:45:56:77:47' #avoid this option if possible + # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt + devices: # Optional, order determines device letter asignation (hda, hdb, ...) + - type: disk # "disk","cdrom","xml" + image: /path/to/imagefolder/SECOND-DISK.qcow2 + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } + # vpci: "0000:00:03.0" # Optional, not for disk or cdrom + - type: cdrom + image: /path/to/imagefolder/CDROM-IMAGE.qcow2 + #image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } + - type: xml + image: /path/to/imagefolder/ADDITIONAL-DISK.qcow2 # Optional, depending on the device type + image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } # Optional, depending on the device type + vpci: "0000:00:03.0" # Optional, depending on the device type (not needed for disk or cdrom) + xml: ' xml text for XML described devices. Do not use single quotes inside + The following words, if found, will be replaced: + __file__ by image path, (image must be provided) + __format__ by qcow2 or raw (image must be provided) + __dev__ by device letter (b, c, d ...) + __vpci__ by vpci (vpci must be provided) + ' + # Additional Virtual Machines can be included here + diff --git a/vnfs/vnf-template.yaml b/vnfs/vnf-template.yaml index 5b33512d..121c5abb 100644 --- a/vnfs/vnf-template.yaml +++ b/vnfs/vnf-template.yaml @@ -1,107 +1,107 @@ -## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. -# This file is part of openmano -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: nfvlabs@tid.es -## ---- -vnf: - name: TEMPLATE - description: This is a template to help in the creation of your own VNFs - # class: parent # Optional. Used to organize VNFs - external-connections: - - name: mgmt0 - type: mgmt # "mgmt" (autoconnect to management net), "bridge", "data" - VNFC: TEMPLATE-VM # Virtual Machine this interface belongs to - local_iface_name: mgmt0 # interface name inside this Virtual Machine (must be defined in the VNFC section) - description: Management interface - - name: xe0 - type: data - VNFC: TEMPLATE-VM - local_iface_name: xe0 - description: Data interface 1 - - name: xe1 - type: data - VNFC: TEMPLATE-VM - local_iface_name: xe1 - description: Data interface 2 - - name: ge0 - type: bridge - VNFC: TEMPLATE-VM - local_iface_name: ge0 - description: Bridge interface - VNFC: # Virtual machine array - - name: TEMPLATE-VM # name of Virtual Machine - description: TEMPLATE description - VNFC image: /path/to/imagefolder/TEMPLATE-VM.qcow2 - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } #Optional - # processor: #Optional - # model: Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz - # features: ["64b", "iommu", "lps", "tlbps", "hwsv", "dioc", "ht"] - # hypervisor: #Optional - # type: QEMU-kvm - # version: "10002|12001|2.6.32-358.el6.x86_64" - # vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). - # ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) - # disk: 10 # disk size in GiB, by default 1 - numas: - - paired-threads: 5 # "cores", "paired-threads", "threads" - paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9] ] # By default follows incremental order - memory: 14 # GBytes - interfaces: - - name: xe0 - vpci: "0000:00:11.0" - dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) - bandwidth: 10 Gbps - # mac_address: '20:33:45:56:77:44' #avoid this option if possible - - name: xe1 - vpci: "0000:00:12.0" - dedicated: "yes" - bandwidth: 10 Gbps - # mac_address: '20:33:45:56:77:45' #avoid this option if possible - bridge-ifaces: - - name: mgmt0 - vpci: "0000:00:09.0" # Optional. Virtual PCI address - bandwidth: 1 Mbps # Optional. Informative only - # mac_address: '20:33:45:56:77:46' #avoid this option if possible - # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt - - name: ge0 - vpci: "0000:00:10.0" - bandwidth: 1 Mbps - # mac_address: '20:33:45:56:77:47' #avoid this option if possible - # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt - devices: # Optional, order determines device letter asignation (hda, hdb, ...) - - type: disk # "disk","cdrom","xml" - image: /path/to/imagefolder/SECOND-DISK.qcow2 - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } - # vpci: "0000:00:03.0" # Optional, not for disk or cdrom - - type: cdrom - image: /path/to/imagefolder/CDROM-IMAGE.qcow2 - # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } - - type: xml - image: /path/to/imagefolder/ADDITIONAL-DISK.qcow2 # Optional, depending on the device type - image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } # Optional, depending on the device type - vpci: "0000:00:03.0" # Optional, depending on the device type (not needed for disk or cdrom) - xml: ' xml text for XML described devices. Do not use single quotes inside - The following words, if found, will be replaced: - __file__ by image path, (image must be provided) - __format__ by qcow2 or raw (image must be provided) - __dev__ by device letter (b, c, d ...) - __vpci__ by vpci (vpci must be provided) - ' - # Additional Virtual Machines would be included here - +## +# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# This file is part of openmano +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## +--- +vnf: + name: TEMPLATE + description: This is a template to help in the creation of your own VNFs + # class: parent # Optional. Used to organize VNFs + external-connections: + - name: mgmt0 + type: mgmt # "mgmt" (autoconnect to management net), "bridge", "data" + VNFC: TEMPLATE-VM # Virtual Machine this interface belongs to + local_iface_name: mgmt0 # interface name inside this Virtual Machine (must be defined in the VNFC section) + description: Management interface + - name: xe0 + type: data + VNFC: TEMPLATE-VM + local_iface_name: xe0 + description: Data interface 1 + - name: xe1 + type: data + VNFC: TEMPLATE-VM + local_iface_name: xe1 + description: Data interface 2 + - name: ge0 + type: bridge + VNFC: TEMPLATE-VM + local_iface_name: ge0 + description: Bridge interface + VNFC: # Virtual machine array + - name: TEMPLATE-VM # name of Virtual Machine + description: TEMPLATE description + VNFC image: /path/to/imagefolder/TEMPLATE-VM.qcow2 + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } #Optional + # processor: #Optional + # model: Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz + # features: ["64b", "iommu", "lps", "tlbps", "hwsv", "dioc", "ht"] + # hypervisor: #Optional + # type: QEMU-kvm + # version: "10002|12001|2.6.32-358.el6.x86_64" + # vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). + # ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) + # disk: 10 # disk size in GiB, by default 1 + numas: + - paired-threads: 5 # "cores", "paired-threads", "threads" + paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9] ] # By default follows incremental order + memory: 14 # GBytes + interfaces: + - name: xe0 + vpci: "0000:00:11.0" + dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) + bandwidth: 10 Gbps + # mac_address: '20:33:45:56:77:44' #avoid this option if possible + - name: xe1 + vpci: "0000:00:12.0" + dedicated: "yes" + bandwidth: 10 Gbps + # mac_address: '20:33:45:56:77:45' #avoid this option if possible + bridge-ifaces: + - name: mgmt0 + vpci: "0000:00:09.0" # Optional. Virtual PCI address + bandwidth: 1 Mbps # Optional. Informative only + # mac_address: '20:33:45:56:77:46' #avoid this option if possible + # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt + - name: ge0 + vpci: "0000:00:10.0" + bandwidth: 1 Mbps + # mac_address: '20:33:45:56:77:47' #avoid this option if possible + # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt + devices: # Optional, order determines device letter asignation (hda, hdb, ...) + - type: disk # "disk","cdrom","xml" + image: /path/to/imagefolder/SECOND-DISK.qcow2 + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } + # vpci: "0000:00:03.0" # Optional, not for disk or cdrom + - type: cdrom + image: /path/to/imagefolder/CDROM-IMAGE.qcow2 + # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } + - type: xml + image: /path/to/imagefolder/ADDITIONAL-DISK.qcow2 # Optional, depending on the device type + image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } # Optional, depending on the device type + vpci: "0000:00:03.0" # Optional, depending on the device type (not needed for disk or cdrom) + xml: ' xml text for XML described devices. Do not use single quotes inside + The following words, if found, will be replaced: + __file__ by image path, (image must be provided) + __format__ by qcow2 or raw (image must be provided) + __dev__ by device letter (b, c, d ...) + __vpci__ by vpci (vpci must be provided) + ' + # Additional Virtual Machines would be included here +