├── LICENSE ├── README.md ├── docs └── openvim-api-0.6.pdf ├── images ├── descriptors │ ├── example-complex.png │ ├── example-dataplanevnf1.png │ ├── example-dataplanevnf2.png │ ├── example-linux.png │ ├── example-simple.png │ ├── scenario-template.png │ ├── vnf-template-2vm.png │ └── vnf-template.png ├── openmano-architecture.png ├── openmano-nfv.png └── openmano.png ├── openmano-gui ├── config.php ├── css │ ├── 32px.png │ ├── 40px.png │ ├── jstree.min.css │ ├── throbber.gif │ └── tidgui.css ├── get_hosts.php ├── get_scenarios.php ├── get_tenants_datacenters.php ├── get_vnfs.php ├── images │ ├── big │ │ ├── bridge_net.png │ │ ├── dataplane_net.png │ │ ├── nube.png │ │ └── vnf_default.png │ ├── ifaces │ │ ├── Eth-d.png │ │ ├── Eth-m.png │ │ ├── Eth-v.png │ │ └── IfacePosition.png │ ├── minus_icon.gif │ ├── nfvlabs_.png │ ├── physical │ │ └── server.png │ ├── plus_icon.gif │ └── small │ │ ├── bridge_net.png │ │ ├── dataplane_net.png │ │ ├── instance.png │ │ ├── nube.png │ │ ├── scenario.png │ │ ├── vm_ACTIVE.png │ │ ├── vm_CREATING.png │ │ ├── vm_ERROR.png │ │ ├── vm_INACTIVE.png │ │ ├── vm_PAUSED.png │ │ └── vnf_default.png ├── index.html ├── js │ ├── common.js │ ├── contextmenu.js │ ├── jquery-ui-1.9.2-min.js │ ├── js-yaml.js │ ├── jstree.min.js │ └── scenario_utils.js ├── physical.php ├── scenario.php ├── scenario_id.php ├── scenario_new.php └── vnfs.php ├── openmano ├── console_proxy_thread.py ├── database_utils │ ├── dump_db.sh │ ├── init_mano_db.sh │ ├── mano_db_structure.sql │ └── migrate_mano_db.sh ├── httpserver.py ├── nfvo.py ├── nfvo_db.py ├── openmano ├── openmano_schemas.py ├── openmanoclient.py ├── openmanoconfig.sh ├── openmanod.cfg ├── openmanod.py ├── scenarios │ ├── examples │ │ ├── complex.yaml │ │ ├── complex2.yaml │ │ └── simple.yaml │ ├── scenario-template.yaml │ └── scenario-template2.yaml ├── test │ ├── test-multivim.sh │ ├── test_openmanoclient.py │ ├── test_osconnector.py │ └── test_vimconn.sh ├── utils.py ├── vimconn.py ├── vimconn_openstack.py ├── vimconn_openvim.py └── vnfs │ ├── examples │ ├── dataplaneVNF1.yaml │ ├── dataplaneVNF2.yaml │ ├── dataplaneVNF3.yaml │ ├── dataplaneVNF_2VMs.yaml │ └── linux.yaml │ ├── vnf-template-2vm.yaml │ └── vnf-template.yaml ├── openvim ├── ODL.py ├── database_utils │ ├── dump_db.sh │ ├── host_ranking.sql │ ├── init_vim_db.sh │ ├── migrate_vim_db.sh │ ├── nets.sql │ ├── of_ports_pci_correspondence.sql │ └── vim_db_structure.sql ├── dhcp_thread.py ├── floodlight.py ├── host_thread.py ├── httpserver.py ├── openflow ├── openflow_thread.py ├── openvim ├── openvimconfig.sh ├── openvimd.cfg ├── openvimd.py ├── templates │ ├── flavor.yaml │ ├── image.yaml │ ├── network.yaml │ ├── port.yaml │ ├── server.yaml │ └── tenant.yaml ├── test │ ├── 2VM_2I.sh │ ├── 2VM_2I_2VLAN.sh │ ├── 2VM_NoHuge.sh │ ├── flavors │ │ ├── 2Th_2G.yaml │ │ ├── 5PTh_8G_2I.yaml │ │ └── new_flavor.yaml │ ├── get_params.sh │ ├── hosts │ │ ├── host-example0.json │ │ ├── host-example1.json │ │ ├── host-example2.json │ │ ├── host-example3.json │ │ └── new_host.yaml │ ├── images │ │ └── new_image.yaml │ ├── networks │ │ ├── net-example0.yaml │ │ ├── net-example1.yaml │ │ ├── net-example2.yaml │ │ ├── net-example3.yaml │ │ └── new_network.yaml │ ├── ports │ │ └── new_port.yaml │ ├── servers │ │ └── new_server.yaml │ ├── tenants │ │ └── new_tenant.yaml │ ├── test_openflow.sh │ ├── test_openvim.py │ └── test_vim.sh ├── utils │ ├── RADclass.py │ ├── __init__.py │ ├── auxiliary_functions.py │ └── definitionsClass.py ├── vim_db.py └── vim_schema.py └── scripts ├── configure-compute-node-RHEL7.1.sh ├── configure-compute-node-UBUNTU14.04.sh ├── configure-compute-node-develop.sh ├── flow-logback.xml ├── flow.properties ├── flow.properties_v1.1 ├── host-add-develop.sh ├── host-add.sh ├── initopenmano.sh ├── install-openmano.sh ├── openmano-report.sh ├── service-openmano.sh ├── start-all.sh ├── start-openflow.sh ├── start-openmano.sh └── start-openvim.sh /README.md: -------------------------------------------------------------------------------- 1 | _**This page is obsolete.**_ 2 | 3 | _**The project OpenMANO has been contributed to the open source community project Open Source MANO (OSM), hosted by ETSI.**_ 4 | 5 | _**Go to the URL [osm.etsi.org](https://osm.etsi.org) to know more about OSM.**_ 6 | 7 | *** 8 | 9 | openmano 10 | 11 | **OpenMANO** is an open source project that provides a practical implementation of the reference architecture for Management & Orchestration under standardization at ETSI’s NFV ISG ([NFV MANO](http://www.etsi.org/deliver/etsi_gs/NFV/001_099/002/01.01.01_60/gs_NFV002v010101p.pdf)). It consists of three main SW components: 12 | 13 | - **openvim**: reference implementation of an NFV VIM (Virtualised Infrastructure Manager). It interfaces with the compute nodes in the NFV Infrastructure and an openflow controller in order to provide computing and networking capabilities and to deploy virtual machines. It offers a northbound interface, based on REST ([openvim API](http://github.com/nfvlabs/openmano/raw/master/docs/openvim-api-0.6.pdf "openvim API")), where enhanced cloud services are offered including the creation, deletion and management of images, flavors, instances and networks. The implementation follows the recommendations in [NFV-PER001](http://www.etsi.org/deliver/etsi_gs/NFV-PER/001_099/001/01.01.02_60/gs_NFV-PER001v010102p.pdf "ETSI NFV PER001"). 14 | - **openmano**: reference implementation of an NFV-O (Network Functions Virtualisation Orchestrator). It interfaces with an NFV VIM through its API and offers a northbound interface, based on REST (openmano API), where NFV services are offered including the creation and deletion of VNF templates, VNF instances, network service templates and network service instances. 15 | - **openmano-gui**: web GUI to interact with openmano server, through its northbound API, in a friendly way. 16 | 17 | openmano-nfv 18 | 19 | #Releases 20 | 21 | The relevant releases/branches in openmano are the following: 22 | 23 | - **v0.4**: current stable release for normal use. Supports several datacenters, openstack as a VIM, opendaylight as openflow controller 24 | - v0.3: old stable release version 25 | - **master**: development branch intended for contributors, with new features that will be incorporated into the stable release 26 | 27 | #Quick installation of current release (v0.4) 28 | 29 | - Download e.g. a [Ubuntu Server 14.04 LTS](http://virtualboxes.org/images/ubuntu-server) (ubuntu/reverse). Other tested distributions are [Ubuntu Desktop 64bits 14.04.2 LTS](http://sourceforge.net/projects/osboxes/files/vms/vbox/Ubuntu/14.04/14.04.2/Ubuntu_14.04.2-64bit.7z/download) (osboxes/osboxes.org), [CentOS 7](http://sourceforge.net/projects/osboxes/files/vms/vbox/CentOS/CentOS_7-x86_64.7z/download) (osboxes/osboxes.org) 30 | - Start the VM and execute the following command in a terminal: 31 | 32 | wget https://github.com/nfvlabs/openmano/raw/v0.4/scripts/install-openmano.sh 33 | chmod +x install-openmano.sh 34 | sudo ./install-openmano.sh [ []] 35 | #NOTE: you can provide optionally the DB root user and password. 36 | 37 | Manual installation can be done following these [instructions](https://github.com/nfvlabs/openmano/wiki/Getting-started#manual-installation). 38 | 39 | #Full documentation 40 | - [Getting started](https://github.com/nfvlabs/openmano/wiki/Getting-started "getting started") 41 | - [Compute node configuration](https://github.com/nfvlabs/openmano/wiki/Compute-node-configuration "compute node configuration") 42 | - [Openmano NFV descriptors](https://github.com/nfvlabs/openmano/wiki/openmano-descriptors "openmano descriptors") 43 | - [Openmano usage manual](https://github.com/nfvlabs/openmano/wiki/openmano-usage "openmano usage manual") 44 | - [Openvim usage manual](https://github.com/nfvlabs/openmano/wiki/openvim-usage "openvim usage manual") 45 | - [Openmano API](https://github.com/nfvlabs/openmano/wiki/openmano-api "openmano API") 46 | - [Openvim API](https://github.com/nfvlabs/openmano/raw/master/docs/openvim-api-0.6.pdf "openvim API") 47 | - [Guidelines for developers](https://github.com/nfvlabs/openmano/wiki/guidelines-for-developers "guidelines for developers") 48 | 49 | #License 50 | Check the [License](https://github.com/nfvlabs/openmano/blob/master/LICENSE "license") file. 51 | 52 | #Contact 53 | For bug reports or clarification, contact [nfvlabs@tid.es](mailto:nfvlabs@tid.es "nfvlabs") 54 | 55 | -------------------------------------------------------------------------------- /docs/openvim-api-0.6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/docs/openvim-api-0.6.pdf -------------------------------------------------------------------------------- /images/descriptors/example-complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/example-complex.png -------------------------------------------------------------------------------- /images/descriptors/example-dataplanevnf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/example-dataplanevnf1.png -------------------------------------------------------------------------------- /images/descriptors/example-dataplanevnf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/example-dataplanevnf2.png -------------------------------------------------------------------------------- /images/descriptors/example-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/example-linux.png -------------------------------------------------------------------------------- /images/descriptors/example-simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/example-simple.png -------------------------------------------------------------------------------- /images/descriptors/scenario-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/scenario-template.png -------------------------------------------------------------------------------- /images/descriptors/vnf-template-2vm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/vnf-template-2vm.png -------------------------------------------------------------------------------- /images/descriptors/vnf-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/descriptors/vnf-template.png -------------------------------------------------------------------------------- /images/openmano-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/openmano-architecture.png -------------------------------------------------------------------------------- /images/openmano-nfv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/openmano-nfv.png -------------------------------------------------------------------------------- /images/openmano.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/images/openmano.png -------------------------------------------------------------------------------- /openmano-gui/config.php: -------------------------------------------------------------------------------- 1 | 68 | -------------------------------------------------------------------------------- /openmano-gui/css/32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/css/32px.png -------------------------------------------------------------------------------- /openmano-gui/css/40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/css/40px.png -------------------------------------------------------------------------------- /openmano-gui/css/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/css/throbber.gif -------------------------------------------------------------------------------- /openmano-gui/get_hosts.php: -------------------------------------------------------------------------------- 1 | connect_error) { 40 | echo "Internal error: connection to database error"; 41 | die("Connection failed: " . $conn_vim->connect_error); 42 | } 43 | 44 | $sql = "SELECT uuid, name, description FROM hosts ORDER BY name"; 45 | $result = $conn_vim->query($sql); 46 | if ($result->num_rows > 0) { 47 | 48 | while($host = $result->fetch_assoc()) { 49 | echo "

\n"; 50 | echo " \n"; 51 | echo " \n"; 52 | echo " {$host['name']}\n"; 53 | echo "

\n"; 54 | 55 | //get instances 56 | $sql = "SELECT uuid, name, description, status, last_error " . 57 | "FROM instances " . 58 | "WHERE host_id='{$host['uuid']}'" . 59 | "ORDER BY name"; 60 | $result2 = $conn_vim->query($sql); 61 | if ($result2->num_rows > 0) { 62 | echo "
\n"; 63 | while($instance = $result2->fetch_assoc()) { 64 | if ($instance['status'] == "ERROR") 65 | $title = $instance['last_error']; 66 | else 67 | $title = $instance['description']; 68 | echo "

\n"; 69 | echo " {$instance['name']}\n"; 70 | echo "

\n"; 71 | } 72 | echo "
\n"; 73 | } 74 | } 75 | } else { 76 | echo "NO HOSTS"; 77 | } 78 | $conn_vim->close(); 79 | } 80 | 81 | 82 | ?> 83 | 84 | 85 | -------------------------------------------------------------------------------- /openmano-gui/get_tenants_datacenters.php: -------------------------------------------------------------------------------- 1 | connect_error) { 46 | die("Connection failed: " . $conn->connect_error); 47 | } 48 | 49 | $sql = "SELECT uuid,name FROM nfvo_tenants ORDER BY created_at"; 50 | $result = $conn->query($sql); 51 | if ($result->num_rows > 0) { 52 | 53 | while($nodo = $result->fetch_assoc()) { 54 | 55 | #array_push($tenants, " '{$nodo['uuid']}':{'type':'VNF','model': '{$nodo['name']}', 'img':'{$image_big}','description':'{$nodo['description']}','ifaces':{\n "); 56 | if ($echoPhp==true){ 57 | echo "\t\t\t\t\t\t\n"; 58 | } 59 | } 60 | } 61 | } 62 | 63 | ?> 64 | 65 | 66 | -------------------------------------------------------------------------------- /openmano-gui/images/big/bridge_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/big/bridge_net.png -------------------------------------------------------------------------------- /openmano-gui/images/big/dataplane_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/big/dataplane_net.png -------------------------------------------------------------------------------- /openmano-gui/images/big/nube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/big/nube.png -------------------------------------------------------------------------------- /openmano-gui/images/big/vnf_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/big/vnf_default.png -------------------------------------------------------------------------------- /openmano-gui/images/ifaces/Eth-d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/ifaces/Eth-d.png -------------------------------------------------------------------------------- /openmano-gui/images/ifaces/Eth-m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/ifaces/Eth-m.png -------------------------------------------------------------------------------- /openmano-gui/images/ifaces/Eth-v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/ifaces/Eth-v.png -------------------------------------------------------------------------------- /openmano-gui/images/ifaces/IfacePosition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/ifaces/IfacePosition.png -------------------------------------------------------------------------------- /openmano-gui/images/minus_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/minus_icon.gif -------------------------------------------------------------------------------- /openmano-gui/images/nfvlabs_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/nfvlabs_.png -------------------------------------------------------------------------------- /openmano-gui/images/physical/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/physical/server.png -------------------------------------------------------------------------------- /openmano-gui/images/plus_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/plus_icon.gif -------------------------------------------------------------------------------- /openmano-gui/images/small/bridge_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/bridge_net.png -------------------------------------------------------------------------------- /openmano-gui/images/small/dataplane_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/dataplane_net.png -------------------------------------------------------------------------------- /openmano-gui/images/small/instance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/instance.png -------------------------------------------------------------------------------- /openmano-gui/images/small/nube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/nube.png -------------------------------------------------------------------------------- /openmano-gui/images/small/scenario.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/scenario.png -------------------------------------------------------------------------------- /openmano-gui/images/small/vm_ACTIVE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/vm_ACTIVE.png -------------------------------------------------------------------------------- /openmano-gui/images/small/vm_CREATING.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/vm_CREATING.png -------------------------------------------------------------------------------- /openmano-gui/images/small/vm_ERROR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/vm_ERROR.png -------------------------------------------------------------------------------- /openmano-gui/images/small/vm_INACTIVE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/vm_INACTIVE.png -------------------------------------------------------------------------------- /openmano-gui/images/small/vm_PAUSED.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/vm_PAUSED.png -------------------------------------------------------------------------------- /openmano-gui/images/small/vnf_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openmano-gui/images/small/vnf_default.png -------------------------------------------------------------------------------- /openmano-gui/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | Page Redirection 10 | 11 | 12 | 13 | If you are not redirected automatically, follow the link 14 | 15 | 16 | -------------------------------------------------------------------------------- /openmano-gui/js/common.js: -------------------------------------------------------------------------------- 1 | /** 2 | ## 3 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 4 | # This file is part of openmano 5 | # All Rights Reserved. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | # not use this file except in compliance with the License. You may obtain 9 | # a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | # License for the specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | # For those usages not covered by the Apache License, Version 2.0 please 20 | # contact with: nfvlabs@tid.es 21 | ## 22 | 23 | 24 | Author: Alfonso Tierno, Gerardo Garcia 25 | Version: 0.50 26 | Date: Feb 2015 27 | */ 28 | 29 | 30 | 31 | /** 32 | * Common initialitation for sevaral pages. 33 | */ 34 | $(document).ready(function(){ 35 | $("#menu_scenario").click(function(){ location.assign("scenario.php"); }); 36 | $("#menu_vnf").click(function(){ location.assign("vnfs.php"); }); 37 | $("#menu_physical").click(function(){ location.assign("physical.php"); }); 38 | 39 | $(".minus").click(function(){ 40 | //console.log("click on minus " + this.id); 41 | var div_id = this.id; 42 | div_id = div_id.slice(0, div_id.length-1); 43 | $("#" + div_id ).toggle(); 44 | if (this.src.match("minus_icon.gif") ) 45 | this.src = "images/plus_icon.gif"; 46 | else 47 | this.src = "images/minus_icon.gif"; 48 | }); 49 | 50 | }); 51 | 52 | 53 | -------------------------------------------------------------------------------- /openmano-gui/js/contextmenu.js: -------------------------------------------------------------------------------- 1 | /** 2 | https://github.com/joewalnes/jquery-simple-context-menu 3 | Copyright (c) 2011, Joe Walnes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | */ 23 | 24 | jQuery.fn.contextPopup = function(menuData) { 25 | 26 | // Build popup menu HTML 27 | function createMenu() { 28 | var menu = $('') 29 | .appendTo(document.body); 30 | if (menuData.title) { 31 | $('
  • ').text(menuData.title).appendTo(menu); 32 | } 33 | menuData.items.forEach(function(item) { 34 | if (item) { 35 | var row = $('
  • ').appendTo(menu); 36 | row.find('img').attr('src', item.icon); 37 | row.find('span').text(item.label); 38 | if (item.action) { 39 | row.find('a').click(item.action); 40 | } 41 | } else { 42 | $('
  • ').appendTo(menu); 43 | } 44 | }); 45 | menu.find('.header').text(menuData.title); 46 | return menu; 47 | } 48 | 49 | function createandshow(e) { 50 | 51 | // Create and show menu 52 | var menu = createMenu() 53 | .show() 54 | .css({zIndex:1000001, left:e.pageX + 5 /* nudge to the right, so the pointer is covering the title */, top:e.pageY}) 55 | .bind('contextmenu', function() { return false; }); 56 | 57 | // Cover rest of page with invisible div that when clicked will cancel the popup. 58 | var bg = $('
    ') 59 | .css({left:0, top:0, width:'100%', height:'100%', position:'absolute', zIndex:1000000}) 60 | .appendTo(document.body) 61 | .bind('contextmenu click', function() { 62 | // If click or right click anywhere else on page: remove clean up. 63 | bg.remove(); 64 | menu.remove(); 65 | return false; 66 | }); 67 | 68 | // When clicking on a link in menu: clean up (in addition to handlers on link already) 69 | menu.find('a').click(function() { 70 | bg.remove(); 71 | menu.remove(); 72 | }); 73 | 74 | // Cancel event, so real browser popup doesn't appear. 75 | return false; 76 | } 77 | // On contextmenu event (default right click) 78 | //console.log(menuData.button); 79 | if (menuData.button == "left") 80 | { this.click( function(e){ createandshow(e)});} else {this.bind('contextmenu', function(e){ createandshow(e)}); }; 81 | 82 | return this; 83 | }; 84 | 85 | -------------------------------------------------------------------------------- /openmano-gui/physical.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | openMANO web 38 | 39 | 40 | 41 |
    42 |
    43 |
    44 |
    45 | 50 |
    51 | 52 | 53 |
    54 |
    55 |

    Physical Infrastructure


    56 | \n"; 62 | echo " mano_url_base='http://" . ($mano_domain!=null? "{$mano_domain}" : "'+window.location.host+'"). ":{$mano_port}{$mano_path}';\n"; 63 | #echo " mano_url_base='http://" . ($mano_domain!=null? "{$mano_domain}" : $_SERVER['HTTP_HOST']). ":{$mano_port}{$mano_path}';\n"; 64 | echo " mano_tenant='{$mano_tenant}';\n"; 65 | echo "\n"; 66 | ?> 67 |
    68 |
    69 |
    70 |
    71 | 72 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /openmano-gui/scenario_id.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 29 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | Scenario details 43 | 44 | 45 | 46 | 47 | \n"; 57 | getScenarioId_js($uuid); 58 | echo "\n"; 59 | echo "

    uuid: Loading

    \n"; 60 | echo "

    name: Loading

    \n"; 61 | echo "

    description: Loading

    \n"; 62 | echo "

    created: Loading

    \n"; 63 | //echo "

    modified: Loading

    \n"; 64 | }else{ 65 | getInstance($uuid); 66 | } 67 | ?> 68 | 69 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /openmano-gui/vnfs.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 29 | 30 | 31 | 32 | 33 | 34 | openMANO web 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 |
    43 |
    44 | 49 |
    50 | 51 | 52 |
    53 | 54 |
    55 |
    56 |

    Virtual Network Functions


    57 | 63 |
    64 |
    65 |
    66 | 74 |
    75 |
    76 |
    77 |
    78 |
    79 |
    80 | 81 | 82 | -------------------------------------------------------------------------------- /openmano/database_utils/dump_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | 25 | LICENSE_HEAD='/** 26 | * Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 27 | * This file is part of openmano 28 | * All Rights Reserved. 29 | * 30 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 31 | * not use this file except in compliance with the License. You may obtain 32 | * a copy of the License at 33 | * 34 | * http://www.apache.org/licenses/LICENSE-2.0 35 | * 36 | * Unless required by applicable law or agreed to in writing, software 37 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 38 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 39 | * License for the specific language governing permissions and limitations 40 | * under the License. 41 | * 42 | * For those usages not covered by the Apache License, Version 2.0 please 43 | * contact with: nfvlabs@tid.es 44 | **/ 45 | ' 46 | 47 | DBUSER="mano" 48 | DBPASS="" 49 | DBHOST="localhost" 50 | DBPORT="3306" 51 | DBNAME="mano_db" 52 | 53 | # Detect paths 54 | MYSQL=$(which mysql) 55 | AWK=$(which awk) 56 | GREP=$(which grep) 57 | DIRNAME=`dirname $0` 58 | 59 | function usage(){ 60 | echo -e "Usage: $0 OPTIONS" 61 | echo -e " Dumps openmano database content" 62 | echo -e " OPTIONS" 63 | echo -e " -u USER database user. '$DBUSER' by default. Prompts if DB access fails" 64 | echo -e " -p PASS database password. 'No password' by default. Prompts if DB access fails" 65 | echo -e " -P PORT database port. '$DBPORT' by default" 66 | echo -e " -h HOST database host. '$DBHOST' by default" 67 | echo -e " -d NAME database name. '$DBNAME' by default. Prompts if DB access fails" 68 | echo -e " --help shows this help" 69 | } 70 | 71 | while getopts ":u:p:P:h:-:" o; do 72 | case "${o}" in 73 | u) 74 | DBUSER="$OPTARG" 75 | ;; 76 | p) 77 | DBPASS="$OPTARG" 78 | ;; 79 | P) 80 | DBPORT="$OPTARG" 81 | ;; 82 | d) 83 | DBNAME="$OPTARG" 84 | ;; 85 | h) 86 | DBHOST="$OPTARG" 87 | ;; 88 | -) 89 | [ "${OPTARG}" == "help" ] && usage && exit 0 90 | echo "Invalid option: --$OPTARG" >&2 && usage >&2 91 | exit 1 92 | ;; 93 | \?) 94 | echo "Invalid option: -$OPTARG" >&2 && usage >&2 95 | exit 1 96 | ;; 97 | :) 98 | echo "Option -$OPTARG requires an argument." >&2 && usage >&2 99 | exit 1 100 | ;; 101 | *) 102 | usage >&2 103 | exit -1 104 | ;; 105 | esac 106 | done 107 | shift $((OPTIND-1)) 108 | 109 | #check and ask for database user password 110 | DBUSER_="-u$DBUSER" 111 | DBPASS_="" 112 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 113 | DBHOST_="-h$DBHOST" 114 | DBPORT_="-P$DBPORT" 115 | while ! echo ";" | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ $DBNAME >/dev/null 2>&1 116 | do 117 | [ -n "$logintry" ] && echo -e "\nInvalid database credentials!!!. Try again (Ctrl+c to abort)" 118 | [ -z "$logintry" ] && echo -e "\nProvide database name and credentials" 119 | read -e -p "mysql database name($DBNAME): " KK 120 | [ -n "$KK" ] && DBNAME="$KK" 121 | read -e -p "mysql user($DBUSER): " KK 122 | [ -n "$KK" ] && DBUSER="$KK" && DBUSER_="-u$DBUSER" 123 | read -e -s -p "mysql password: " DBPASS 124 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 125 | [ -z "$DBPASS" ] && DBPASS_="" 126 | logintry="yes" 127 | echo 128 | done 129 | 130 | #echo structure, including the content of schema_version 131 | echo "$LICENSE_HEAD" > ${DIRNAME}/${DBNAME}_structure.sql 132 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-data --add-drop-table --add-drop-database --routines --databases $DBNAME >> ${DIRNAME}/${DBNAME}_structure.sql 133 | echo -e "\n\n\n\n" >> ${DIRNAME}/${DBNAME}_structure.sql 134 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-create-info $DBNAME --tables schema_version 2>/dev/null >> ${DIRNAME}/${DBNAME}_structure.sql 135 | echo " ${DIRNAME}/${DBNAME}_structure.sql" 136 | 137 | #echo only data 138 | echo "$LICENSE_HEAD" > ${DIRNAME}/${DBNAME}_data.sql #copy my own header 139 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-create-info $DBNAME >> ${DIRNAME}/${DBNAME}_data.sql 140 | echo " ${DIRNAME}/${DBNAME}_data.sql" 141 | 142 | #echo all 143 | echo "$LICENSE_HEAD" > ${DIRNAME}/${DBNAME}_all.sql #copy my own header 144 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --add-drop-table --add-drop-database --routines --databases $DBNAME >> ${DIRNAME}/${DBNAME}_all.sql 145 | echo " ${DIRNAME}/${DBNAME}_all.sql" 146 | 147 | -------------------------------------------------------------------------------- /openmano/database_utils/init_mano_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | DBUSER="mano" 25 | DBPASS="" 26 | DBHOST="localhost" 27 | DBPORT="3306" 28 | DBNAME="mano_db" 29 | 30 | # Detect paths 31 | MYSQL=$(which mysql) 32 | AWK=$(which awk) 33 | GREP=$(which grep) 34 | DIRNAME=`dirname $0` 35 | 36 | function usage(){ 37 | echo -e "Usage: $0 OPTIONS" 38 | echo -e " Inits openmano database; deletes previous one and loads from ${DBNAME}_structure.sql" 39 | echo -e " OPTIONS" 40 | echo -e " -u USER database user. '$DBUSER' by default. Prompts if DB access fails" 41 | echo -e " -p PASS database password. 'No password' by default. Prompts if DB access fails" 42 | echo -e " -P PORT database port. '$DBPORT' by default" 43 | echo -e " -h HOST database host. '$DBHOST' by default" 44 | # echo -e " -d NAME database name. '$DBNAME' by default. Prompts if DB access fails" 45 | echo -e " --help shows this help" 46 | } 47 | 48 | while getopts ":u:p:P:h:-:" o; do 49 | case "${o}" in 50 | u) 51 | DBUSER="$OPTARG" 52 | ;; 53 | p) 54 | DBPASS="$OPTARG" 55 | ;; 56 | P) 57 | DBPORT="$OPTARG" 58 | ;; 59 | # d) 60 | # DBNAME="$OPTARG" 61 | # ;; 62 | h) 63 | DBHOST="$OPTARG" 64 | ;; 65 | -) 66 | [ "${OPTARG}" == "help" ] && usage && exit 0 67 | echo "Invalid option: --$OPTARG" >&2 && usage >&2 68 | exit 1 69 | ;; 70 | \?) 71 | echo "Invalid option: -$OPTARG" >&2 && usage >&2 72 | exit 1 73 | ;; 74 | :) 75 | echo "Option -$OPTARG requires an argument." >&2 && usage >&2 76 | exit 1 77 | ;; 78 | *) 79 | usage >&2 80 | exit -1 81 | ;; 82 | esac 83 | done 84 | shift $((OPTIND-1)) 85 | 86 | #check and ask for database user password 87 | DBUSER_="-u$DBUSER" 88 | DBPASS_="" 89 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 90 | DBHOST_="-h$DBHOST" 91 | DBPORT_="-P$DBPORT" 92 | while ! echo ";" | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ >/dev/null 2>&1 93 | do 94 | [ -n "$logintry" ] && echo -e "\nInvalid database credentials!!!. Try again (Ctrl+c to abort)" 95 | [ -z "$logintry" ] && echo -e "\nProvide database credentials" 96 | # read -e -p "mysql database name($DBNAME): " KK 97 | # [ -n "$KK" ] && DBNAME="$KK" 98 | read -e -p "mysql user($DBUSER): " KK 99 | [ -n "$KK" ] && DBUSER="$KK" && DBUSER_="-u$DBUSER" 100 | read -e -s -p "mysql password: " DBPASS 101 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 102 | [ -z "$DBPASS" ] && DBPASS_="" 103 | logintry="yes" 104 | echo 105 | done 106 | 107 | #${DIRNAME}/quick_delete_db.sh $MUSER $MPASS $MDB $HOST $PORT 108 | echo " loading ${DIRNAME}/${DBNAME}_structure.sql" 109 | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ < ${DIRNAME}/${DBNAME}_structure.sql 110 | 111 | echo " migrage database version" 112 | ${DIRNAME}/migrate_mano_db.sh $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ -d$DBNAME 113 | 114 | -------------------------------------------------------------------------------- /openmano/openmanoconfig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | export OPENMANO_HOST=localhost 25 | export OPENMANO_PORT=9090 26 | export OPENMANO_TENANT=bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb #Use here the appropriate tenant id provided by openmano after creating the tenant 27 | #Uncomment the following line in case that there are several datacenters and use the appropriate id 28 | #export OPENMANO_DATACENTER=dddddddd-dddd-dddd-dddd-dddddddddddd 29 | 30 | -------------------------------------------------------------------------------- /openmano/openmanod.cfg: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | #HTTP Server parameters (MANO API). IP address and port where openmanod listens 23 | # IPtables/firewalld must allow this port 24 | # for CentOS/Redhad firewalld is configured at '/etc/firewalld/services/openmanod.xml' 25 | # edit this file and reload firewalld with 'firewall-cmd --reload' if port is changed 26 | http_host: 0.0.0.0 # IP address, (by default, 0.0.0.0 means that it will listen in all interfaces) 27 | http_port: 9090 # General port (by default, 9090) 28 | #http_admin_port: 9095 # Admin port where openmano is listening (when missing, no administration server is launched) 29 | # Not used in current version! 30 | 31 | # Ports to be used. Comma separated list. Can contain a {"from":, "to":} entry 32 | #e.g. from 9000 to 9005: [{"from":9000, "to":9005}], or also [9000,9001,9002,9003,9004,9005] 33 | #e.g. from 9000 to 9100 apart from 9050,9053: [{"from":9000, "to":9049},9051,9052,{"from":9054, "to":9099}] 34 | http_console_ports: [{"from":9096, "to":9110}] 35 | 36 | #Database parameters 37 | db_host: localhost # by default localhost 38 | db_user: mano # DB user 39 | db_passwd: manopw # DB password 40 | db_name: mano_db # Name of the MANO DB 41 | 42 | #other MANO parameters 43 | # Folder where the VNF descriptors will be stored 44 | # The folder will be created in the execution folder if it does not exist 45 | vnf_repository: "./vnfrepo" # Use an absolute path to avoid misunderstandings 46 | 47 | 48 | #logging parameters # DEBUG, INFO, WARNING, ERROR, CRITICAL 49 | log_level: DEBUG 50 | log_level_db: DEBUG 51 | log_level_vimconn: DEBUG 52 | -------------------------------------------------------------------------------- /openmano/scenarios/examples/complex.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | schema_version: 2 23 | scenario: 24 | name: complex 25 | description: Complex network scenario consisting of 4 VNFs interconnected 26 | vnfs: 27 | linux1: # vnf/net name in the scenario 28 | vnf_name: linux # VNF name as introduced in OPENMANO DB 29 | node1: 30 | vnf_name: dataplaneVNF1 31 | node2: 32 | vnf_name: dataplaneVNF2 33 | node3: 34 | vnf_name: dataplaneVNF2 35 | networks: 36 | dataconn1: 37 | interfaces: 38 | - node1: xe0 39 | - node2: xe0 40 | dataconn2: 41 | interfaces: 42 | - node1: xe1 43 | - node2: xe1 44 | dataconn3: 45 | interfaces: 46 | - node1: xe2 47 | - node3: xe0 48 | dataconn4: 49 | interfaces: 50 | - node1: xe3 51 | - node3: xe1 52 | data-sriov1: 53 | interfaces: 54 | - node2: xe2 55 | - node3: xe2 56 | bridge1: 57 | interfaces: 58 | - linux1: eth0 59 | - node2: control 60 | - node3: control 61 | default: 62 | interfaces: 63 | - node1: mgmt 64 | - node2: mgmt 65 | - node3: mgmt 66 | 67 | -------------------------------------------------------------------------------- /openmano/scenarios/examples/complex2.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | schema_version: 2 23 | scenario: 24 | name: complex2 25 | description: Complex network scenario consisting of 2 VNFs interconnected 26 | public: false 27 | vnfs: 28 | VNF2vms: # vnf name in the scenario 29 | vnf_name: dataplaneVNF_2VMs # openmano vnf name 30 | VNF3: 31 | vnf_name: dataplaneVNF3 32 | networks: 33 | dataconn1: 34 | interfaces: 35 | - VNF2vms: in 36 | - VNF3: data0 37 | dataconn2: 38 | interfaces: 39 | - VNF2vms: out 40 | - VNF3: data1 41 | default: 42 | interfaces: 43 | - VNF2vms: control0 44 | - VNF2vms: control1 45 | - VNF3: mgmt 46 | 47 | -------------------------------------------------------------------------------- /openmano/scenarios/examples/simple.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | schema_version: 2 23 | scenario: 24 | name: simple 25 | description: Simple network scenario consisting of a single VNF connected to an external network 26 | vnfs: 27 | linux1: # vnf/net name in the scenario 28 | vnf_name: linux # VNF name as introduced in OPENMANO DB 29 | networks: 30 | default: # provide a name for this net or connection 31 | interfaces: 32 | - linux1: eth0 # Node and its interface 33 | 34 | -------------------------------------------------------------------------------- /openmano/scenarios/scenario-template.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | name: insert a name for the scenario 23 | description: insert a description for the scenario 24 | topology: 25 | nodes: 26 | vnf1: # vnf/net name in the scenario 27 | type: VNF # VNF, network, external_network (if it is a datacenter network) 28 | VNF model: vnf_model1 # VNF name as introduced in OPENMANO DB 29 | # vnf_id: 519f03ee-8ab6-11e4-ab4c-52540056c317 # Optionally, instead of the VNF name, the VNF id in Openmano DB can be used 30 | vnf2: 31 | type: VNF 32 | VNF model: vnf_model2 33 | # Optional information for display in the openmano-gui: graphical position of the node and its interfaces 34 | graph: {"y":399,"x":632,"ifaces":{"left":[["xe0","d"],["xe1","d"]],"bottom":[["eth0","v"],["eth1","m"]]}} 35 | bridge1: # Bridge networks must be declared in this section if we want to interconnect VNFs using a Linux bridge 36 | type: network 37 | model: bridge_net # 'bridge_net' or 'dataplane_net' for 'network' type 38 | default: # External networks (datacenter nets) must be declared in this section if we want to interconnect VNFs to them 39 | type: external_network 40 | model: default # datacenter net name, as introduced in OPENMANO DB 41 | connections: # In this section, connections between VNFs and networks are explicited 42 | datanet: # name 43 | # Data plane connections do not need to include a bridge since they are built through the Openflow Controller 44 | nodes: # nodes that will be connected: one or several vnfs, and optionally one additional network declared in nodes section 45 | - vnf1: xe0 # First node and its interface to be connected (interfaces must match to one in the VNF descriptor) 46 | - vnf2: xe0 # Second node and its interface 47 | control net: 48 | # Control plane connections must include a bridge network in the list of nodes 49 | nodes: 50 | - bridge1: null # Bridge networks must be included if we want to interconnect the nodes to that network 51 | - vnf1: eth1 52 | - vnf2: eth1 53 | external net: 54 | # Connections based on external networks (datacenter nets) must include the external network in the list of nodes 55 | nodes: 56 | - default: null # Datacenter networks (external networks) must be included if we want to interconnect the nodes to that network 57 | - vnf1: eth0 58 | - vnf1: eth0 59 | 60 | -------------------------------------------------------------------------------- /openmano/scenarios/scenario-template2.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | schema_version: 2 23 | scenario: 24 | name: insert a name for the scenario 25 | description: insert a description for the scenario 26 | public: false # if available for other tenants 27 | vnfs: 28 | vnf1: # vnf name in the scenario 29 | #identify an already openmano uploaded VNF either by vnf_id (uuid, prefered) or vnf_name 30 | vnf_id: fb356022-f664-11e5-a1e7-0800273e724c #prefered id method 31 | #vnf_name: openmano_vnf_name #can fail if several vnfs matches this name 32 | #graph: {"y":399,"x":332,"ifaces":{"left":[["xe0","d"],["xe1","d"]],"bottom":[["eth0","v"],["eth1","m"]]}} 33 | vnf2: 34 | vnf_name: vnf_name_2 # can fail if several vnfs matches this name 35 | graph: {"y":399,"x":632,"ifaces":{"left":[["xe0","d"],["xe1","d"]],"bottom":[["eth0","v"],["eth1","m"]]}} 36 | networks: 37 | net1: # network name in the scenario 38 | #optional type, deduced from interfaces 39 | type: dataplane # "dataplane", "bridge" 40 | #graph: {} 41 | interfaces: # nodes that will be connected: one or several vnfs 42 | - vnf1: xe0 # First node and its interface to be connected (interfaces must match to one in the VNF descriptor) 43 | - vnf2: xe0 # Second node and its interface 44 | control net: 45 | # Control plane connections must include a bridge network in the list of nodes 46 | interfaces: 47 | - vnf1: eth1 48 | - vnf2: eth1 49 | out: 50 | # Connections based on external networks (datacenter nets) must include the external network in the list of nodes 51 | type: dataplane 52 | external: true #this will be connected outside 53 | interfaces: 54 | - vnf1: xe1 55 | 56 | -------------------------------------------------------------------------------- /openmano/test/test-multivim.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | #This script is a basic test for openmano, that deals with two openvim 25 | #stopping on an error 26 | #WARNING: It destroy the database content 27 | 28 | 29 | function usage(){ 30 | echo -e "usage: ${BASH_SOURCE[0]} [-f]\n Deletes openvim/openmano content and make automatically the wiki steps" 31 | echo -e " at 'https://github.com/nfvlabs/openmano/wiki/Getting-started#how-to-use-it'" 32 | echo -e " OPTIONS:" 33 | echo -e " -f --force : does not prompt for confirmation" 34 | echo -e " -h --help : shows this help" 35 | } 36 | 37 | function is_valid_uuid(){ 38 | echo "$1" | grep -q -E '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$' && return 0 39 | return 1 40 | } 41 | 42 | 43 | #detect if is called with a source to use the 'exit'/'return' command for exiting 44 | [[ ${BASH_SOURCE[0]} != $0 ]] && _exit="return" || _exit="exit" 45 | 46 | #check correct arguments 47 | [[ -n $1 ]] && [[ $1 != -h ]] && [[ $1 != --help ]] && [[ $1 != -f ]] && [[ $1 != --force ]] && \ 48 | echo "invalid argument '$1'?" && usage >&2 && $_exit 1 49 | [[ $1 == -h ]] || [[ $1 == --help ]] && usage && $_exit 0 50 | 51 | #ask for confirmation if argument is not -f --force 52 | force="" 53 | [[ $1 == -f ]] || [[ $1 == --force ]] && force=y 54 | [[ $force != y ]] && read -e -p "WARNING: openmano and openvim database content will be lost!!! Continue(y/N)" force 55 | [[ $force != y ]] && [[ $force != yes ]] && echo "aborted!" && $_exit 56 | 57 | DIRNAME=$(dirname $(readlink -f ${BASH_SOURCE[0]})) 58 | DIR_BASE=$(dirname $DIRNAME) 59 | DIR_BASE=$(dirname $DIR_BASE) 60 | DIRvim=$DIR_BASE/openvim 61 | DIRmano=$DIR_BASE/openmano 62 | DIRscripts=$DIR_BASE/scripts 63 | 64 | echo "deleting deployed vm" 65 | openvim vm-delete -f | grep -q deleted && sleep 10 #give some time to get virtual machines deleted 66 | 67 | echo "Stopping openmano" 68 | $DIRscripts/service-openmano.sh stop 69 | 70 | echo "Initializing databases" 71 | $DIRvim/database_utils/init_vim_db.sh -u vim -p vimpw 72 | $DIRmano/database_utils/init_mano_db.sh -u mano -p manopw 73 | 74 | echo "Starting openmano" 75 | $DIRscripts/service-openmano.sh start 76 | 77 | echo "Creating openmano tenant 'mytenant'" 78 | nfvotenant=`openmano tenant-create mytenant --description=mytenant |gawk '{print $1}'` 79 | #check a valid uuid is obtained 80 | is_valid_uuid $nfvotenant || ! echo "fail" >&2 || $_exit 1 81 | export OPENMANO_TENANT=$nfvotenant 82 | echo " $nfvotenant" 83 | 84 | echo "Adding example hosts" 85 | openvim host-add $DIRvim/test/hosts/host-example0.json || ! echo "fail" >&2 || $_exit 1 86 | openvim host-add $DIRvim/test/hosts/host-example1.json || ! echo "fail" >&2 || $_exit 1 87 | openvim host-add $DIRvim/test/hosts/host-example2.json || ! echo "fail" >&2 || $_exit 1 88 | openvim host-add $DIRvim/test/hosts/host-example3.json || ! echo "fail" >&2 || $_exit 1 89 | echo "Adding example nets" 90 | openvim net-create $DIRvim/test/networks/net-example0.yaml || ! echo "fail" >&2 || $_exit 1 91 | openvim net-create $DIRvim/test/networks/net-example1.yaml || ! echo "fail" >&2 || $_exit 1 92 | openvim net-create $DIRvim/test/networks/net-example2.yaml || ! echo "fail" >&2 || $_exit 1 93 | openvim net-create $DIRvim/test/networks/net-example3.yaml || ! echo "fail" >&2 || $_exit 1 94 | 95 | echo "Creating openvim tenant 'admin'" 96 | vimtenant=`openvim tenant-create '{"tenant": {"name":"admin", "description":"admin"}}' |gawk '{print $1}'` 97 | #check a valid uuid is obtained 98 | is_valid_uuid $vimtenant || ! echo "fail" >&2 || $_exit 1 99 | echo " $vimtenant" 100 | OPENVIM_TENANT_1=$vimtenant && export OPENVIM_TENANT=$vimtenant 101 | 102 | echo "Creating datacenter 'mydc1' in openmano" 103 | datacenter=`openmano datacenter-create mydc1 http://localhost:9080/openvim |gawk '{print $1}'` 104 | #check a valid uuid is obtained 105 | is_valid_uuid $datacenter || ! echo "fail" >&2 || $_exit 1 106 | echo " $datacenter" 107 | OPENMANO_DATACENTER_1=$datacenter && export OPENMANO_DATACENTER=$datacenter 108 | 109 | echo "Attaching openmano tenant to the datacenter and the openvim tenant" 110 | openmano datacenter-attach mydc1 --vim-tenant-id $vimtenant || ! echo "fail" >&2 || $_exit 1 111 | 112 | echo "Updating external nets in openmano" 113 | openmano datacenter-net-update -f mydc1 || ! echo "fail" >&2 || $_exit 1 114 | 115 | echo "Creating a second fake datacenter 'mydc2' in openmano" 116 | datacenter2=`openmano datacenter-create mydc2 http://localhost:9082/openvim |gawk '{print $1}'` 117 | #check a valid uuid is obtained 118 | is_valid_uuid $datacenter || ! echo "fail" >&2 || $_exit 1 119 | echo " $datacenter2" 120 | OPENMANO_DATACENTER_2=$datacenter2 121 | echo "Attaching a second fake openvim 'mydc2'" 122 | openmano datacenter-attach mydc2 --vim-tenant-id $vimtenant || ! echo "fail" >&2 || $_exit 1 123 | 124 | echo "Creating VNFs, must fail in second openvim" 125 | openmano vnf-create $DIRmano/vnfs/examples/linux.yaml || ! echo "fail" >&2 || $_exit 1 126 | openmano vnf-create $DIRmano/vnfs/examples/dataplaneVNF1.yaml || ! echo "fail" >&2 || $_exit 1 127 | openmano vnf-create $DIRmano/vnfs/examples/dataplaneVNF2.yaml || ! echo "fail" >&2 || $_exit 1 128 | 129 | echo "Checking images and flavors created at openvim" 130 | nb=`openvim image-list | wc -l` 131 | echo -n " $nb images " 132 | [[ $nb -eq 3 ]] || ! echo "fail" >&2 || $_exit 1 133 | echo " $nb flavors " 134 | [[ $nb -eq 3 ]] || ! echo "fail" >&2 || $_exit 1 135 | 136 | echo "Creating Scenarios" 137 | openmano scenario-create $DIRmano/scenarios/examples/simple.yaml || ! echo "fail" >&2 || $_exit 1 138 | openmano scenario-create $DIRmano/scenarios/examples/complex.yaml || ! echo "fail" >&2 || $_exit 1 139 | 140 | echo "Deleting openvim images and flavors to force reload again" 141 | openvim image-delete -f 142 | openvim flavor-delete -f 143 | 144 | echo "Launching scenarios" 145 | openmano scenario-deploy simple simple-instance || ! echo "fail" >&2 || $_exit 1 146 | openmano scenario-deploy complex complex-instance || ! echo "fail" >&2 || $_exit 1 147 | 148 | echo "Checking that openvim has 5 VM running" 149 | nb=`openvim vm-list | wc -l` 150 | [[ $nb -eq 5 ]] || ! echo "fail" >&2 || $_exit 1 151 | while openvim vm-list | grep -q CREATING ; do sleep 1; done 152 | openvim vm-list | grep -v -q ERROR || ! echo "fail: VM with error" >&2 || $_exit 1 153 | 154 | echo "Removing scenarios" 155 | for scenario in `openmano instance-scenario-list | awk '{print $2}'` 156 | do 157 | openmano instance-scenario-delete -f $scenario 158 | done 159 | 160 | echo "Editing datacenters so that Changing openvim Working with the second openvim" 161 | openmano datacenter-edit -f mydc1 'vim_url: http://localhost:9083/openvim' 162 | openmano datacenter-edit -f mydc2 'vim_url: http://localhost:9080/openvim' 163 | export OPENMANO_DATACENTER=$OPENMANO_DATACENTER_2 164 | 165 | echo "Updating external nets in openmano for second datacenter" 166 | openmano datacenter-net-update -f mydc2 || ! echo "fail" >&2 || $_exit 1 167 | 168 | echo "Launching Scenario instances" 169 | openmano scenario-deploy simple simple-instance || ! echo "fail" >&2 || $_exit 1 170 | openmano scenario-deploy complex complex-instance || ! echo "fail" >&2 || $_exit 1 171 | 172 | echo "Checking images and flavors created at openvim" 173 | nb=`openvim image-list | wc -l` 174 | echo -n " $nb images " 175 | [[ $nb -eq 3 ]] || ! echo "fail" >&2 || $_exit 1 176 | echo " $nb flavors " 177 | [[ $nb -eq 3 ]] || ! echo "fail" >&2 || $_exit 1 178 | 179 | echo "Checking that openvim has 5 VM running" 180 | nb=`openvim vm-list | wc -l` 181 | [[ $nb -eq 5 ]] || ! echo "fail" >&2 || $_exit 1 182 | while openvim vm-list | grep -q CREATING ; do sleep 1; done 183 | openvim vm-list | grep -v -q ERROR || ! echo "fail: VM with error" >&2 || $_exit 1 184 | 185 | 186 | echo 187 | echo DONE 188 | #echo "Listing VNFs" 189 | #openmano vnf-list 190 | #echo "Listing scenarios" 191 | #openmano scenario-list 192 | #echo "Listing scenario instances" 193 | #openmano instance-scenario-list 194 | 195 | 196 | -------------------------------------------------------------------------------- /openmano/utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | ''' 25 | utils is a module that implements functions that are used by all openmano modules, 26 | dealing with aspects such as reading/writing files, formatting inputs/outputs for quick translation 27 | from dictionaries to appropriate database dictionaries, etc. 28 | ''' 29 | __author__="Alfonso Tierno, Gerardo Garcia" 30 | __date__ ="$08-sep-2014 12:21:22$" 31 | 32 | import datetime 33 | from jsonschema import validate as js_v, exceptions as js_e 34 | #from bs4 import BeautifulSoup 35 | 36 | def read_file(file_to_read): 37 | """Reads a file specified by 'file_to_read' and returns (True,) in case of success or (False, ) in case of failure""" 38 | try: 39 | f = open(file_to_read, 'r') 40 | read_data = f.read() 41 | f.close() 42 | except Exception,e: 43 | return (False, str(e)) 44 | 45 | return (True, read_data) 46 | 47 | def write_file(file_to_write, text): 48 | """Write a file specified by 'file_to_write' and returns (True,NOne) in case of success or (False, ) in case of failure""" 49 | try: 50 | f = open(file_to_write, 'w') 51 | f.write(text) 52 | f.close() 53 | except Exception,e: 54 | return (False, str(e)) 55 | 56 | return (True, None) 57 | 58 | def format_in(http_response, schema): 59 | try: 60 | client_data = http_response.json() 61 | js_v(client_data, schema) 62 | #print "Input data: ", str(client_data) 63 | return True, client_data 64 | except js_e.ValidationError, exc: 65 | print "validate_in error, jsonschema exception ", exc.message, "at", exc.path 66 | return False, ("validate_in error, jsonschema exception ", exc.message, "at", exc.path) 67 | 68 | def remove_extra_items(data, schema): 69 | deleted=[] 70 | if type(data) is tuple or type(data) is list: 71 | for d in data: 72 | a= remove_extra_items(d, schema['items']) 73 | if a is not None: deleted.append(a) 74 | elif type(data) is dict: 75 | #TODO deal with patternProperties 76 | if 'properties' not in schema: 77 | return None 78 | for k in data.keys(): 79 | if k not in schema['properties'].keys(): 80 | del data[k] 81 | deleted.append(k) 82 | else: 83 | a = remove_extra_items(data[k], schema['properties'][k]) 84 | if a is not None: deleted.append({k:a}) 85 | if len(deleted) == 0: return None 86 | elif len(deleted) == 1: return deleted[0] 87 | else: return deleted 88 | 89 | #def format_html2text(http_content): 90 | # soup=BeautifulSoup(http_content) 91 | # text = soup.p.get_text() + " " + soup.pre.get_text() 92 | # return text 93 | 94 | 95 | def convert_bandwidth(data, reverse=False): 96 | '''Check the field bandwidth recursivelly and when found, it removes units and convert to number 97 | It assumes that bandwidth is well formed 98 | Attributes: 99 | 'data': dictionary bottle.FormsDict variable to be checked. None or empty is consideted valid 100 | 'reverse': by default convert form str to int (Mbps), if True it convert from number to units 101 | Return: 102 | None 103 | ''' 104 | if type(data) is dict: 105 | for k in data.keys(): 106 | if type(data[k]) is dict or type(data[k]) is tuple or type(data[k]) is list: 107 | convert_bandwidth(data[k], reverse) 108 | if "bandwidth" in data: 109 | try: 110 | value=str(data["bandwidth"]) 111 | if not reverse: 112 | pos = value.find("bps") 113 | if pos>0: 114 | if value[pos-1]=="G": data["bandwidth"] = int(data["bandwidth"][:pos-1]) * 1000 115 | elif value[pos-1]=="k": data["bandwidth"]= int(data["bandwidth"][:pos-1]) / 1000 116 | else: data["bandwidth"]= int(data["bandwidth"][:pos-1]) 117 | else: 118 | value = int(data["bandwidth"]) 119 | if value % 1000 == 0: data["bandwidth"]=str(value/1000) + " Gbps" 120 | else: data["bandwidth"]=str(value) + " Mbps" 121 | except: 122 | print "convert_bandwidth exception for type", type(data["bandwidth"]), " data", data["bandwidth"] 123 | return 124 | if type(data) is tuple or type(data) is list: 125 | for k in data: 126 | if type(k) is dict or type(k) is tuple or type(k) is list: 127 | convert_bandwidth(k, reverse) 128 | 129 | 130 | 131 | def convert_datetime2str(var): 132 | '''Converts a datetime variable to a string with the format '%Y-%m-%dT%H:%i:%s' 133 | It enters recursively in the dict var finding this kind of variables 134 | ''' 135 | if type(var) is dict: 136 | for k,v in var.items(): 137 | if type(v) is datetime.datetime: 138 | var[k]= v.strftime('%Y-%m-%dT%H:%M:%S') 139 | elif type(v) is dict or type(v) is list or type(v) is tuple: 140 | convert_datetime2str(v) 141 | if len(var) == 0: return True 142 | elif type(var) is list or type(var) is tuple: 143 | for v in var: 144 | convert_datetime2str(v) 145 | 146 | def convert_str2boolean(data, items): 147 | '''Check recursively the content of data, and if there is an key contained in items, convert value from string to boolean 148 | Done recursively 149 | Attributes: 150 | 'data': dictionary variable to be checked. None or empty is considered valid 151 | 'items': tuple of keys to convert 152 | Return: 153 | None 154 | ''' 155 | if type(data) is dict: 156 | for k in data.keys(): 157 | if type(data[k]) is dict or type(data[k]) is tuple or type(data[k]) is list: 158 | convert_str2boolean(data[k], items) 159 | if k in items: 160 | if type(data[k]) is str: 161 | if data[k]=="false" or data[k]=="False": data[k]=False 162 | elif data[k]=="true" or data[k]=="True": data[k]=True 163 | if type(data) is tuple or type(data) is list: 164 | for k in data: 165 | if type(k) is dict or type(k) is tuple or type(k) is list: 166 | convert_str2boolean(k, items) 167 | 168 | def check_valid_uuid(uuid): 169 | id_schema = {"type" : "string", "pattern": "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$"} 170 | id_schema2 = {"type" : "string", "pattern": "^[a-fA-F0-9]{32}$"} 171 | try: 172 | js_v(uuid, id_schema) 173 | return True 174 | except js_e.ValidationError: 175 | try: 176 | js_v(uuid, id_schema2) 177 | return True 178 | except js_e.ValidationError: 179 | return False 180 | return False 181 | 182 | -------------------------------------------------------------------------------- /openmano/vnfs/examples/dataplaneVNF1.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | vnf: 23 | name: dataplaneVNF1 24 | 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" 25 | external-connections: 26 | - name: mgmt 27 | type: mgmt # "mgmt"(autoconnect to management net) 28 | VNFC: dataplaneVNF1-VM 29 | local_iface_name: eth0 30 | description: Management interface for general use 31 | - name: xe0 32 | type: data 33 | VNFC: dataplaneVNF1-VM 34 | local_iface_name: xe0 35 | description: Dataplane interface 1 36 | - name: xe1 37 | type: data 38 | VNFC: dataplaneVNF1-VM 39 | local_iface_name: xe1 40 | description: Dataplane interface 2 41 | - name: xe2 42 | type: data 43 | VNFC: dataplaneVNF1-VM 44 | local_iface_name: xe2 45 | description: Dataplane interface 3 46 | - name: xe3 47 | type: data 48 | VNFC: dataplaneVNF1-VM 49 | local_iface_name: xe3 50 | description: Dataplane interface 4 51 | VNFC: 52 | - name: dataplaneVNF1-VM 53 | description: "Dataplane VM with high I/O performance requirements: 14 HW threads, 16 GB hugepages and 4 10G interfaces" 54 | #Copy the image to a compute path and edit this path 55 | VNFC image: /path/to/imagefolder/dataplaneVNF1.qcow2 56 | numas: 57 | - paired-threads: 7 # "cores", "paired-threads", "threads" 58 | paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9], [10,11], [12, 13] ] 59 | memory: 16 # GBytes 60 | interfaces: 61 | - name: xe0 62 | vpci: "0000:00:11.0" 63 | dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 64 | bandwidth: 10 Gbps 65 | - name: xe1 66 | vpci: "0000:00:12.0" 67 | dedicated: "yes" 68 | bandwidth: 10 Gbps 69 | - name: xe2 70 | vpci: "0000:00:13.0" 71 | dedicated: "yes" 72 | bandwidth: 10 Gbps 73 | - name: xe3 74 | vpci: "0000:00:14.0" 75 | dedicated: "yes" 76 | bandwidth: 10 Gbps 77 | bridge-ifaces: 78 | - name: eth0 79 | vpci: "0000:00:09.0" 80 | bandwidth: 1 Mbps # Optional, informative only 81 | 82 | -------------------------------------------------------------------------------- /openmano/vnfs/examples/dataplaneVNF2.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | vnf: 23 | name: dataplaneVNF2 24 | 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" 25 | external-connections: 26 | - name: mgmt 27 | type: mgmt # "mgmt"(autoconnect to management net) 28 | VNFC: dataplaneVNF2-VM 29 | local_iface_name: eth0 30 | description: Management interface for general use 31 | - name: control 32 | type: bridge 33 | VNFC: dataplaneVNF2-VM 34 | local_iface_name: eth1 35 | description: Bridge interface 36 | - name: xe0 37 | type: data 38 | VNFC: dataplaneVNF2-VM 39 | local_iface_name: xe0 40 | description: Dataplane interface 1 41 | - name: xe1 42 | type: data 43 | VNFC: dataplaneVNF2-VM 44 | local_iface_name: xe1 45 | description: Dataplane interface 2 46 | - name: xe2 47 | type: data 48 | VNFC: dataplaneVNF2-VM 49 | local_iface_name: xe2 50 | description: Dataplane interface 3 (SR-IOV) 51 | VNFC: 52 | - name: dataplaneVNF2-VM 53 | description: "Dataplane VM with high I/O performance requirements: 3 cores (no hyperthreading), 8 GB hugepages, 2 10G interfaces and 1 SR-IOV interface" 54 | #Copy the image to a compute path and edit this path 55 | VNFC image: /path/to/imagefolder/dataplaneVNF2.qcow2 56 | numas: 57 | - cores: 3 # "cores", "paired-threads", "threads" 58 | memory: 8 # GBytes 59 | interfaces: 60 | - name: xe0 61 | vpci: "0000:00:11.0" 62 | dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 63 | bandwidth: 10 Gbps 64 | - name: xe1 65 | vpci: "0000:00:12.0" 66 | dedicated: "yes" 67 | bandwidth: 10 Gbps 68 | - name: xe2 69 | vpci: "0000:00:13.0" 70 | dedicated: "no" 71 | bandwidth: 1 Gbps 72 | bridge-ifaces: 73 | - name: eth0 74 | vpci: "0000:00:09.0" 75 | bandwidth: 1 Mbps # Optional, informative only 76 | - name: eth1 77 | vpci: "0000:00:10.0" 78 | bandwidth: 1 Mbps # Optional, informative only 79 | 80 | -------------------------------------------------------------------------------- /openmano/vnfs/examples/dataplaneVNF3.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | vnf: 23 | name: dataplaneVNF3 24 | description: "Example of a dataplane VNF consisting of one VM with two SR-IOV" 25 | # class: parent # Optional. Used to organize VNFs 26 | external-connections: 27 | - name: mgmt 28 | type: mgmt 29 | VNFC: dataplaneVNF3-VM 30 | local_iface_name: eth0 31 | description: control interface VM1 32 | - name: data0 33 | type: data 34 | VNFC: dataplaneVNF3-VM 35 | local_iface_name: xe0 36 | description: Dataplane interface 37 | - name: data1 38 | type: data 39 | VNFC: dataplaneVNF3-VM 40 | local_iface_name: xe1 41 | description: Dataplane interface 42 | VNFC: 43 | - name: dataplaneVNF3-VM 44 | description: "Dataplane VM with 2 threads, 2 GB hugepages, 2 SR-IOV interface" 45 | #Copy the image to a compute path and edit this path 46 | VNFC image: /path/to/imagefolder/dataplaneVNF3.qcow2 47 | disk: 10 48 | numas: 49 | - threads: 2 # "cores", "paired-threads", "threads" 50 | memory: 2 # GBytes 51 | interfaces: 52 | - name: xe0 53 | vpci: "0000:00:11.0" 54 | dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 55 | bandwidth: 1 Gbps 56 | - name: xe1 57 | vpci: "0000:00:12.0" 58 | dedicated: "no" 59 | bandwidth: 1 Gbps 60 | bridge-ifaces: 61 | - name: eth0 62 | vpci: "0000:00:09.0" 63 | bandwidth: 1 Mbps # Optional, informative only 64 | 65 | 66 | -------------------------------------------------------------------------------- /openmano/vnfs/examples/dataplaneVNF_2VMs.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | vnf: 23 | name: dataplaneVNF_2VMs 24 | description: "Example of a dataplane VNF consisting of two VMs for data plane workloads with one internal network" 25 | # class: parent # Optional. Used to organize VNFs 26 | internal-connections: 27 | - name: datanet 28 | description: datanet 29 | type: data 30 | elements: 31 | - VNFC: VNF_2VMs-VM1 32 | local_iface_name: xe0 33 | - VNFC: VNF_2VMs-VM2 34 | local_iface_name: xe0 35 | external-connections: 36 | - name: control0 37 | type: mgmt 38 | VNFC: VNF_2VMs-VM1 39 | local_iface_name: eth0 40 | description: control interface VM1 41 | - name: control1 42 | type: mgmt 43 | VNFC: VNF_2VMs-VM2 44 | local_iface_name: eth0 45 | description: control interface VM2 46 | - name: in 47 | type: data 48 | VNFC: VNF_2VMs-VM1 49 | local_iface_name: xe1 50 | description: Dataplane interface input 51 | - name: out 52 | type: data 53 | VNFC: VNF_2VMs-VM2 54 | local_iface_name: xe1 55 | description: Dataplane interface output 56 | VNFC: 57 | - name: VNF_2VMs-VM1 58 | description: "Dataplane VM1 with 4 threads, 2 GB hugepages, 2 SR-IOV interface" 59 | #Copy the image to a compute path and edit this path 60 | VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 61 | disk: 10 62 | numas: 63 | - paired-threads: 2 # "cores", "paired-threads", "threads" 64 | memory: 2 # GBytes 65 | interfaces: 66 | - name: xe0 67 | vpci: "0000:00:11.0" 68 | dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 69 | bandwidth: 1 Gbps 70 | - name: xe1 71 | vpci: "0000:00:12.0" 72 | dedicated: "no" 73 | bandwidth: 1 Gbps 74 | bridge-ifaces: 75 | - name: eth0 76 | vpci: "0000:00:09.0" 77 | bandwidth: 1 Mbps # Optional, informative only 78 | 79 | - name: VNF_2VMs-VM2 80 | description: "Dataplane VM1 with 2 threads, 2 GB hugepages, 2 SR-IOV interface" 81 | #Copy the image to a compute path and edit this path 82 | VNFC image: /path/to/imagefolder/dataplaneVNF_2VMs.qcow2 83 | disk: 10 84 | numas: 85 | - paired-threads: 1 # "cores", "paired-threads", "threads" 86 | memory: 2 # GBytes 87 | interfaces: 88 | - name: xe0 89 | vpci: "0000:00:11.0" 90 | dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 91 | bandwidth: 1 Gbps 92 | - name: xe1 93 | vpci: "0000:00:12.0" 94 | dedicated: "no" 95 | bandwidth: 1 Gbps 96 | bridge-ifaces: 97 | - name: eth0 98 | vpci: "0000:00:09.0" 99 | bandwidth: 1 Mbps # Optional, informative only 100 | 101 | -------------------------------------------------------------------------------- /openmano/vnfs/examples/linux.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | vnf: 23 | name: linux 24 | description: Single-VM VNF with a traditional cloud VM based on generic Linux OS 25 | external-connections: 26 | - name: eth0 27 | type: bridge 28 | VNFC: linux-VM 29 | local_iface_name: eth0 30 | description: General purpose interface 31 | VNFC: 32 | - name: linux-VM 33 | description: Generic Linux Virtual Machine 34 | #Copy the image to a compute path and edit this path 35 | VNFC image: /path/to/imagefolder/linux.qcow2 36 | vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). 37 | ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) 38 | disk: 10 39 | bridge-ifaces: 40 | - name: eth0 41 | vpci: "0000:00:11.0" 42 | numas: [] 43 | 44 | -------------------------------------------------------------------------------- /openmano/vnfs/vnf-template.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | --- 22 | vnf: 23 | name: TEMPLATE 24 | description: This is a template to help in the creation of your own VNFs 25 | # class: parent # Optional. Used to organize VNFs 26 | external-connections: 27 | - name: mgmt0 28 | type: mgmt # "mgmt" (autoconnect to management net), "bridge", "data" 29 | VNFC: TEMPLATE-VM # Virtual Machine this interface belongs to 30 | local_iface_name: mgmt0 # interface name inside this Virtual Machine (must be defined in the VNFC section) 31 | description: Management interface 32 | - name: xe0 33 | type: data 34 | VNFC: TEMPLATE-VM 35 | local_iface_name: xe0 36 | description: Data interface 1 37 | - name: xe1 38 | type: data 39 | VNFC: TEMPLATE-VM 40 | local_iface_name: xe1 41 | description: Data interface 2 42 | - name: ge0 43 | type: bridge 44 | VNFC: TEMPLATE-VM 45 | local_iface_name: ge0 46 | description: Bridge interface 47 | VNFC: # Virtual machine array 48 | - name: TEMPLATE-VM # name of Virtual Machine 49 | description: TEMPLATE description 50 | VNFC image: /path/to/imagefolder/TEMPLATE-VM.qcow2 51 | # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } #Optional 52 | # processor: #Optional 53 | # model: Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz 54 | # features: ["64b", "iommu", "lps", "tlbps", "hwsv", "dioc", "ht"] 55 | # hypervisor: #Optional 56 | # type: QEMU-kvm 57 | # version: "10002|12001|2.6.32-358.el6.x86_64" 58 | # vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). 59 | # ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) 60 | # disk: 10 # disk size in GiB, by default 1 61 | numas: 62 | - paired-threads: 5 # "cores", "paired-threads", "threads" 63 | paired-threads-id: [ [0,1], [2,3], [4,5], [6,7], [8,9] ] # By default follows incremental order 64 | memory: 14 # GBytes 65 | interfaces: 66 | - name: xe0 67 | vpci: "0000:00:11.0" 68 | dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 69 | bandwidth: 10 Gbps 70 | # mac_address: '20:33:45:56:77:44' #avoid this option if possible 71 | - name: xe1 72 | vpci: "0000:00:12.0" 73 | dedicated: "yes" 74 | bandwidth: 10 Gbps 75 | # mac_address: '20:33:45:56:77:45' #avoid this option if possible 76 | bridge-ifaces: 77 | - name: mgmt0 78 | vpci: "0000:00:09.0" # Optional. Virtual PCI address 79 | bandwidth: 1 Mbps # Optional. Informative only 80 | # mac_address: '20:33:45:56:77:46' #avoid this option if possible 81 | # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt 82 | - name: ge0 83 | vpci: "0000:00:10.0" 84 | bandwidth: 1 Mbps 85 | # mac_address: '20:33:45:56:77:47' #avoid this option if possible 86 | # model: 'virtio' # ("virtio","e1000","ne2k_pci","pcnet","rtl8139") By default, it is automatically filled by libvirt 87 | devices: # Optional, order determines device letter asignation (hda, hdb, ...) 88 | - type: disk # "disk","cdrom","xml" 89 | image: /path/to/imagefolder/SECOND-DISK.qcow2 90 | # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } 91 | # vpci: "0000:00:03.0" # Optional, not for disk or cdrom 92 | - type: cdrom 93 | image: /path/to/imagefolder/CDROM-IMAGE.qcow2 94 | # image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } 95 | - type: xml 96 | image: /path/to/imagefolder/ADDITIONAL-DISK.qcow2 # Optional, depending on the device type 97 | image metadata: {"bus":"ide", "os_type":"windows", "use_incremental": "no" } # Optional, depending on the device type 98 | vpci: "0000:00:03.0" # Optional, depending on the device type (not needed for disk or cdrom) 99 | xml: ' xml text for XML described devices. Do not use single quotes inside 100 | The following words, if found, will be replaced: 101 | __file__ by image path, (image must be provided) 102 | __format__ by qcow2 or raw (image must be provided) 103 | __dev__ by device letter (b, c, d ...) 104 | __vpci__ by vpci (vpci must be provided) 105 | ' 106 | # Additional Virtual Machines would be included here 107 | 108 | -------------------------------------------------------------------------------- /openvim/database_utils/dump_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | LICENSE_HEAD='/** 25 | * Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 26 | * This file is part of openmano 27 | * All Rights Reserved. 28 | * 29 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 30 | * not use this file except in compliance with the License. You may obtain 31 | * a copy of the License at 32 | * 33 | * http://www.apache.org/licenses/LICENSE-2.0 34 | * 35 | * Unless required by applicable law or agreed to in writing, software 36 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 37 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 38 | * License for the specific language governing permissions and limitations 39 | * under the License. 40 | * 41 | * For those usages not covered by the Apache License, Version 2.0 please 42 | * contact with: nfvlabs@tid.es 43 | **/ 44 | ' 45 | 46 | 47 | DBUSER="vim" 48 | DBPASS="" 49 | DBHOST="localhost" 50 | DBPORT="3306" 51 | DBNAME="vim_db" 52 | 53 | # Detect paths 54 | MYSQL=$(which mysql) 55 | AWK=$(which awk) 56 | GREP=$(which grep) 57 | DIRNAME=`dirname $0` 58 | 59 | function usage(){ 60 | echo -e "Usage: $0 OPTIONS" 61 | echo -e " Dumps openvim database content" 62 | echo -e " OPTIONS" 63 | echo -e " -u USER database user. '$DBUSER' by default. Prompts if DB access fails" 64 | echo -e " -p PASS database password. 'No password' by default. Prompts if DB access fails" 65 | echo -e " -P PORT database port. '$DBPORT' by default" 66 | echo -e " -h HOST database host. '$DBHOST' by default" 67 | echo -e " -d NAME database name. '$DBNAME' by default. Prompts if DB access fails" 68 | echo -e " --help shows this help" 69 | } 70 | 71 | while getopts ":u:p:P:h:-:" o; do 72 | case "${o}" in 73 | u) 74 | DBUSER="$OPTARG" 75 | ;; 76 | p) 77 | DBPASS="$OPTARG" 78 | ;; 79 | P) 80 | DBPORT="$OPTARG" 81 | ;; 82 | d) 83 | DBNAME="$OPTARG" 84 | ;; 85 | h) 86 | DBHOST="$OPTARG" 87 | ;; 88 | -) 89 | [ "${OPTARG}" == "help" ] && usage && exit 0 90 | echo "Invalid option: --$OPTARG" >&2 && usage >&2 91 | exit 1 92 | ;; 93 | \?) 94 | echo "Invalid option: -$OPTARG" >&2 && usage >&2 95 | exit 1 96 | ;; 97 | :) 98 | echo "Option -$OPTARG requires an argument." >&2 && usage >&2 99 | exit 1 100 | ;; 101 | *) 102 | usage >&2 103 | exit -1 104 | ;; 105 | esac 106 | done 107 | shift $((OPTIND-1)) 108 | 109 | #check and ask for database user password 110 | DBUSER_="-u$DBUSER" 111 | DBPASS_="" 112 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 113 | DBHOST_="-h$DBHOST" 114 | DBPORT_="-P$DBPORT" 115 | while ! echo ";" | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ $DBNAME >/dev/null 2>&1 116 | do 117 | [ -n "$logintry" ] && echo -e "\nInvalid database credentials!!!. Try again (Ctrl+c to abort)" 118 | [ -z "$logintry" ] && echo -e "\nProvide database name and credentials" 119 | read -e -p "mysql database name($DBNAME): " KK 120 | [ -n "$KK" ] && DBNAME="$KK" 121 | read -e -p "mysql user($DBUSER): " KK 122 | [ -n "$KK" ] && DBUSER="$KK" && DBUSER_="-u$DBUSER" 123 | read -e -s -p "mysql password: " DBPASS 124 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 125 | [ -z "$DBPASS" ] && DBPASS_="" 126 | logintry="yes" 127 | echo 128 | done 129 | 130 | 131 | #echo structure, including the content of schema_version 132 | echo "$LICENSE_HEAD" > ${DIRNAME}/${DBNAME}_structure.sql 133 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-data --add-drop-table --add-drop-database --routines --databases $DBNAME >> ${DIRNAME}/${DBNAME}_structure.sql 134 | echo -e "\n\n\n\n" >> ${DIRNAME}/${DBNAME}_structure.sql 135 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-create-info $DBNAME --tables schema_version 2>/dev/null >> ${DIRNAME}/${DBNAME}_structure.sql 136 | echo " ${DIRNAME}/${DBNAME}_structure.sql" 137 | 138 | #echo only data 139 | echo "$LICENSE_HEAD" > ${DIRNAME}/${DBNAME}_data.sql #copy my own header 140 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-create-info $DBNAME >> ${DIRNAME}/${DBNAME}_data.sql 141 | echo " ${DIRNAME}/${DBNAME}_data.sql" 142 | 143 | #echo all 144 | echo "$LICENSE_HEAD" > ${DIRNAME}/${DBNAME}_all.sql #copy my own header 145 | mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --add-drop-table --add-drop-database --routines --databases $DBNAME >> ${DIRNAME}/${DBNAME}_all.sql 146 | echo " ${DIRNAME}/${DBNAME}_all.sql" 147 | 148 | -------------------------------------------------------------------------------- /openvim/database_utils/host_ranking.sql: -------------------------------------------------------------------------------- 1 | /* 2 | ## 3 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 4 | # This file is part of openmano 5 | # All Rights Reserved. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | # not use this file except in compliance with the License. You may obtain 9 | # a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | # License for the specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | # For those usages not covered by the Apache License, Version 2.0 please 20 | # contact with: nfvlabs@tid.es 21 | ## 22 | */ 23 | 24 | /* This table contains a list of processor ranking 25 | The larger ranking the better performance 26 | All physical host models must be included in this table 27 | before being adding to openvim 28 | processor information is obtained with commnand cat /proc/cpuinfo 29 | NOTE: Current version of openvim ignores the ranking 30 | */ 31 | 32 | 33 | LOCK TABLES `host_ranking` WRITE; 34 | /*!40000 ALTER TABLE `host_ranking` DISABLE KEYS */; 35 | INSERT INTO `host_ranking` 36 | (family, manufacturer, version, description, ranking) 37 | VALUES 38 | ('Xeon','Intel','Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz','sandy bridge',170), 39 | ('Xeon','Intel','Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz','sandy bridge',200), 40 | ('Xeon','Intel','Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz','ivy bridge',300), 41 | ('Xeon','Intel','Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz','ivy bridge',310); /*last entry ends with ';' */ 42 | 43 | UNLOCK TABLES; 44 | -------------------------------------------------------------------------------- /openvim/database_utils/init_vim_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | DBUSER="vim" 25 | DBPASS="" 26 | DBHOST="localhost" 27 | DBPORT="3306" 28 | DBNAME="vim_db" 29 | 30 | # Detect paths 31 | MYSQL=$(which mysql) 32 | AWK=$(which awk) 33 | GREP=$(which grep) 34 | DIRNAME=`dirname $0` 35 | 36 | function usage(){ 37 | echo -e "Usage: $0 OPTIONS [{openvim_version}]" 38 | echo -e " Inits openvim database; deletes previous one and loads from ${DBNAME}_structure.sql" 39 | echo -e " and data from host_ranking.sql, nets.sql, of_ports_pci_correspondece*.sql" 40 | echo -e " If openvim_version is not provided it tries to get from openvimd.py using relative path" 41 | echo -e " OPTIONS" 42 | echo -e " -u USER database user. '$DBUSER' by default. Prompts if DB access fails" 43 | echo -e " -p PASS database password. 'No password' by default. Prompts if DB access fails" 44 | echo -e " -P PORT database port. '$DBPORT' by default" 45 | echo -e " -h HOST database host. '$DBHOST' by default" 46 | echo -e " -d NAME database name. '$DBNAME' by default. Prompts if DB access fails" 47 | echo -e " --help shows this help" 48 | } 49 | 50 | while getopts ":u:p:P:h:d:-:" o; do 51 | case "${o}" in 52 | u) 53 | DBUSER="$OPTARG" 54 | ;; 55 | p) 56 | DBPASS="$OPTARG" 57 | ;; 58 | P) 59 | DBPORT="$OPTARG" 60 | ;; 61 | d) 62 | DBNAME="$OPTARG" 63 | ;; 64 | h) 65 | DBHOST="$OPTARG" 66 | ;; 67 | -) 68 | [ "${OPTARG}" == "help" ] && usage && exit 0 69 | echo "Invalid option: --$OPTARG" >&2 && usage >&2 70 | exit 1 71 | ;; 72 | \?) 73 | echo "Invalid option: -$OPTARG" >&2 && usage >&2 74 | exit 1 75 | ;; 76 | :) 77 | echo "Option -$OPTARG requires an argument." >&2 && usage >&2 78 | exit 1 79 | ;; 80 | *) 81 | usage >&2 82 | exit -1 83 | ;; 84 | esac 85 | done 86 | shift $((OPTIND-1)) 87 | 88 | #check and ask for database user password 89 | DBUSER_="-u$DBUSER" 90 | DBPASS_="" 91 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 92 | DBHOST_="-h$DBHOST" 93 | DBPORT_="-P$DBPORT" 94 | while ! echo ";" | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ $DBNAME >/dev/null 2>&1 95 | do 96 | [ -n "$logintry" ] && echo -e "\nInvalid database credentials!!!. Try again (Ctrl+c to abort)" 97 | [ -z "$logintry" ] && echo -e "\nProvide database name and credentials" 98 | read -e -p "mysql database name($DBNAME): " KK 99 | [ -n "$KK" ] && DBNAME="$KK" 100 | read -e -p "mysql user($DBUSER): " KK 101 | [ -n "$KK" ] && DBUSER="$KK" && DBUSER_="-u$DBUSER" 102 | read -e -s -p "mysql password: " DBPASS 103 | [ -n "$DBPASS" ] && DBPASS_="-p$DBPASS" 104 | [ -z "$DBPASS" ] && DBPASS_="" 105 | logintry="yes": 106 | echo 107 | done 108 | 109 | echo " loading ${DIRNAME}/vim_db_structure.sql" 110 | sed -e "s/vim_db/$DBNAME/" ${DIRNAME}/vim_db_structure.sql | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ 111 | 112 | echo " migrage database version" 113 | ${DIRNAME}/migrate_vim_db.sh $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ -d$DBNAME $1 114 | 115 | echo " loading ${DIRNAME}/host_ranking.sql" 116 | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ $DBNAME < ${DIRNAME}/host_ranking.sql 117 | 118 | echo " loading ${DIRNAME}/of_ports_pci_correspondence.sql" 119 | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ $DBNAME < ${DIRNAME}/of_ports_pci_correspondence.sql 120 | #mysql -h $HOST -P $PORT -u $MUSER -p$MPASS $MDB < ${DIRNAME}/of_ports_pci_correspondence_centos.sql 121 | 122 | echo " loading ${DIRNAME}/nets.sql" 123 | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ $DBNAME < ${DIRNAME}/nets.sql 124 | 125 | -------------------------------------------------------------------------------- /openvim/database_utils/nets.sql: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | /* 23 | This table contains a list of networks created from the begining 24 | The following fields are needed 25 | uuid: provide a valid uuid format 26 | type: ptp, data (point to point, or point to multipoint) are openflow dadaplane nets 27 | bridge_man, bridge_data are virtio/bridge controlplane nets 28 | name: useful human readable name 29 | shared: by default true 30 | vlan: default vlan of the dataplane net 31 | bind: for control plane: 32 | default: default network 33 | macvtap:host_iface. Connect to a direct macvtap host interface 34 | bridge:bridge_name. Connect to this host bridge_name interface 35 | for dataplane: NULL, because the binding is done with a external port 36 | */ 37 | 38 | 39 | LOCK TABLES `nets` WRITE; 40 | /* 41 | INSERT INTO `nets` 42 | (uuid, `type`, name, shared, vlan, bind) 43 | VALUES 44 | ('00000000-0000-0000-0000-000000000000','bridge_man', 'default', 'true', NULL, 'default'), 45 | ('11111111-1111-1111-1111-111111111111','bridge_man', 'direct:em1','true', NULL, 'macvtap:em1'), 46 | ('aaaaaaaa-1111-aaaa-aaaa-aaaaaaaaaaaa','data', 'coreIPv4', 'true', 702, NULL), 47 | ('aaaaaaaa-aaaa-0000-1111-aaaaaaaaaaaa','bridge_data','virbrMan2', 'true', 2002, 'bridge:virbrMan2') # last row without ',' 48 | ; 49 | */ 50 | 51 | UNLOCK TABLES; 52 | 53 | /* External PORTS are necessary to connect a dataplane network to an external switch port 54 | The following fields are needed 55 | uuid: provide a valid uuid format 56 | name: useful human readable name 57 | net_id: uuid of the net where this port must be connected 58 | Mbps: only informative, indicates the expected bandwidth in megabits/s 59 | type: only external has meaning here 60 | vlan: if the traffic at that port must be vlan tagged 61 | switch_port: port name at switch: 62 | */ 63 | 64 | LOCK TABLES `ports` WRITE; 65 | /* 66 | INSERT INTO `ports` 67 | (uuid, name, net_id, Mbps, type, vlan, switch_port) 68 | VALUES 69 | ('6d536a80-52e9-11e4-9e31-5254006d6777','CoreIPv4', 'aaaaaaaa-1111-aaaa-aaaa-aaaaaaaaaaaa',10000,'external',702, 'Te0/47') # last row without ',' 70 | ; 71 | */ 72 | 73 | UNLOCK TABLES; 74 | 75 | -------------------------------------------------------------------------------- /openvim/database_utils/of_ports_pci_correspondence.sql: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | /* 23 | READ THIS please: 24 | This table contains the matching between dataplane host ports 25 | and openflow switch ports. 26 | The two first column identifies the host and the pci bus 27 | command ethtool -i provides the pci bus port (at host) 28 | command ethtool -p makes this port blinking (at host) 29 | Last column identifies the switch port name 30 | openvim prints at starting the openflow ports naming 31 | NOTE: if a host has already been inserted, you must execute 32 | UpdateSwitchPort database procedure to associate ports with 33 | the switch connection 34 | */ 35 | 36 | LOCK TABLES `of_ports_pci_correspondence` WRITE; 37 | 38 | /* DATA for fakehost examples*/ 39 | INSERT INTO `of_ports_pci_correspondence` 40 | (ip_name, pci, switch_port) 41 | VALUES 42 | ('fake-host-0', '0000:06:00.0', 'port0/0'), 43 | ('fake-host-0', '0000:06:00.1', 'port0/1'), 44 | ('fake-host-0', '0000:08:00.0', 'port0/2'), 45 | ('fake-host-0', '0000:08:00.1', 'port0/3'), 46 | 47 | ('fake-host-1', '0000:44:00.0', 'port0/4'), 48 | ('fake-host-1', '0000:44:00.1', 'port0/5'), 49 | ('fake-host-1', '0000:43:00.0', 'port0/6'), 50 | ('fake-host-1', '0000:43:00.1', 'port0/7'), 51 | ('fake-host-1', '0000:04:00.0', 'port0/8'), 52 | ('fake-host-1', '0000:04:00.1', 'port0/9'), 53 | ('fake-host-1', '0000:06:00.0', 'port0/10'), 54 | ('fake-host-1', '0000:06:00.1', 'port0/11'), 55 | 56 | ('fake-host-2', '0000:44:00.0', 'port0/12'), 57 | ('fake-host-2', '0000:44:00.1', 'port0/13'), 58 | ('fake-host-2', '0000:43:00.0', 'port0/14'), 59 | ('fake-host-2', '0000:43:00.1', 'port0/15'), 60 | ('fake-host-2', '0000:04:00.0', 'port0/16'), 61 | ('fake-host-2', '0000:04:00.1', 'port0/17'), 62 | ('fake-host-2', '0000:06:00.0', 'port0/18'), 63 | ('fake-host-2', '0000:06:00.1', 'port0/19'), 64 | 65 | ('fake-host-3', '0000:44:00.0', 'port1/0'), 66 | ('fake-host-3', '0000:44:00.1', 'port1/1'), 67 | ('fake-host-3', '0000:43:00.0', 'port1/2'), 68 | ('fake-host-3', '0000:43:00.1', 'port1/3'), 69 | ('fake-host-3', '0000:04:00.0', 'port1/4'), 70 | ('fake-host-3', '0000:04:00.1', 'port1/5'), 71 | ('fake-host-3', '0000:06:00.0', 'port1/6'), 72 | ('fake-host-3', '0000:06:00.1', 'port1/7') 73 | ; 74 | 75 | 76 | UNLOCK TABLES; 77 | -------------------------------------------------------------------------------- /openvim/openvimconfig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | export OPENVIM_HOST=localhost 25 | export OPENVIM_PORT=9080 26 | export OPENVIM_ADMIN_PORT=9085 27 | export OPENVIM_TENANT=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa #Use here the appropriate tenant id provided by openvim after creating the tenant 28 | 29 | -------------------------------------------------------------------------------- /openvim/openvimd.cfg: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | 24 | #Miscellaneous 25 | #Option to test openvim without the needed infrastructure, possible values are 26 | # "normal" by default, Openflow controller (OFC), switch and real host are needed 27 | # "test" Used for testing http API and database without connecting to host or to OFC 28 | # "host only" Used when neither OFC nor OF switch are provided. 29 | # Dataplane network connection must be done manually. 30 | # "OF only" Used for testing of new openflow controllers support. No real VM deployments will be done but 31 | # OFC will be used as in real mode 32 | # "development" Forced a cloud-type deployment, nomal memory instead of hugepages is used, 33 | # without cpu pinning, and using a bridge network instead of a real OFC dataplane networks. 34 | # The same 'development_bridge' (see below) is used for all dataplane networks 35 | mode: test 36 | 37 | #Openflow controller information 38 | of_controller: floodlight # Type of controller to be used. 39 | # Valid controllers are 'opendaylight', 'floodlight' or 40 | #of_controller_module: module # Only needed for . Python module that implement 41 | # this controller. By default a file with the name .py is used 42 | #of_: value # Other parameters required by controller. Consumed by __init__ 43 | of_user: user credentials # User credentials for the controller if needed 44 | of_password: passwd credentials # Password credentials for the controller if needed 45 | of_controller_ip: 127.0.0.1 # IP address where the Openflow controller is listening 46 | of_controller_port: 7070 # TCP port where the Openflow controller is listening (REST API server) 47 | of_controller_dpid: '00:01:02:03:04:05:06:07' # Openflow Switch identifier (put here the right number) 48 | 49 | #This option is used for those openflow switch that cannot deliver one packet to several output with different vlan tags 50 | #When set to true, it fails when trying to attach different vlan tagged ports to the same net 51 | of_controller_nets_with_same_vlan: false # (by default, true) 52 | 53 | #Server parameters 54 | http_host: localhost # IP address where openvim is listening (by default, localhost) 55 | http_port: 9080 # General port where openvim is listening (by default, 9080) 56 | http_admin_port: 9085 # Admin port where openvim is listening (when missing, no administration server is launched) 57 | 58 | #database parameters 59 | db_host: localhost # by default localhost 60 | db_user: vim # DB user 61 | db_passwd: vimpw # DB password 62 | db_name: vim_db # Name of the VIM DB 63 | 64 | #host paremeters 65 | image_path: "/opt/VNF/images" # Folder, same for every host, where the VNF images will be copied 66 | 67 | #testing parameters (used by ./test/test_openvim.py) 68 | tenant_id: fc7b43b6-6bfa-11e4-84d2-5254006d6777 # Default tenant identifier for testing 69 | 70 | #VLAN ranges used for the dataplane networks (ptp, data) 71 | #When a network is created an unused value in this range is used 72 | network_vlan_range_start: 3000 73 | network_vlan_range_end: 4000 74 | 75 | #host bridge interfaces for networks 76 | # Openvim cannot create bridge networks automatically, in the same way as other CMS do. 77 | # Bridge networks need to be pre-provisioned on each host and Openvim uses those pre-provisioned bridge networks. 78 | # Openvim assumes that the following bridge interfaces have been created on each host, appropriately associated to a physical port. 79 | # The following information needs to be provided: 80 | # - Name of the bridge (identical in all hosts) 81 | # - VLAN tag associated to each bridge interface 82 | # - The speed of the physical port in Gbps, where that bridge interface was created 83 | # For instance, next example assumes that 10 bridges have been created on each host 84 | # using vlans 2001 to 2010, associated to a 1Gbps physical port 85 | bridge_ifaces: 86 | #name: [vlan, speed in Gbps] 87 | virbrMan1: [2001, 1] 88 | virbrMan2: [2002, 1] 89 | virbrMan3: [2003, 1] 90 | virbrMan4: [2004, 1] 91 | virbrMan5: [2005, 1] 92 | virbrMan6: [2006, 1] 93 | virbrMan7: [2007, 1] 94 | virbrMan8: [2008, 1] 95 | virbrMan9: [2009, 1] 96 | virbrMan10: [2010, 1] 97 | 98 | #Used only when 'mode' is at development'. Indicates which 'bridge_ifaces' is used for dataplane networks 99 | development_bridge: virbrMan10 100 | 101 | #DHCP SERVER PARAMETERS. 102 | #In case some of the previous 'bridge_ifaces' are connected to an EXTERNAL dhcp server, provide 103 | # the server parameters to allow openvim getting the allocated IP addresses of virtual machines 104 | # connected to the indicated 'bridge_ifaces' and or 'nets'. Openvim will connect to the dhcp server by ssh. 105 | #DHCP server must contain a shell script "./get_dhcp_lease.sh" that accept a mac address as parameter 106 | # and return empty or the allocated IP address. See an example at the end of the file ./openvim/dhcp_thread.py 107 | #COMMENT all lines in case you do not have a DHCP server in 'normal', 'development' or 'host only' modes. 108 | # For 'test' or 'OF only' modes you can leave then uncommented, because in these modes fake IP 109 | # address are generated instead of connecting with a real DHCP server. 110 | dhcp_server: 111 | host: host-ip-or-name 112 | #port: 22 #ssh port, by default 22 113 | provider: isc-dhcp-server #dhcp-server type 114 | user: user 115 | #provide password, or key if needed 116 | password: passwd 117 | #key: ssh-access-key 118 | #list of the previous bridge interfaces attached to this dhcp server 119 | bridge_ifaces: [ virbrMan1, virbrMan2 ] 120 | #list of the networks attached to this dhcp server 121 | nets: [default] 122 | 123 | 124 | #logging parameters # DEBUG, INFO, WARNING, ERROR, CRITICAL 125 | log_level: ERROR 126 | log_level_db: DEBUG 127 | log_level_of: DEBUG 128 | -------------------------------------------------------------------------------- /openvim/templates/flavor.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | flavor: 24 | name: flavor-name 25 | description: flavor-description 26 | # cloud type requirements 27 | ram: 1024 # Memory in MB. Ignored if provided 'memory' at 'extended' 28 | vcpus: 2 # Number of cpus. Ignored if provided at 'extended' 29 | 30 | # NFV type requirements 31 | # allocating EXCLUSIVE resoureces in the same NUMA node. 32 | extended: # optional 33 | processor_ranking: 100 # minimal processor family. Not used in current version 34 | numas: # list of numa set. Only one supported in current version 35 | - memory: 8 # GByte of huge pages at this numa 36 | 37 | #Choose among one of "cores", "paired-threads", "threads" 38 | paired-threads: 5 # Cores with two paired hyper threads 39 | #paired-threads-id: [[0,1],[2,3],[4,5],[6,7],[8,9]] # Guess pinning. By default follows incremental order 40 | #threads: 10 # threads awereness of the hyperthreading 41 | ##threads-id: [0,1,2,3,4,5,6,7,8,9] #Optional. Guess pinning 42 | #cores: 5 # Complete cores, without hyperthreading. VIM ensures the other paired thread is idle 43 | ##cores-id: [0,1,2,3,4] # Optional. Guess pinning of cores 44 | 45 | #Optional: Dataplane needed interfaces 46 | interfaces: 47 | - name: xe0 # Optional. User friendly name 48 | vpci: "0000:00:10.0" # Optional. Guess PCI 49 | bandwidth: 10 Gbps # Needed minimun bandwidth 50 | dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 51 | - name: xe1 52 | vpci: "0000:00:11.0" 53 | bandwidth: 10 Gbps 54 | dedicated: "no" 55 | 56 | #Optional: List of extra devices 57 | devices: # order determines device letter asignation (hda, hdb, ...) 58 | - type: disk # "disk","cdrom","xml","usb" 59 | imageRef: 37598e34-ccb3-11e4-a996-52540030594e # UUID of an image, only for disk,cdrom,xml 60 | # vpci: "0000:00:03.0" # Optional, not for disk or cdrom 61 | # xml: 'Only for type xml: a XML described device xml text. Do not use single quotes inside 62 | # The following words, if found, will be replaced: 63 | # __file__ by image path, (imageiRef must be provided) 64 | # __format__ by qcow2 or raw (imageRef must be provided) 65 | # __dev__ by device letter (b, c, d ...) 66 | # __vpci__ by vpci (vpci must be provided) 67 | 68 | -------------------------------------------------------------------------------- /openvim/templates/image.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | image: 24 | name: image-name 25 | description: image-description 26 | path: /image-path/at/the/compute-node/storage/image 27 | metadata: # Optional extra metadata of the image. All fields are optional 28 | use_incremental: "yes" # "yes" by default, "no" Deployed using a incremental qcow2 image 29 | vpci: "0000:10:00.0" #requiered PCI at guess 30 | os_distro: win # operating system distribution 31 | os_type: windows # operating system type "linux" by default, "windows" 32 | os_version: "7" # operating system version 33 | bus: "ide" # By default "virtio" for linux, "ide" for windows 34 | -------------------------------------------------------------------------------- /openvim/templates/network.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | network: 23 | name: network-name 24 | type: data # "bridge_data" or "bridge_man" for control plane, "data" for dataplane, or "ptp" for point to point dataplane 25 | provider:physical: null # needed a value for a bridge_data, bridge_man, 26 | # can be: 27 | # bridge:iface_name : attached to a iface_name host bridge interface 28 | # macvtap:iface_name : attached to a iface_name host physical interface 29 | # default : attached to the default host interface 30 | # null : for data or ptp types. (To be changed in future versions) 31 | shared: true # true, false: if shared it will consider by OPENVIM an EXTERNAL network available at OPENMANO 32 | 33 | -------------------------------------------------------------------------------- /openvim/templates/port.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | port: 24 | name: port-name 25 | #network_id: network uuid this port must be attached 26 | type: external 27 | binding:vlan: 103 # if provided packets to/from this switch port will be vlan tagged 28 | binding:switch_port": "Te/01" # provide the openflow switch port 29 | #mac_address: 34:44:45:67:78:12 # mac address of the element behind this port. As normally is not know, leave commented 30 | -------------------------------------------------------------------------------- /openvim/templates/server.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | server: 23 | name: vm-name # name 24 | description: vm-description # Optional user description 25 | imageRef: 24640fe0-8a9e-11e4-a236-52540056c317 # valid image uuid 26 | flavorRef: e22dd8a8-9ca5-11e4-99b6-52540056c317 # valid flavor uuid 27 | networks: # List of control plane interfaces, Optional 28 | - name: mgmt0 #friendly user name 29 | vpci: "0000:00:0a.0" #Optional guess PCI 30 | uuid: c09b2f1a-8a9e-11e4-a236-52540056c317 # valid network uuid 31 | #mac_address: #guess concrete mac address, by default one is asigned 32 | #model: "virtio","e1000","ne2k_pci","pcnet","rtl8139", By default auto, normally virtio 33 | start: "yes" # "yes","no","paused". By default it is started upon creted 34 | hostId: ec656bc4-9ca5-11e4-99b6-52540056c317 #prefered host where to allocate 35 | 36 | # allocating EXCLUSIVE resoureces in the same NUMA node. 37 | # If provided, it overrides extended values at flavor 38 | extended: # optional 39 | processor_ranking: 100 # minimal processor family. Not used in current version 40 | numas: # list of numa set. Only one supported in current version 41 | - memory: 8 # GByte of huge pages at this numa 42 | 43 | #Choose among one of "cores", "paired-threads", "threads" 44 | paired-threads: 5 # Cores with two paired hyper threads 45 | #paired-threads-id: [[0,1],[2,3],[4,5],[6,7],[8,9]] # Guess pinning. By default follows incremental order 46 | #threads: 10 # threads awereness of the hyperthreading 47 | ##threads-id: [0,1,2,3,4,5,6,7,8,9] #Optional. Guess pinning 48 | #cores: 5 # Complete cores, without hyperthreading. VIM ensures the other paired thread is idle 49 | ##cores-id: [0,1,2,3,4] # Optional. Guess pinning of cores 50 | 51 | #Optional: Dataplane needed interfaces 52 | interfaces: 53 | - name: xe0 # Optional. User friendly name 54 | vpci: "0000:00:10.0" # Optional. Guess PCI 55 | bandwidth: 10 Gbps # Needed minimun bandwidth 56 | dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag) 57 | # you can attach this inteface to a network at server creation or later with a port attach 58 | #uuid: 41bcac58-9be9-11e4-b1b6-52540056c317 # Attach the interface to this network uuid 59 | - name: xe1 60 | vpci: "0000:00:11.0" 61 | bandwidth: 10 Gbps 62 | dedicated: "no" 63 | #mac_address: #guess concrete mac address, by default one is asigned. Not possible for dedicated: "yes" 64 | 65 | #Optional: List of extra devices 66 | devices: # order determines device letter asignation (hda, hdb, ...) 67 | - type: disk # "disk","cdrom","xml","usb" 68 | imageRef: 37598e34-ccb3-11e4-a996-52540030594e # UUID of an image, only for disk,cdrom,xml 69 | # vpci: "0000:00:03.0" # Optional, not for disk or cdrom 70 | # xml: 'Only for type xml: a XML described device xml text. Do not use single quotes inside 71 | # The following words, if found, will be replaced: 72 | # __file__ by image path, (imageiRef must be provided) 73 | # __format__ by qcow2 or raw (imageRef must be provided) 74 | # __dev__ by device letter (b, c, d ...) 75 | # __vpci__ by vpci (vpci must be provided) 76 | 77 | -------------------------------------------------------------------------------- /openvim/templates/tenant.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | tenant: 24 | name: tenant-name 25 | description: tenant-description 26 | -------------------------------------------------------------------------------- /openvim/test/2VM_2I.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | # 25 | #author Alfonso Tierno 26 | # 27 | #script to test openvim with the creation of flavors and interfaces 28 | #using images already inserted 29 | # 30 | 31 | echo " Creates 1 flavor, 3 nets, 2 VMs (US) 32 | Interfaces: 2 sriov, 1 passthrough, 1 sriov dedicated 33 | Test mac address allocation, 1 VM with direct network attach, 34 | another VM with network attach after creation" 35 | echo 36 | echo -n "type network model to test network model (empty to skip)? " 37 | read model 38 | echo "Press enter to continue" 39 | read kk 40 | if [ -n "$model" ] 41 | then 42 | model="model: '${model}'" 43 | fi 44 | #echo _${model}_ 45 | 46 | #image to load 47 | imagePath=/mnt/powervault/virtualization/vnfs/os/US1404.qcow2 48 | #image to load as an extra disk, can be any 49 | imagePath_extra=/mnt/powervault/virtualization/vnfs/os/US1404user.qcow2 50 | #default network to use 51 | network_eth0=default 52 | 53 | 54 | DIRNAME=`dirname $0` 55 | 56 | function del_rubbish(){ 57 | echo "Press enter to delete the deployed things" 58 | read kk 59 | [ -n "$DEL_server" ] && ${DIRNAME}/test_openvim.py -f del server $DEL_server 60 | [ -n "$DEL_network" ] && ${DIRNAME}/test_openvim.py -f del network $DEL_network 61 | [ -n "$DEL_flavor" ] && ${DIRNAME}/test_openvim.py -f del flavor $DEL_flavor 62 | [ -n "$DEL_image" ] && ${DIRNAME}/test_openvim.py -f del image $DEL_image 63 | rm -f kk.out 64 | } 65 | 66 | function proccess_out(){ # action_text field to retrieve 67 | if egrep -q "\"error\"" kk.out 68 | then 69 | echo "failed to" $1 70 | cat kk.out 71 | del_rubbish 72 | exit -1 73 | fi 74 | if [ -z "$2" ] ; then pattern='"id"' ; else pattern="$2" ; fi 75 | value=`egrep "$pattern" kk.out ` 76 | value=${value##* \"} 77 | value=${value%\"*} 78 | if [[ -z "$value" ]] 79 | then 80 | echo "not found the field" $2 81 | cat kk.out 82 | del_rubbish 83 | exit -1 84 | fi 85 | } 86 | 87 | #proccess_out "insert server tidgen1" '^ "id"' 88 | #echo $value 89 | #exit 0 90 | 91 | 92 | 93 | echo -n "get ${imagePath##*/} image: " 94 | ${DIRNAME}/test_openvim.py -F"path=$imagePath" images > kk.out 95 | proccess_out "get ${imagePath##*/}" 96 | echo $value 97 | image1=$value 98 | 99 | 100 | echo -n "get ${imagePath_extra##*/} image: " 101 | ${DIRNAME}/test_openvim.py -F"path=$imagePath_extra" images > kk.out 102 | proccess_out "get ${imagePath_extra##*/}" 103 | echo $value 104 | image2=$value 105 | 106 | 107 | echo -n "get ${network_eth0} network: " 108 | ${DIRNAME}/test_openvim.py -F"name=$network_eth0" network > kk.out 109 | proccess_out "get ${network_eth0} network" 110 | echo $value 111 | network_eth0=$value 112 | 113 | 114 | echo -n "insert flavor: " 115 | ${DIRNAME}/test_openvim.py new flavor ' 116 | --- 117 | flavor: 118 | name: 5PTh_8G_2I 119 | description: flavor to test openvim 120 | extended: 121 | processor_ranking: 205 122 | numas: 123 | - memory: 8 124 | paired-threads: 5 125 | interfaces: 126 | - name: xe0 127 | dedicated: "yes" 128 | bandwidth: "10 Gbps" 129 | vpci: "0000:00:10.0" 130 | #mac_address: "10:10:10:10:10:10" 131 | - name: xe1 132 | dedicated: "yes:sriov" 133 | bandwidth: "10 Gbps" 134 | vpci: "0000:00:11.0" 135 | mac_address: "10:10:10:10:10:11" 136 | ' > kk.out 137 | proccess_out "insert flavor" 138 | echo $value 139 | flavor1=$value 140 | DEL_flavor="$DEL_flavor $flavor1" 141 | 142 | 143 | echo -n "insert ptp net1: " 144 | ${DIRNAME}/test_openvim.py new network ' 145 | --- 146 | network: 147 | name: network-xe0 148 | type: ptp 149 | ' > kk.out 150 | proccess_out "insert network 0" 151 | echo $value 152 | network0=$value 153 | DEL_network="$DEL_network $value" 154 | 155 | 156 | echo -n "insert ptp net2: " 157 | ${DIRNAME}/test_openvim.py new network ' 158 | --- 159 | network: 160 | name: network-xe1 161 | type: ptp 162 | ' > kk.out 163 | proccess_out "insert network 1" 164 | echo $value 165 | network1=$value 166 | DEL_network="$DEL_network $value" 167 | 168 | 169 | 170 | echo -n "insert bridge network net2: " 171 | ${DIRNAME}/test_openvim.py new network ' 172 | --- 173 | network: 174 | name: network-net2 175 | type: bridge_data 176 | ' > kk.out 177 | proccess_out "insert network 2" 178 | echo $value 179 | network2=$value 180 | DEL_network="$DEL_network $value" 181 | 182 | echo -n "insert test VM 1: " 183 | ${DIRNAME}/test_openvim.py new server " 184 | --- 185 | server: 186 | name: test_VM1 187 | descrition: US or tidgen with 1 SRIOV 1 PASSTHROUGH 188 | imageRef: '$image1' 189 | flavorRef: '$flavor1' 190 | networks: 191 | - name: mgmt0 192 | vpci: '0000:00:0a.0' 193 | uuid: ${network_eth0} 194 | mac_address: '10:10:10:10:10:12' 195 | - name: eth0 196 | vpci: '0000:00:0b.0' 197 | uuid: '$network2' 198 | mac_address: '10:10:10:10:10:13' 199 | ${model} 200 | " > kk.out 201 | proccess_out "insert test VM 2" '^ "id"' 202 | echo $value 203 | server1=$value 204 | DEL_server="$DEL_server $value" 205 | 206 | 207 | 208 | echo -n "insert test VM 2: " 209 | ${DIRNAME}/test_openvim.py new server " 210 | --- 211 | server: 212 | name: test_VM2 213 | descrition: US or tidgen with direct network attach 214 | imageRef: '$image1' 215 | flavorRef: '$flavor1' 216 | extended: 217 | processor_ranking: 205 218 | numas: 219 | - memory: 8 220 | threads: 10 221 | interfaces: 222 | - name: xe0 223 | dedicated: 'yes' 224 | bandwidth: '10 Gbps' 225 | vpci: '0000:00:10.0' 226 | #mac_address: '10:10:10:10:aa:10' 227 | uuid: '$network0' 228 | - name: xe1 229 | dedicated: 'no' 230 | bandwidth: '7 Gbps' 231 | vpci: '0000:00:11.0' 232 | mac_address: '10:10:10:10:aa:11' 233 | uuid: '$network1' 234 | devices: 235 | - type: disk 236 | imageRef: '$image2' 237 | networks: 238 | - name: mgmt0 239 | vpci: '0000:00:0a.0' 240 | uuid: ${network_eth0} 241 | mac_address: '10:10:10:10:aa:12' 242 | - name: eth0 243 | vpci: '0000:00:0b.0' 244 | uuid: '$network2' 245 | mac_address: '10:10:10:10:aa:13' 246 | ${model} 247 | " > kk.out 248 | proccess_out "insert test VM 2" '^ "id"' 249 | echo $value 250 | server2=$value 251 | DEL_server="$DEL_server $value" 252 | 253 | echo -n "get xe0 iface uuid from tidgen1: " 254 | ${DIRNAME}/test_openvim.py -F "device_id=${server1}&name=xe0" ports > kk.out 255 | proccess_out "get xe0 uuid port from tidgen1" 256 | echo $value 257 | iface_xe0=$value 258 | 259 | 260 | echo -n "get xe1 iface uuid from tidgen1: " 261 | ${DIRNAME}/test_openvim.py -F "device_id=${server1}&name=xe1" ports > kk.out 262 | proccess_out "get xe1 uuid port from tidgen1" 263 | echo $value 264 | iface_xe1=$value 265 | 266 | 267 | echo -n "attach xe0 from tidgen1 to network " 268 | ${DIRNAME}/test_openvim.py -f edit ports $iface_xe0 "network_id: $network0" > kk.out 269 | proccess_out "attach xe0 from tidgen1 to network" 270 | echo "ok" 271 | 272 | 273 | echo -n "attach xe1 from tidgen1 to network " 274 | ${DIRNAME}/test_openvim.py -f edit ports $iface_xe1 "network_id: $network1" > kk.out 275 | proccess_out "attach xe1 from tidgen1 to network" 276 | echo "ok" 277 | 278 | 279 | echo 280 | echo finish. Check connections!! 281 | echo click return to delete all deployed things 282 | echo 283 | 284 | del_rubbish 285 | exit 0 286 | 287 | -------------------------------------------------------------------------------- /openvim/test/2VM_2I_2VLAN.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | # 25 | #author Alfonso Tierno 26 | # 27 | #script to test openvim with the creation of flavors and interfaces 28 | #using images already inserted 29 | # 30 | 31 | echo " Creates 1 flavor, 3 nets, 2 VMs (US) 32 | Interfaces: 2 sriov, 1 passthrough, 1 sriov dedicated 33 | Test mac address allocation, 1 VM with direct network attach, 34 | another VM with network attach after creation" 35 | echo 36 | echo "Press enter to continue" 37 | read kk 38 | 39 | #image to load 40 | imagePath=/mnt/powervault/virtualization/vnfs/os/US1404.qcow2 41 | #image to load as an extra disk, can be any 42 | imagePath_extra=/mnt/powervault/virtualization/vnfs/os/US1404user.qcow2 43 | #default network to use 44 | network_eth0=default 45 | 46 | 47 | DIRNAME=`dirname $0` 48 | 49 | function del_rubbish(){ 50 | echo "Press enter to delete the deployed things" 51 | read kk 52 | [ -n "$DEL_server" ] && ${DIRNAME}/test_openvim.py -f del server $DEL_server 53 | [ -n "$DEL_network" ] && ${DIRNAME}/test_openvim.py -f del network $DEL_network 54 | [ -n "$DEL_flavor" ] && ${DIRNAME}/test_openvim.py -f del flavor $DEL_flavor 55 | [ -n "$DEL_image" ] && ${DIRNAME}/test_openvim.py -f del image $DEL_image 56 | rm -f kk.out 57 | } 58 | 59 | function proccess_out(){ # action_text field to retrieve 60 | if egrep -q "\"error\"" kk.out 61 | then 62 | echo "failed to" $1 63 | cat kk.out 64 | del_rubbish 65 | exit -1 66 | fi 67 | if [ -z "$2" ] ; then pattern='"id"' ; else pattern="$2" ; fi 68 | value=`egrep "$pattern" kk.out ` 69 | value=${value##* \"} 70 | value=${value%\"*} 71 | if [[ -z "$value" ]] 72 | then 73 | echo "not found the field" $2 74 | cat kk.out 75 | del_rubbish 76 | exit -1 77 | fi 78 | } 79 | 80 | #proccess_out "insert server tidgen1" '^ "id"' 81 | #echo $value 82 | #exit 0 83 | 84 | 85 | 86 | echo -n "get ${imagePath##*/} image: " 87 | ${DIRNAME}/test_openvim.py -F"path=$imagePath" images > kk.out 88 | proccess_out "get ${imagePath##*/}" 89 | echo $value 90 | image1=$value 91 | 92 | 93 | echo -n "get ${imagePath_extra##*/} image: " 94 | ${DIRNAME}/test_openvim.py -F"path=$imagePath_extra" images > kk.out 95 | proccess_out "get ${imagePath_extra##*/}" 96 | echo $value 97 | image2=$value 98 | 99 | 100 | echo -n "get ${network_eth0} network: " 101 | ${DIRNAME}/test_openvim.py -F"name=$network_eth0" network > kk.out 102 | proccess_out "get ${network_eth0} network" 103 | echo $value 104 | network_eth0=$value 105 | 106 | 107 | echo -n "insert flavor: " 108 | ${DIRNAME}/test_openvim.py new flavor ' 109 | --- 110 | flavor: 111 | name: 5PTh_8G_2I 112 | description: flavor to test openvim 113 | extended: 114 | processor_ranking: 205 115 | numas: 116 | - memory: 8 117 | paired-threads: 5 118 | interfaces: 119 | - name: xe0 120 | dedicated: "yes" 121 | bandwidth: "10 Gbps" 122 | vpci: "0000:00:10.0" 123 | #mac_address: "10:10:10:10:10:10" 124 | - name: xe1 125 | dedicated: "no" 126 | bandwidth: "10 Gbps" 127 | vpci: "0000:00:11.0" 128 | mac_address: "10:10:10:10:10:11" 129 | ' > kk.out 130 | proccess_out "insert flavor" 131 | echo $value 132 | flavor1=$value 133 | DEL_flavor="$DEL_flavor $flavor1" 134 | 135 | 136 | echo -n "insert ptp net1: " 137 | ${DIRNAME}/test_openvim.py new network ' 138 | --- 139 | network: 140 | name: network-xe0 141 | type: ptp 142 | ' > kk.out 143 | proccess_out "insert network 0" 144 | echo $value 145 | network0=$value 146 | DEL_network="$DEL_network $value" 147 | 148 | 149 | echo -n "insert ptp net2: " 150 | ${DIRNAME}/test_openvim.py new network ' 151 | --- 152 | network: 153 | name: network-xe1 154 | type: ptp 155 | ' > kk.out 156 | proccess_out "insert network 1" 157 | echo $value 158 | network1=$value 159 | DEL_network="$DEL_network $value" 160 | 161 | 162 | 163 | echo -n "insert bridge network net2: " 164 | ${DIRNAME}/test_openvim.py new network ' 165 | --- 166 | network: 167 | name: network-net2 168 | type: bridge_data 169 | ' > kk.out 170 | proccess_out "insert network 2" 171 | echo $value 172 | network2=$value 173 | DEL_network="$DEL_network $value" 174 | 175 | echo -n "insert test VM 1: " 176 | ${DIRNAME}/test_openvim.py new server " 177 | --- 178 | server: 179 | name: test_VM1 180 | descrition: US or tidgen with 1 SRIOV 1 PASSTHROUGH 181 | imageRef: '$image1' 182 | flavorRef: '$flavor1' 183 | networks: 184 | - name: mgmt0 185 | vpci: '0000:00:0a.0' 186 | uuid: ${network_eth0} 187 | mac_address: '10:10:10:10:10:12' 188 | - name: eth0 189 | vpci: '0000:00:0b.0' 190 | uuid: '$network2' 191 | mac_address: '10:10:10:10:10:13' 192 | " > kk.out 193 | proccess_out "insert test VM 2" '^ "id"' 194 | echo $value 195 | server1=$value 196 | DEL_server="$DEL_server $value" 197 | 198 | 199 | 200 | echo -n "insert test VM 2: " 201 | ${DIRNAME}/test_openvim.py new server " 202 | --- 203 | server: 204 | name: test_VM2 205 | descrition: US or tidgen with direct network attach 206 | imageRef: '$image1' 207 | flavorRef: '$flavor1' 208 | networks: 209 | - name: mgmt0 210 | vpci: '0000:00:0a.0' 211 | uuid: ${network_eth0} 212 | mac_address: '10:10:10:10:aa:12' 213 | - name: eth0 214 | vpci: '0000:00:0b.0' 215 | uuid: '$network2' 216 | mac_address: '10:10:10:10:aa:13' 217 | extended: 218 | processor_ranking: 205 219 | numas: 220 | - memory: 8 221 | threads: 10 222 | interfaces: 223 | - name: xe0 224 | dedicated: 'yes' 225 | bandwidth: '10 Gbps' 226 | vpci: '0000:00:10.0' 227 | #mac_address: '10:10:10:10:aa:10' 228 | uuid: '$network0' 229 | - name: xe1 230 | dedicated: 'no' 231 | bandwidth: '7 Gbps' 232 | vpci: '0000:00:11.0' 233 | mac_address: '10:10:10:10:aa:11' 234 | uuid: '$network1' 235 | devices: 236 | - type: disk 237 | imageRef: '$image2' 238 | " > kk.out 239 | proccess_out "insert test VM 2" '^ "id"' 240 | echo $value 241 | server2=$value 242 | DEL_server="$DEL_server $value" 243 | 244 | echo -n "get xe0 iface uuid from tidgen1: " 245 | ${DIRNAME}/test_openvim.py -F "device_id=${server1}&name=xe0" ports > kk.out 246 | proccess_out "get xe0 uuid port from tidgen1" 247 | echo $value 248 | iface_xe0=$value 249 | 250 | 251 | echo -n "get xe1 iface uuid from tidgen1: " 252 | ${DIRNAME}/test_openvim.py -F "device_id=${server1}&name=xe1" ports > kk.out 253 | proccess_out "get xe1 uuid port from tidgen1" 254 | echo $value 255 | iface_xe1=$value 256 | 257 | 258 | echo -n "attach xe0 from tidgen1 to network " 259 | ${DIRNAME}/test_openvim.py -f edit ports $iface_xe0 "network_id: $network0" > kk.out 260 | proccess_out "attach xe0 from tidgen1 to network" 261 | echo "ok" 262 | 263 | 264 | echo -n "attach xe1 from tidgen1 to network " 265 | ${DIRNAME}/test_openvim.py -f edit ports $iface_xe1 "network_id: $network1" > kk.out 266 | proccess_out "attach xe1 from tidgen1 to network" 267 | echo "ok" 268 | 269 | 270 | echo 271 | echo finsish. Check connections!! 272 | echo 273 | 274 | del_rubbish 275 | exit 0 276 | 277 | -------------------------------------------------------------------------------- /openvim/test/2VM_NoHuge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 4 | # This file is part of openmano 5 | # All Rights Reserved. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | # not use this file except in compliance with the License. You may obtain 9 | # a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | # License for the specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | # For those usages not covered by the Apache License, Version 2.0 please 20 | # contact with: nfvlabs@tid.es 21 | ## 22 | 23 | # 24 | #author Alfonso Tierno 25 | # 26 | #script to test openvim with the creation of flavors and interfaces 27 | #in cloud style 28 | # 29 | 30 | echo " Creates 1 flavor, 3 nets, 2 VMs (US) 31 | WITHOUT huge pages, nor NUMA assigment 32 | network attach after creation" 33 | echo 34 | echo "Press enter to continue" 35 | read kk 36 | 37 | #image to load 38 | imagePath=/mnt/powervault/virtualization/vnfs/os/US1404.qcow2 39 | #image to load as an extra disk, can be any 40 | imagePath_extra=/mnt/powervault/virtualization/vnfs/os/US1404user.qcow2 41 | #default network to use 42 | network_eth0=default 43 | 44 | 45 | DIRNAME=`dirname $0` 46 | 47 | function del_rubbish(){ 48 | echo "Press enter to delete the deployed things" 49 | read kk 50 | [ -n "$DEL_server" ] && ${DIRNAME}/test_openvim.py -f del server $DEL_server 51 | [ -n "$DEL_network" ] && ${DIRNAME}/test_openvim.py -f del network $DEL_network 52 | [ -n "$DEL_flavor" ] && ${DIRNAME}/test_openvim.py -f del flavor $DEL_flavor 53 | [ -n "$DEL_image" ] && ${DIRNAME}/test_openvim.py -f del image $DEL_image 54 | rm -f kk.out 55 | } 56 | 57 | function proccess_out(){ # action_text field to retrieve 58 | if egrep -q "\"error\"" kk.out 59 | then 60 | echo "failed to" $1 61 | cat kk.out 62 | del_rubbish 63 | exit -1 64 | fi 65 | if [ -z "$2" ] ; then pattern='"id"' ; else pattern="$2" ; fi 66 | value=`egrep "$pattern" kk.out ` 67 | value=${value##* \"} 68 | value=${value%\"*} 69 | if [[ -z "$value" ]] 70 | then 71 | echo "not found the field" $2 72 | cat kk.out 73 | del_rubbish 74 | exit -1 75 | fi 76 | } 77 | 78 | #proccess_out "insert server tidgen1" '^ "id"' 79 | #echo $value 80 | #exit 0 81 | 82 | 83 | 84 | echo -n "get ${imagePath##*/} image: " 85 | ${DIRNAME}/test_openvim.py -F"path=$imagePath" images > kk.out 86 | proccess_out "get ${imagePath##*/}" 87 | echo $value 88 | image1=$value 89 | 90 | 91 | echo -n "get ${imagePath_extra##*/} image: " 92 | ${DIRNAME}/test_openvim.py -F"path=$imagePath_extra" images > kk.out 93 | proccess_out "get ${imagePath_extra##*/}" 94 | echo $value 95 | image2=$value 96 | 97 | 98 | echo -n "get ${network_eth0} network: " 99 | ${DIRNAME}/test_openvim.py -F"name=$network_eth0" network > kk.out 100 | proccess_out "get ${network_eth0} network" 101 | echo $value 102 | network_eth0=$value 103 | 104 | 105 | echo -n "insert flavor: " 106 | ${DIRNAME}/test_openvim.py new flavor ' 107 | --- 108 | flavor: 109 | name: CloudVM 110 | description: normal cloud image with 1G, 1core 111 | ram: 1024 112 | vcpus: 1 113 | ' > kk.out 114 | proccess_out "insert flavor" 115 | echo $value 116 | flavor1=$value 117 | DEL_flavor="$DEL_flavor $flavor1" 118 | 119 | 120 | echo 121 | echo "Press enter to continue" 122 | read kk 123 | 124 | echo -n "insert bridge network net2: " 125 | ${DIRNAME}/test_openvim.py new network ' 126 | --- 127 | network: 128 | name: network-bridge 129 | type: bridge_data 130 | ' > kk.out 131 | proccess_out "insert network 2" 132 | echo $value 133 | network2=$value 134 | DEL_network="$DEL_network $value" 135 | 136 | echo -n "insert test VM 1: " 137 | ${DIRNAME}/test_openvim.py new server " 138 | --- 139 | server: 140 | name: test_VM1 141 | descrition: US 1 core 142 | imageRef: '$image1' 143 | flavorRef: '$flavor1' 144 | networks: 145 | - name: mgmt0 146 | vpci: '0000:00:0a.0' 147 | uuid: ${network_eth0} 148 | mac_address: '10:10:10:10:10:12' 149 | - name: eth0 150 | vpci: '0000:00:0b.0' 151 | uuid: '$network2' 152 | mac_address: '10:10:10:10:10:13' 153 | " > kk.out 154 | proccess_out "insert test VM 2" '^ "id"' 155 | echo $value 156 | server1=$value 157 | DEL_server="$DEL_server $value" 158 | 159 | 160 | echo 161 | echo "Press enter to continue" 162 | read kk 163 | 164 | echo -n "insert test VM 2: " 165 | ${DIRNAME}/test_openvim.py new server " 166 | --- 167 | server: 168 | name: test_VM2 169 | descrition: US 1G 1core 170 | imageRef: '$image1' 171 | flavorRef: '$flavor1' 172 | ram: 1024 173 | vcpus: 1 174 | networks: 175 | - name: mgmt0 176 | vpci: '0000:00:0a.0' 177 | uuid: ${network_eth0} 178 | mac_address: '10:10:10:10:aa:12' 179 | - name: eth0 180 | vpci: '0000:00:0b.0' 181 | uuid: '$network2' 182 | mac_address: '10:10:10:10:aa:13' 183 | extended: 184 | devices: 185 | - type: disk 186 | imageRef: '$image2' 187 | " > kk.out 188 | proccess_out "insert test VM 2" '^ "id"' 189 | echo $value 190 | server2=$value 191 | DEL_server="$DEL_server $value" 192 | 193 | echo 194 | echo finsish. Check connections!! 195 | echo 196 | 197 | del_rubbish 198 | exit 0 199 | 200 | -------------------------------------------------------------------------------- /openvim/test/flavors/2Th_2G.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | { 24 | "flavor":{ 25 | "name":"2Th_2G", 26 | "description":"2 Threads, 2Gbyte, only 2 management interfaces", 27 | "extended":{ 28 | "processor_ranking":205, 29 | "numas":[ 30 | { 31 | "memory":2, 32 | "threads":2 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /openvim/test/flavors/5PTh_8G_2I.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | # 5Th_8G_2P 23 | flavor: 24 | name: 5PTh_8G_2I 25 | description: 5Pair threads (10tthreads) 8GB memory and 2 dataplane passthrough interfaces 26 | extended: 27 | processor_ranking: 100 28 | numas: 29 | - memory: 8 30 | paired-threads: 5 31 | interfaces: 32 | - name: xe0 33 | vpci: "0000:00:10.0" 34 | bandwidth: 10 Gbps 35 | dedicated: "yes" 36 | - name: xe1 37 | vpci: "0000:00:11.0" 38 | bandwidth: 10 Gbps 39 | dedicated: "yes" 40 | -------------------------------------------------------------------------------- /openvim/test/flavors/new_flavor.yaml: -------------------------------------------------------------------------------- 1 | 2 | ## 3 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 4 | # This file is part of openmano 5 | # All Rights Reserved. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | # not use this file except in compliance with the License. You may obtain 9 | # a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | # License for the specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | # For those usages not covered by the Apache License, Version 2.0 please 20 | # contact with: nfvlabs@tid.es 21 | ## 22 | 23 | { 24 | "${}":[ 25 | "${name} flavor name", 26 | "${description} flavor description (${name})", 27 | "${processor_ranking} processnor ranking (100)", 28 | "${memory} memory in GB (2)", 29 | "${threads} threads needed (2)" 30 | ], 31 | 32 | "flavor":{ 33 | "name":"${name}", 34 | "description":"${description}", 35 | "extended":{ 36 | "processor_ranking":"${processor_ranking int}", 37 | "numas":[ 38 | { 39 | "memory":"${memory int}", 40 | "threads":"${threads int}" 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /openvim/test/get_params.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | # 25 | #author Alfonso Tierno 26 | # 27 | #script that obtain the parameters from the configuration file 28 | #it is a bit unsafe because a comment in the yaml configuration file 29 | #can wrong this script 30 | 31 | #get params from configuration file 32 | 33 | [ -z "$1" ] && echo "usage: $0 [openvim_cfg_file]" && exit 34 | 35 | OPENVIM_PORT=`grep http_port: $1` 36 | OPENVIM_PORT=${OPENVIM_PORT#http_port:} 37 | OPENVIM_PORT=${OPENVIM_PORT%%#*} 38 | OPENVIM_PORT=`eval echo ${OPENVIM_PORT}` # remove white spaces 39 | 40 | OPENVIM_ADMIN_PORT=`grep http_admin_port: $1` 41 | OPENVIM_ADMIN_PORT=${OPENVIM_ADMIN_PORT#http_admin_port:} 42 | OPENVIM_ADMIN_PORT=${OPENVIM_ADMIN_PORT%%#*} 43 | OPENVIM_ADMIN_PORT=`eval echo ${OPENVIM_ADMIN_PORT}` # remove white spaces 44 | 45 | OPENVIM_HOST=`grep http_host: $1` 46 | OPENVIM_HOST=${OPENVIM_HOST#http_host:} 47 | OPENVIM_HOST=${OPENVIM_HOST%%#*} 48 | OPENVIM_HOST=`eval echo ${OPENVIM_HOST}` # remove white spaces 49 | 50 | OPENVIM_OF_IP=`grep of_controller_ip: $1` 51 | OPENVIM_OF_IP=${OPENVIM_OF_IP#of_controller_ip:} 52 | OPENVIM_OF_IP=${OPENVIM_OF_IP%%#*} 53 | OPENVIM_OF_IP=`eval echo ${OPENVIM_OF_IP}` # remove white spaces 54 | 55 | OPENVIM_OF_PORT=`grep of_controller_port: $1` 56 | OPENVIM_OF_PORT=${OPENVIM_OF_PORT#of_controller_port:} 57 | OPENVIM_OF_PORT=${OPENVIM_OF_PORT%%#*} 58 | OPENVIM_OF_PORT=`eval echo ${OPENVIM_OF_PORT}` # remove white spaces 59 | 60 | OPENVIM_OF_DPID=`grep of_controller_dpid: $1` 61 | OPENVIM_OF_DPID=${OPENVIM_OF_DPID#of_controller_dpid:} 62 | OPENVIM_OF_DPID=${OPENVIM_OF_DPID%%#*} 63 | OPENVIM_OF_DPID=`eval echo ${OPENVIM_OF_DPID}` # remove white spaces 64 | 65 | -------------------------------------------------------------------------------- /openvim/test/hosts/new_host.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | { 23 | "${}":[ 24 | "${name} host name", 25 | "${user} host user (n2)", 26 | "${ip_name} host access ip or name (${name}.hi.inet)", 27 | "${description} host description (${name})" 28 | ], 29 | 30 | "host":{ 31 | "name": "${name}", 32 | "user": "${user}", 33 | "ip_name": "${ip_name}", 34 | "description": "${description}" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /openvim/test/images/new_image.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | { 24 | "${}":[ 25 | "${name} image name", 26 | "${path} image path (/mnt/powervault/virtualization/vnfs/os/US1404user.qcow2)", 27 | "${description} image description (${name})" 28 | ], 29 | "image":{ 30 | "name":"${name}", 31 | "description":"${description}", 32 | "path":"${path}" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openvim/test/networks/net-example0.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | name: default 3 | type: bridge_man 4 | provider:physical: default 5 | shared: true 6 | 7 | -------------------------------------------------------------------------------- /openvim/test/networks/net-example1.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | name: macvtap:em1 3 | type: bridge_man 4 | provider:physical: macvtap:em1 5 | shared: true 6 | 7 | -------------------------------------------------------------------------------- /openvim/test/networks/net-example2.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | name: shared_bridge_net 3 | type: bridge_data 4 | provider:physical: bridge:virbrMan1 5 | shared: true 6 | 7 | -------------------------------------------------------------------------------- /openvim/test/networks/net-example3.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | name: data_net 3 | type: data 4 | 5 | #if you want to connect this network to a concrete switch port for outside connectivity 6 | #indicate it at provider_physical with openflow:[:vlan] 7 | # must be a valid openflow port (one of the listed with openvim openflow-port-list) 8 | #add [:vlan] without spaces if this port must be vlan tagged. If missing it is not tagged 9 | 10 | #provider:vlan contains the vlan used by the SRIOV interfaces connected to this network 11 | #it always contain a value regardless used or not. If missing openvim will assign a value 12 | 13 | provider:physical: openflow:port1/8:vlan 14 | provider:vlan: 3001 15 | shared: true 16 | 17 | -------------------------------------------------------------------------------- /openvim/test/networks/new_network.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | { 24 | "${}":[ 25 | "${name} provide a network name", 26 | "${type} provide a type: bridge_data,bridge_man,data,ptp (ptp)" 27 | ], 28 | 29 | "network":{ 30 | "name": "${name}", 31 | "type": "${type}" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /openvim/test/ports/new_port.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | 23 | { 24 | "${}":[ 25 | "${name} provide a port name", 26 | "${net_id} provide the network uuid (null):", 27 | "${vlan} provide the vlan if any (null):", 28 | "${port} provide the attached switch port (Te0/47)", 29 | "${mac} provide the mac of external device if known (null):" 30 | ], 31 | 32 | "port":{ 33 | "name": "${name}", 34 | "network_id": "${net_id null}", 35 | "type": "external", 36 | "binding:vlan": "${vlan null-int}", 37 | "binding:switch_port": "${port}", 38 | "mac_address": "${mac null}" 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /openvim/test/servers/new_server.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | { 23 | "${}":[ 24 | "${name} provide a name (VM)", 25 | "${description} provide a description (${name})", 26 | "${image_id} provide image_id uuid", 27 | "${flavor_id} provide flavor_id uuid", 28 | "${network0} provide a bridge network id; enter='default' (00000000-0000-0000-0000-000000000000)", 29 | "${network1} provide a bridge network id; enter='virbrMan' (60f5227e-195f-11e4-836d-52540030594e)" 30 | ], 31 | "server":{ 32 | "networks":[ 33 | { 34 | "name":"mgmt0", 35 | "vpci": "0000:00:0a.0", 36 | "uuid":"${network0}" 37 | }, 38 | { 39 | "name":"ge0", 40 | "vpci": "0000:00:0b.0", 41 | "uuid":"${network1}" 42 | } 43 | ], 44 | "name":"${name}", 45 | "description":"${description}", 46 | "imageRef": "${image_id}", 47 | "flavorRef": "${flavor_id}" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /openvim/test/tenants/new_tenant.yaml: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | { 23 | "${}":[ 24 | "${name} tenant name", 25 | "${description} tenant description (${name})" 26 | ], 27 | 28 | "tenant":{ 29 | "name": "${name}", 30 | "description": "${description}" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /openvim/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/openvim/utils/__init__.py -------------------------------------------------------------------------------- /openvim/utils/definitionsClass.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | ''' 25 | Definitions of classes for the Host operating server, ... 26 | ''' 27 | 28 | __author__="Pablo Montes" 29 | 30 | 31 | class Units(): 32 | memory_1000 = 1 33 | memory_1024 = 2 34 | memory_full = 3 35 | bw = 4 36 | freq = 5 37 | no_units = 6 38 | name = 7 39 | boolean = 8 40 | 41 | class definitionsClass(): 42 | user = 'n2' 43 | password = 'n2' 44 | extrict_hugepages_allocation = True 45 | processor_possible_features = ['64b','iommu','lps','tlbps','hwsv','dioc','ht'] 46 | processor_possible_manufacturers = ['Intel','AMD'] 47 | processor_possible_families = ['Xeon'] 48 | processor_possible_versions = ['Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz', 'Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz','Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz'] 49 | memory_possible_types = ['DDR2','DDR3'] 50 | memory_possible_form_factors = ['DIMM'] 51 | hypervisor_possible_types = ['QEMU'] 52 | hypervisor_possible_domain_types = ['kvm'] #['qemu', 'kvm'] 53 | os_possible_id = ['Red Hat Enterprise Linux Server release 6.4 (Santiago)', 54 | 'Red Hat Enterprise Linux Server release 6.5 (Santiago)', 55 | 'Red Hat Enterprise Linux Server release 6.6 (Santiago)', 56 | 'CentOS release 6.5 (Final)', 57 | 'CentOS release 6.6 (Final)', 58 | 'Red Hat Enterprise Linux Server release 7.0 (Maipo)', 59 | 'Red Hat Enterprise Linux Server release 7.1 (Maipo)', 60 | ] 61 | os_possible_types = ['GNU/Linux'] 62 | os_possible_architectures = ['x86_64'] 63 | hypervisor_possible_composed_versions = ['QEMU-kvm'] 64 | units = dict() 65 | units[Units.bw] = ['Gbps', 'Mbps', 'kbps', 'bps'] 66 | units[Units.freq] = ['GHz', 'MHz', 'KHz', 'Hz'] 67 | units[Units.memory_1000] = ['GB', 'MB', 'KB', 'B'] 68 | units[Units.memory_1024] = ['GiB', 'MiB', 'KiB', 'B'] 69 | units[Units.memory_full] = ['GB', 'MB', 'KB', 'GiB', 'MiB', 'KiB', 'B'] 70 | valid_hugepage_sz = [1073741824, 2097152] #In bytes 71 | valid_VNFC_iface_types = ['mgmt','data'] 72 | 73 | def __init__(self): 74 | return 75 | 76 | -------------------------------------------------------------------------------- /scripts/flow-logback.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 25 | 26 | 27 | %level [%logger:%thread] %msg%n 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /scripts/flow.properties: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 3 | # This file is part of openmano 4 | # All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # For those usages not covered by the Apache License, Version 2.0 please 19 | # contact with: nfvlabs@tid.es 20 | ## 21 | 22 | floodlight.modules = net.floodlightcontroller.storage.memory.MemoryStorageSource,\ 23 | net.floodlightcontroller.core.FloodlightProvider,\ 24 | net.floodlightcontroller.threadpool.ThreadPool,\ 25 | net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher,\ 26 | net.floodlightcontroller.firewall.Firewall,\ 27 | net.floodlightcontroller.jython.JythonDebugInterface,\ 28 | net.floodlightcontroller.counter.CounterStore,\ 29 | net.floodlightcontroller.perfmon.PktInProcessingTime,\ 30 | net.floodlightcontroller.ui.web.StaticWebRoutable 31 | 32 | #PORT API floodlight will listen to. Must match the 'of_controller_port' of openvimd.cfg 33 | net.floodlightcontroller.restserver.RestApiServer.port = 7070 34 | 35 | #PORT used by the switch to connect to floodlight 36 | net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633 37 | net.floodlightcontroller.jython.JythonDebugInterface.port = 6655 38 | 39 | #timeout parameters 40 | net.floodlightcontroller.forwarding.Forwarding.idletimeout = 5 41 | net.floodlightcontroller.forwarding.Forwarding.hardtimeout = 0 42 | 43 | -------------------------------------------------------------------------------- /scripts/flow.properties_v1.1: -------------------------------------------------------------------------------- 1 | floodlight.modules=\ 2 | net.floodlightcontroller.jython.JythonDebugInterface,\ 3 | net.floodlightcontroller.storage.memory.MemoryStorageSource,\ 4 | net.floodlightcontroller.core.internal.FloodlightProvider,\ 5 | net.floodlightcontroller.threadpool.ThreadPool,\ 6 | net.floodlightcontroller.debugcounter.DebugCounterServiceImpl,\ 7 | net.floodlightcontroller.perfmon.PktInProcessingTime,\ 8 | net.floodlightcontroller.debugevent.DebugEventService,\ 9 | net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher,\ 10 | net.floodlightcontroller.restserver.RestApiServer,\ 11 | net.floodlightcontroller.topology.TopologyManager,\ 12 | net.floodlightcontroller.forwarding.Forwarding,\ 13 | net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager,\ 14 | net.floodlightcontroller.ui.web.StaticWebRoutable,\ 15 | net.floodlightcontroller.loadbalancer.LoadBalancer,\ 16 | net.floodlightcontroller.firewall.Firewall,\ 17 | net.floodlightcontroller.devicemanager.internal.DeviceManagerImpl 18 | org.sdnplatform.sync.internal.SyncManager.authScheme=CHALLENGE_RESPONSE 19 | org.sdnplatform.sync.internal.SyncManager.keyStorePath=/etc/floodlight/auth_credentials.jceks 20 | org.sdnplatform.sync.internal.SyncManager.dbPath=/var/lib/floodlight/ 21 | org.sdnplatform.sync.internal.SyncManager.port=6642 22 | net.floodlightcontroller.core.internal.FloodlightProvider.openflowPort=6653 23 | net.floodlightcontroller.core.internal.FloodlightProvider.role=ACTIVE 24 | net.floodlightcontroller.core.internal.OFSwitchManager.clearTablesOnInitialHandshakeAsMaster=YES 25 | net.floodlightcontroller.core.internal.OFSwitchManager.clearTablesOnEachTransitionToMaster=YES 26 | net.floodlightcontroller.core.internal.OFSwitchManager.keyStorePath=/path/to/your/keystore-file.jks 27 | net.floodlightcontroller.core.internal.OFSwitchManager.keyStorePassword=your-keystore-password 28 | net.floodlightcontroller.core.internal.OFSwitchManager.useSsl=NO 29 | net.floodlightcontroller.restserver.RestApiServer.keyStorePath=/path/to/your/keystore-file.jks 30 | net.floodlightcontroller.restserver.RestApiServer.keyStorePassword=your-keystore-password 31 | net.floodlightcontroller.restserver.RestApiServer.httpsNeedClientAuthentication=NO 32 | net.floodlightcontroller.restserver.RestApiServer.useHttps=NO 33 | net.floodlightcontroller.restserver.RestApiServer.useHttp=YES 34 | net.floodlightcontroller.restserver.RestApiServer.httpsPort=8081 35 | net.floodlightcontroller.restserver.RestApiServer.httpPort=8080 36 | 37 | -------------------------------------------------------------------------------- /scripts/host-add-develop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | #Get configuration of a host for using it as a compute node 25 | 26 | function usage(){ 27 | echo -e "usage: $0 user ip_name nb_cores GiB_memory nb_10GB_interfaces [hostname] [>> host.yaml]\n Get host parameters and generated a yaml file to be used for openvim host-add" 28 | echo -e " - In case hostname is not specified it will be used the name of the machine where the script is run" 29 | echo -e " - nb_cores must be an odd number and bigger or equal to 4." 30 | echo -e " - GiB_memory must be an odd number and bigger or equal to 16. 4GiB of memory will be reserved for the host OS, the rest will be used by VM." 31 | echo -e " - nb_10GB_interfaces must be an odd number and bigger or equal to 4." 32 | echo -e " - The output will be a server descriptor with two numas and resources (memory, cores and interfaces) equally distributed between them." 33 | echo -e " - Each interface (physical funtion) will have defined 8 SR-IOV (virtual functions)." 34 | exit 1 35 | } 36 | 37 | function get_hash_value() { echo `eval echo $\{\`echo $1[$2]\`\}`; } 38 | 39 | function get_mac(){ 40 | seed=$1 41 | b1=$((seed%16)); seed=$((seed/16)) 42 | b2=$((seed%16)); seed=$((seed/16)) 43 | b3=$((seed%16)); seed=$((seed/16)) 44 | b4=$((seed%16)); seed=$((seed/16)) 45 | b5=$((seed%16)); seed=$((seed/16)) 46 | mac=`printf "%02X:%02X:%02X:%02X:%02X:%02X" 2 $b5 $b4 $b3 $b2 $b1` 47 | echo $mac 48 | } 49 | 50 | 51 | #check root privileges and non a root user behind 52 | 53 | [ "$#" -lt "5" ] && echo "Missing parameters" && usage 54 | [ "$#" -gt "6" ] && echo "Too many parameters" && usage 55 | HOST_NAME=`cat /etc/hostname` 56 | [ "$#" -eq "6" ] && HOST_NAME=$6 57 | FEATURES_LIST="lps,dioc,hwsv,tlbps,ht,lps,64b,iommu" 58 | NUMAS=2 59 | CORES=$3 60 | MEMORY=$4 61 | INTERFACES=$5 62 | 63 | #Ensure the user input is big enough 64 | ([ $((CORES%2)) -ne 0 ] || [ $CORES -lt 4 ] ) && echo -e "ERROR: Wrong number of cores\n" && usage 65 | ([ $((MEMORY%2)) -ne 0 ] || [ $MEMORY -lt 16 ] ) && echo -e "ERROR: Wrong number of memory\n" && usage 66 | ([ $((INTERFACES%2)) -ne 0 ] || [ $INTERFACES -lt 4 ] ) && echo -e "ERROR: Wrong number of interfaces\n" && usage 67 | 68 | #Generate a cpu topology for 4 numas with hyperthreading 69 | CPUS=`pairs_gap=$((CORES/NUMAS));numa=0;inc=0;sibling=0;for((thread=0;thread<=$((pairs_gap-1));thread++)); do printf " ${numa}-${sibling}-${thread} ${numa}-${sibling}-$((thread+pairs_gap))";numa=$(((numa+1)%$NUMAS)); sibling=$((sibling+inc)); inc=$(((inc+1)%2)); done` 70 | 71 | #in this developing/fake server all cores can be used 72 | 73 | echo "#This file was created by $0" 74 | echo "#for adding this compute node to openvim" 75 | echo "#copy this file to openvim controller and run" 76 | echo "#openvim host-add " 77 | echo 78 | echo "host:" 79 | echo " name: $HOST_NAME" 80 | echo " user: $1" 81 | echo " ip_name: $2" 82 | echo "host-data:" 83 | echo " name: $HOST_NAME" 84 | echo " user: $1" 85 | echo " ip_name: $2" 86 | echo " ranking: 100" 87 | echo " description: $HOST_NAME" 88 | echo " features: $FEATURES_LIST" 89 | echo " numas:" 90 | 91 | numa=0 92 | last_iface=0 93 | iface_counter=0 94 | while [ $numa -lt $NUMAS ] 95 | do 96 | echo " - numa_socket: $numa" 97 | #MEMORY 98 | echo " hugepages: $((MEMORY/2-2))" 99 | echo " memory: $((MEMORY/2))" 100 | 101 | #CORES 102 | echo " cores:" 103 | for cpu in $CPUS 104 | do 105 | PHYSICAL=`echo $cpu | cut -f 1 -d"-"` 106 | CORE=`echo $cpu | cut -f 2 -d"-"` 107 | THREAD=`echo $cpu | cut -f 3 -d"-"` 108 | [ $PHYSICAL != $numa ] && continue #skip non physical 109 | echo " - core_id: $CORE" 110 | echo " thread_id: $THREAD" 111 | [ $CORE -eq 0 ] && echo " status: noteligible" 112 | done 113 | 114 | 115 | #GENERATE INTERFACES INFORMATION AND PRINT IT 116 | seed=$RANDOM 117 | echo " interfaces:" 118 | for ((iface=0;iface<$INTERFACES;iface+=2)) 119 | do 120 | name="iface$iface_counter" 121 | bus=$((iface+last_iface)) 122 | pci=`printf "0000:%02X:00.0" $bus` 123 | mac=`get_mac $seed` 124 | seed=$((seed+1)) 125 | 126 | echo " - source_name: $name" 127 | echo " Mbps: 10000" 128 | echo " pci: \"$pci\"" 129 | echo " mac: \"$mac\"" 130 | echo " switch_dpid: \"01:02:03:04:05:06\"" 131 | echo " switch_port: fake0/$iface_counter" 132 | echo " sriovs:" 133 | 134 | for((nb_sriov=0;nb_sriov<8;nb_sriov++)) 135 | do 136 | pci=`printf "0000:%02X:10.%i" $bus $nb_sriov` 137 | mac=`get_mac $seed` 138 | seed=$((seed+1)) 139 | echo " - mac: \"$mac\"" 140 | echo " pci: \"$pci\"" 141 | echo " source_name: $nb_sriov" 142 | done 143 | 144 | iface_counter=$((iface_counter+1)) 145 | done 146 | last_iface=$(((numa+1)*127/NUMAS+5)) #made-up formula for more realistic pci numbers 147 | 148 | 149 | numa=$((numa+1)) 150 | done 151 | 152 | -------------------------------------------------------------------------------- /scripts/host-add.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nfvlabs/openmano/b09eabec0a168aeda8adc3ea99f734e45e810205/scripts/host-add.sh -------------------------------------------------------------------------------- /scripts/openmano-report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | #It generates a report for debugging 25 | 26 | DIRNAME=$(readlink -f ${BASH_SOURCE[0]}) 27 | DIRNAME=$(dirname $DIRNAME ) 28 | OMCLIENT=$DIRNAME/../openmano/openmano 29 | OVCLIENT=$DIRNAME/../openvim/openvim 30 | 31 | #get screen log files at the beginning 32 | echo 33 | echo "-------------------------------" 34 | echo "log files" 35 | echo "-------------------------------" 36 | echo "-------------------------------" 37 | echo "OPENMANO" 38 | echo "-------------------------------" 39 | echo "cat $DIRNAME/../logs/openmano.?" 40 | cat $DIRNAME/../logs/openmano.? 41 | echo 42 | echo "-------------------------------" 43 | echo "OPENVIM" 44 | echo "-------------------------------" 45 | echo "cat $DIRNAME/../logs/openvim.?" 46 | cat $DIRNAME/../logs/openvim.? 47 | echo 48 | echo "-------------------------------" 49 | echo 50 | 51 | #get version 52 | echo 53 | echo "-------------------------------" 54 | echo "version" 55 | echo "-------------------------------" 56 | echo "-------------------------------" 57 | echo "OPENMANO" 58 | echo "-------------------------------" 59 | echo "cat $DIRNAME/../openmano/openmanod.py|grep ^__version__" 60 | cat $DIRNAME/../openmano/openmanod.py|grep ^__version__ 61 | echo 62 | echo "-------------------------------" 63 | echo "OPENVIM" 64 | echo "-------------------------------" 65 | echo "cat $DIRNAME/../openvim/openvimd.py|grep ^__version__" 66 | cat $DIRNAME/../openvim/openvimd.py|grep ^__version__ 67 | echo 68 | echo "-------------------------------" 69 | echo 70 | 71 | #get configuration files 72 | echo "-------------------------------" 73 | echo "Configuration files" 74 | echo "-------------------------------" 75 | echo "-------------------------------" 76 | echo "OPENMANO" 77 | echo "-------------------------------" 78 | echo "cat $DIRNAME/../openmano/openmanod.cfg" 79 | cat $DIRNAME/../openmano/openmanod.cfg 80 | echo "-------------------------------" 81 | echo "OPENVIM" 82 | echo "-------------------------------" 83 | echo "cat $DIRNAME/../openvim/openvimd.cfg" 84 | cat $DIRNAME/../openvim/openvimd.cfg 85 | echo "-------------------------------" 86 | echo 87 | 88 | #get list of items 89 | for verbose in "" "-vvv" 90 | do 91 | echo "-------------------------------" 92 | echo "OPENMANO$verbose" 93 | echo "-------------------------------" 94 | echo "$OMCLIENT config $verbose" 95 | $OMCLIENT config 96 | echo "-------------------------------" 97 | echo "$OMCLIENT tenant-list $verbose" 98 | $OMCLIENT tenant-list $verbose 99 | echo "-------------------------------" 100 | echo "$OMCLIENT datacenter-list --all" 101 | $OMCLIENT datacenter-list --all 102 | echo "-------------------------------" 103 | echo "$OMCLIENT datacenter-list $verbose" 104 | $OMCLIENT datacenter-list $verbose 105 | echo "-------------------------------" 106 | dclist=`$OMCLIENT datacenter-list |awk '{print $1}'` 107 | for dc in $dclist; do 108 | echo "$OMCLIENT datacenter-net-list $dc $verbose" 109 | $OMCLIENT datacenter-net-list $dc $verbose 110 | echo "-------------------------------" 111 | done 112 | echo "$OMCLIENT vnf-list $verbose" 113 | $OMCLIENT vnf-list $verbose 114 | echo "-------------------------------" 115 | vnflist=`$OMCLIENT vnf-list |awk '$1!="No" {print $1}'` 116 | for vnf in $vnflist; do 117 | echo "$OMCLIENT vnf-list $vnf $verbose" 118 | $OMCLIENT vnf-list $vnf $verbose 119 | echo "-------------------------------" 120 | done 121 | echo "$OMCLIENT scenario-list $verbose" 122 | $OMCLIENT scenario-list $verbose 123 | echo "-------------------------------" 124 | scenariolist=`$OMCLIENT scenario-list |awk '$1!="No" {print $1}'` 125 | for sce in $scenariolist; do 126 | echo "$OMCLIENT scenario-list $sce $verbose" 127 | $OMCLIENT scenario-list $sce $verbose 128 | echo "-------------------------------" 129 | done 130 | echo "$OMCLIENT instance-scenario-list $verbose" 131 | $OMCLIENT instance-scenario-list $verbose 132 | echo "-------------------------------" 133 | instancelist=`$OMCLIENT instance-scenario-list |awk '$1!="No" {print $1}'` 134 | for i in $instancelist; do 135 | echo "$OMCLIENT instance-scenario-list $i $verbose" 136 | $OMCLIENT instance-scenario-list $i $verbose 137 | echo "-------------------------------" 138 | done 139 | echo 140 | echo "-------------------------------" 141 | echo "OPENVIM$verbose" 142 | echo "-------------------------------" 143 | echo "$OVCLIENT config" 144 | $OVCLIENT config 145 | echo "-------------------------------" 146 | echo "$OVCLIENT tenant-list $verbose" 147 | $OVCLIENT tenant-list $verbose 148 | echo "-------------------------------" 149 | echo "$OVCLIENT host-list $verbose" 150 | $OVCLIENT host-list $verbose 151 | echo "-------------------------------" 152 | echo "$OVCLIENT net-list $verbose" 153 | $OVCLIENT net-list $verbose 154 | echo "-------------------------------" 155 | echo "$OVCLIENT port-list $verbose" 156 | $OVCLIENT port-list $verbose 157 | echo "-------------------------------" 158 | echo "$OVCLIENT flavor-list $verbose" 159 | $OVCLIENT flavor-list $verbose 160 | echo "-------------------------------" 161 | echo "$OVCLIENT image-list $verbose" 162 | $OVCLIENT image-list $verbose 163 | echo "-------------------------------" 164 | echo "$OVCLIENT vm-list $verbose" 165 | $OVCLIENT vm-list $verbose 166 | echo "-------------------------------" 167 | echo 168 | 169 | done 170 | echo 171 | -------------------------------------------------------------------------------- /scripts/service-openmano.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | #launch openmano components inside a screen. It assumes a relative path ../openvim ../openmano ../../floodlight-0.90 25 | 26 | 27 | DIRNAME=$(readlink -f ${BASH_SOURCE[0]}) 28 | DIRNAME=$(dirname $DIRNAME ) 29 | DIR_OM=$(dirname $DIRNAME ) 30 | #[[ -z $FLOODLIGHT_PATH ]] && FLOODLIGHT_PATH=$(dirname ${DIR_OM})/floodlight-1.1 31 | [[ -z $FLOODLIGHT_PATH ]] && FLOODLIGHT_PATH=$(dirname ${DIR_OM})/floodlight-0.90 32 | 33 | function usage(){ 34 | echo -e "Usage: $0 [floodlight/flow] [openvim/vim] [openmano/mano] start|stop|restart|status" 35 | echo -e " Launch|Removes|Restart|Getstatus openmano components (by default all) on a screen" 36 | echo -e " Set floodlight path with shell var \$FLOODLIGHT_PATH (../../floodlight-0.90 if mising)" 37 | } 38 | 39 | function kill_pid(){ 40 | #send TERM signal and wait 5 seconds and send KILL signal ir still running 41 | #PARAMS: $1: PID of process to terminate 42 | kill $1 #send TERM signal 43 | WAIT=5 44 | while [ $WAIT -gt 0 ] && ps -o pid -U $USER -u $USER | grep -q $1 45 | do 46 | sleep 1 47 | WAIT=$((WAIT-1)) 48 | [ $WAIT -eq 0 ] && echo -n "sending SIGKILL... " && kill -9 $1 #kill when count reach 0 49 | done 50 | echo "done" 51 | 52 | } 53 | 54 | #obtain parameters 55 | om_list="" 56 | #om_action="start" #uncoment to get a default action 57 | for param in $* 58 | do 59 | [ "$param" == "start" -o "$param" == "stop" -o "$param" == "restart" -o "$param" == "status" ] && om_action=$param && continue 60 | [ "$param" == "openvim" -o "$param" == "vim" ] && om_list="$om_list vim" && continue 61 | [ "$param" == "openmano" -o "$param" == "mano" ] && om_list="$om_list mano" && continue 62 | [ "$param" == "openflow" -o "$param" == "flow" -o "$param" == "floodlight" ] && om_list="flow $om_list" && continue 63 | [ "$param" == "-h" -o "$param" == "--help" ] && usage && exit 0 64 | #note flow that it must be the first element, because openvim relay on this 65 | 66 | #if none of above, reach this line because a param is incorrect 67 | echo "Unknown param '$param' type $0 --help" >&2 68 | exit -1 69 | done 70 | 71 | #check action is provided 72 | [ -z "$om_action" ] && usage >&2 && exit -1 73 | 74 | #if no componenets supplied assume all 75 | [ -z "$om_list" ] && om_list="flow vim mano" 76 | 77 | for om_component in $om_list 78 | do 79 | [ "${om_component}" == "flow" ] && om_cmd="floodlight.jar" && om_name="floodlight" && om_dir="$FLOODLIGHT_PATH" 80 | [ "${om_component}" == "vim" ] && om_cmd="openvimd.py" && om_name="openvim " && om_dir=$(readlink -f ${DIR_OM}/openvim) 81 | [ "${om_component}" == "mano" ] && om_cmd="openmanod.py" && om_name="openmano " && om_dir=$(readlink -f ${DIR_OM}/openmano) 82 | #obtain PID of program 83 | component_id=`ps -o pid,cmd -U $USER -u $USER | grep -v grep | grep ${om_cmd} | awk '{print $1}'` 84 | 85 | #status 86 | if [ "$om_action" == "status" ] 87 | then 88 | [ -n "$component_id" ] && echo " $om_name running, pid $component_id" 89 | [ -z "$component_id" ] && echo " $om_name stopped" 90 | fi 91 | 92 | #stop 93 | if [ "$om_action" == "stop" -o "$om_action" == "restart" ] 94 | then 95 | #terminates program 96 | [ -n "$component_id" ] && echo -n " stopping $om_name ... " && kill_pid $component_id 97 | component_id="" 98 | #terminates screen 99 | if screen -wipe | grep -Fq .$om_component 100 | then 101 | screen -S $om_component -p 0 -X stuff "exit\n" 102 | sleep 1 103 | fi 104 | fi 105 | 106 | #start 107 | if [ "$om_action" == "start" -o "$om_action" == "restart" ] 108 | then 109 | #calculates log file name 110 | logfile="" 111 | mkdir -p $DIR_OM/logs && logfile=$DIR_OM/logs/open${om_component} || echo "can not create logs directory $DIR_OM/logs" 112 | #check already running 113 | [ -n "$component_id" ] && echo " $om_name is already running. Skipping" && continue 114 | #create screen if not created 115 | echo -n " starting $om_name ... " 116 | if ! screen -wipe | grep -Fq .${om_component} 117 | then 118 | pushd "${om_dir}" > /dev/null 119 | screen -dmS ${om_component} bash 120 | sleep 1 121 | popd > /dev/null 122 | else 123 | echo -n " using existing screen '${om_component}' ... " 124 | screen -S ${om_component} -p 0 -X log off 125 | screen -S ${om_component} -p 0 -X stuff "cd '${om_dir}'\n" 126 | sleep 1 127 | fi 128 | #move old log file index one number up and log again in index 0 129 | if [[ -n $logfile ]] 130 | then 131 | for index in 8 7 6 5 4 3 2 1 0 132 | do 133 | [[ -f ${logfile}.${index} ]] && mv ${logfile}.${index} ${logfile}.$((index+1)) 134 | done 135 | screen -S ${om_component} -p 0 -X logfile ${logfile}.0 136 | screen -S ${om_component} -p 0 -X log on 137 | fi 138 | #launch command to screen 139 | #[ "${om_component}" != "flow" ] && screen -S ${om_component} -p 0 -X stuff "cd ${DIR_OM}/open${om_component}\n" && sleep 1 140 | [ "${om_component}" == "flow" ] && screen -S flow -p 0 -X stuff "java -Dlogback.configurationFile=${DIRNAME}/flow-logback.xml -jar ./target/floodlight.jar -cf ${DIRNAME}/flow.properties_v0.9\n" 141 | #[ "${om_component}" == "flow" ] && screen -S flow -p 0 -X stuff "java -Dlogback.configurationFile=${DIRNAME}/flow-logback.xml -jar ./target/floodlight.jar -cf ${DIRNAME}/flow.properties_v1.1\n" && sleep 5 142 | [ "${om_component}" != "flow" ] && screen -S ${om_component} -p 0 -X stuff "./${om_cmd}\n" 143 | #check if is running 144 | [[ -n $logfile ]] && timeout=120 #2 minute 145 | [[ -z $logfile ]] && timeout=20 146 | while [[ $timeout -gt 0 ]] 147 | do 148 | #check if is running 149 | #echo timeout $timeout 150 | #if ! ps -f -U $USER -u $USER | grep -v grep | grep -q ${om_cmd} 151 | log_lines=0 152 | [[ -n $logfile ]] && log_lines=`head ${logfile}.0 | wc -l` 153 | component_id=`ps -o pid,cmd -U $USER -u $USER | grep -v grep | grep ${om_cmd} | awk '{print $1}'` 154 | if [[ -z $component_id ]] 155 | then #process not started or finished 156 | [[ $log_lines -ge 2 ]] && echo -n "ERROR, it has exited." && break 157 | #started because writted serveral lines at log so report error 158 | fi 159 | [[ -n $logfile ]] && [[ ${om_component} == flow ]] && grep -q "Listening for switch connections" ${logfile}.0 && sleep 1 && break 160 | [[ -n $logfile ]] && [[ ${om_component} != flow ]] && grep -q "open${om_component}d ready" ${logfile}.0 && break 161 | sleep 1 162 | timeout=$((timeout -1)) 163 | done 164 | if [[ -n $logfile ]] && [[ $timeout == 0 ]] 165 | then 166 | echo -n "timeout!" 167 | else 168 | echo -n "running on 'screen -x ${om_component}'." 169 | fi 170 | [[ -n $logfile ]] && echo " Logging at '${logfile}.0'" || echo 171 | fi 172 | done 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /scripts/start-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | #launch floodlight, openmano and openvim 25 | 26 | DIRNAME=`dirname $0` 27 | 28 | echo "Deprecated, use '$DIRNAME/openmano-service.sh start'" 29 | 30 | $DIRNAME/start-openflow.sh 31 | sleep 10 32 | $DIRNAME/start-openvim.sh 33 | sleep 1 34 | $DIRNAME/start-openmano.sh 35 | 36 | 37 | -------------------------------------------------------------------------------- /scripts/start-openflow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | 25 | #Launch openflow controller if installed. 26 | #PARAM $1: directory where openflow controller is installed. By default ../../floodlight-0.90 27 | 28 | DIRNAME=`dirname $0` 29 | FLD=${DIRNAME}/../../floodlight-0.90 30 | 31 | [ -n "$1" ] && FLD=$1 32 | 33 | #check directory exist and it is compiled 34 | [ ! -d ${FLD} ] && 35 | echo "Directory ${FLD} not found" && exit 36 | [ ! -r $FLD/target/floodlight.jar ] && 37 | echo "File 'target/floodlight.jar' not found" && exit 38 | 39 | 40 | echo "Deprecated, use '$DIRNAME/openmano-service.sh start floodlight'" 41 | 42 | screen -dmS flow bash 43 | #sleep 1 44 | #screen -S flow -p 0 -X stuff "cd ${FLD}\n" 45 | 46 | sleep 1 47 | screen -S flow -p 0 -X stuff "java -Dlogback.configurationFile=${DIRNAME}/flow-logback.xml -jar ${FLD}/target/floodlight.jar -cf ${DIRNAME}/flow.properties\n" 48 | 49 | echo "openflow controller running. Execute 'screen -x flow' and 'Ctrl+c' to terminte" 50 | 51 | -------------------------------------------------------------------------------- /scripts/start-openmano.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | #launch openmano inside a screen. It assumes a relative path ../openmano 25 | 26 | DIRNAME=`dirname $0` 27 | 28 | echo "Deprecated, use '$DIRNAME/openmano-service.sh start openmano'" 29 | 30 | screen -dmS mano bash 31 | sleep 1 32 | screen -S mano -p 0 -X stuff "cd ${DIRNAME}/../openmano\n" 33 | sleep 1 34 | screen -S mano -p 0 -X stuff "./openmanod.py\n" 35 | 36 | echo "openmano running. Execute 'screen -x mano' and 'Ctrl+c' to terminte" 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /scripts/start-openvim.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. 5 | # This file is part of openmano 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # For those usages not covered by the Apache License, Version 2.0 please 21 | # contact with: nfvlabs@tid.es 22 | ## 23 | 24 | #launch openvim inside a screen. It assumes a relative path ../openvim 25 | 26 | DIRNAME=`dirname $0` 27 | 28 | echo "Deprecated, use '$DIRNAME/openmano-service.sh start openvim'" 29 | 30 | 31 | screen -dmS vim bash 32 | sleep 1 33 | screen -S vim -p 0 -X stuff "cd ${DIRNAME}/../openvim\n" 34 | sleep 1 35 | screen -S vim -p 0 -X stuff "./openvimd.py\n" 36 | 37 | echo "openvim running. Execute 'screen -x vim' and type 'exit' to terminte" 38 | 39 | 40 | 41 | 42 | 43 | --------------------------------------------------------------------------------