--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+schema_version: 2
+scenario:
+ name: p2p_passthrough
+ description: Network scenario consisting of two machines with a sr-iov interconnected between them
+ vnfs:
+ passthrough1: # vnf/net name in the scenario
+ vnf_name: passthrough # VNF name as introduced in OPENMANO DB
+ passthrough2: # vnf/net name in the scenario
+ vnf_name: passthrough # VNF name as introduced in OPENMANO DB
+ networks:
+ mgmt: # provide a name for this net or connection
+ external: true
+ interfaces:
+ - passthrough1: eth0 # Node and its interface
+ - passthrough2: eth0 # Node and its interface
+ dataplane: # provide a name for this net or connection
+ interfaces:
+ - passthrough1: xe0 # Node and its interface
+ - passthrough2: xe0 # Node and its interface
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+vnf:
+ name: passthrough
+ description: Machine with EPA and a SR-IOV interface
+ external-connections:
+ - name: eth0
+ type: bridge
+ VNFC: passthrough-VM
+ local_iface_name: eth0
+ description: management interface
+ - name: xe0
+ type: data
+ VNFC: passthrough-VM
+ local_iface_name: xe0
+ description: Dataplane interface
+ VNFC:
+ - name: passthrough-VM
+ description: Machine with EPA and a SR-IOV interface
+ image name: centos
+ disk: 20
+ numas:
+ - threads: 1 # "cores", "paired-threads", "threads"
+ memory: 1 # GBytes
+ interfaces:
+ - name: xe0
+ vpci: "0000:00:11.0"
+ dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag)
+ bandwidth: 1 Gbps
+
+ bridge-ifaces:
+ - name: eth0
+ vpci: "0000:00:0a.0"
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+schema_version: 2
+scenario:
+ name: p2p_sriov_passthrough
+ description: Network scenario consisting of two machines with a sr-iov interconnected between them
+ vnfs:
+ sriov1: # vnf/net name in the scenario
+ vnf_name: sriov # VNF name as introduced in OPENMANO DB
+ passthrough1: # vnf/net name in the scenario
+ vnf_name: passthrough # VNF name as introduced in OPENMANO DB
+ sriov2: # vnf/net name in the scenario
+ vnf_name: sriov # VNF name as introduced in OPENMANO DB
+ passthrough2: # vnf/net name in the scenario
+ vnf_name: passthrough # VNF name as introduced in OPENMANO DB
+
+ networks:
+ mgmt: # provide a name for this net or connection
+ external: true
+ interfaces:
+ - sriov1: eth0 # Node and its interface
+ - passthrough1: eth0 # Node and its interface
+ - sriov2: eth0 # Node and its interface
+ - passthrough2: eth0 # Node and its interface
+ dataplane: # provide a name for this net or connection
+ interfaces:
+ - sriov1: xe0 # Node and its interface
+ - passthrough1: xe0 # Node and its interface
+ - sriov2: xe0 # Node and its interface
+ - passthrough2: xe0 # Node and its interface
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+vnf:
+ name: passthrough
+ description: Machine with EPA and a SR-IOV interface
+ external-connections:
+ - name: eth0
+ type: bridge
+ VNFC: passthrough-VM
+ local_iface_name: eth0
+ description: management interface
+ - name: xe0
+ type: data
+ VNFC: passthrough-VM
+ local_iface_name: xe0
+ description: Dataplane interface
+ VNFC:
+ - name: passthrough-VM
+ description: Machine with EPA and a SR-IOV interface
+ image name: centos
+ disk: 20
+ numas:
+ - threads: 1 # "cores", "paired-threads", "threads"
+ memory: 1 # GBytes
+ interfaces:
+ - name: xe0
+ vpci: "0000:00:11.0"
+ dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag)
+ bandwidth: 1 Gbps
+
+ bridge-ifaces:
+ - name: eth0
+ vpci: "0000:00:0a.0"
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+vnf:
+ name: sriov
+ description: Machine with EPA and a SR-IOV interface
+ external-connections:
+ - name: eth0
+ type: bridge
+ VNFC: sriov-VM
+ local_iface_name: eth0
+ description: management interface
+ - name: xe0
+ type: data
+ VNFC: sriov-VM
+ local_iface_name: xe0
+ description: Dataplane interface
+ VNFC:
+ - name: sriov-VM
+ description: Machine with EPA and a SR-IOV interface
+ image name: centos
+ disk: 20
+ numas:
+ - threads: 1 # "cores", "paired-threads", "threads"
+ memory: 1 # GBytes
+ interfaces:
+ - name: xe0
+ vpci: "0000:00:11.0"
+ dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag)
+ bandwidth: 1 Gbps
+
+ bridge-ifaces:
+ - name: eth0
+ vpci: "0000:00:0a.0"
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+schema_version: 2
+scenario:
+ name: simple
+ description: Simple network scenario consisting of two VNF connected to an external network
+ vnfs:
+ linux1: # vnf/net name in the scenario
+ vnf_name: linux # VNF name as introduced in OPENMANO DB
+ linux2: # vnf/net name in the scenario
+ vnf_name: linux # VNF name as introduced in OPENMANO DB
+ networks:
+ mgmt: # provide a name for this net or connection
+ external: true
+ interfaces:
+ - linux1: eth0 # Node and its interface
+ - linux2: eth0 # Node and its interface
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+vnf:
+ name: linux
+ description: Single-VM VNF with a traditional cloud VM based on generic Linux OS
+ external-connections:
+ - name: eth0
+ type: bridge
+ VNFC: linux-VM
+ local_iface_name: eth0
+ description: General purpose interface
+ VNFC:
+ - name: linux-VM
+ description: Generic Linux Virtual Machine
+ #Copy the image to a compute path and edit this path
+ image name: image_name.qcow2
+ vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed).
+ ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed)
+ disk: 10
+ bridge-ifaces:
+ - name: eth0
+ vpci: "0000:00:11.0"
+ numas: []
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+schema_version: 2
+scenario:
+ name: p2p_sriov_passthrough
+ description: Network scenario consisting of two machines with a sr-iov interconnected between them
+ vnfs:
+ sriov: # vnf/net name in the scenario
+ vnf_name: sriov # VNF name as introduced in OPENMANO DB
+ passthrough: # vnf/net name in the scenario
+ vnf_name: passthrough # VNF name as introduced in OPENMANO DB
+ networks:
+ mgmt: # provide a name for this net or connection
+ external: true
+ interfaces:
+ - sriov: eth0 # Node and its interface
+ - passthrough: eth0 # Node and its interface
+ dataplane: # provide a name for this net or connection
+ interfaces:
+ - sriov: xe0 # Node and its interface
+ - passthrough: xe0 # Node and its interface
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+vnf:
+ name: passthrough
+ description: Machine with EPA and a SR-IOV interface
+ external-connections:
+ - name: eth0
+ type: bridge
+ VNFC: passthrough-VM
+ local_iface_name: eth0
+ description: management interface
+ - name: xe0
+ type: data
+ VNFC: passthrough-VM
+ local_iface_name: xe0
+ description: Dataplane interface
+ VNFC:
+ - name: passthrough-VM
+ description: Machine with EPA and a SR-IOV interface
+ image name: centos
+ disk: 20
+ numas:
+ - threads: 1 # "cores", "paired-threads", "threads"
+ memory: 1 # GBytes
+ interfaces:
+ - name: xe0
+ vpci: "0000:00:11.0"
+ dedicated: "yes" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag)
+ bandwidth: 1 Gbps
+
+ bridge-ifaces:
+ - name: eth0
+ vpci: "0000:00:0a.0"
+
--- /dev/null
+##
+# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# This file is part of openmano
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact with: nfvlabs@tid.es
+##
+---
+vnf:
+ name: sriov
+ description: Machine with EPA and a SR-IOV interface
+ external-connections:
+ - name: eth0
+ type: bridge
+ VNFC: sriov-VM
+ local_iface_name: eth0
+ description: management interface
+ - name: xe0
+ type: data
+ VNFC: sriov-VM
+ local_iface_name: xe0
+ description: Dataplane interface
+ VNFC:
+ - name: sriov-VM
+ description: Machine with EPA and a SR-IOV interface
+ image name: centos
+ disk: 20
+ numas:
+ - threads: 1 # "cores", "paired-threads", "threads"
+ memory: 1 # GBytes
+ interfaces:
+ - name: xe0
+ vpci: "0000:00:11.0"
+ dedicated: "no" # "yes"(passthrough), "no"(sriov with vlan tags), "yes:sriov"(sriovi, but exclusive and without vlan tag)
+ bandwidth: 1 Gbps
+
+ bridge-ifaces:
+ - name: eth0
+ vpci: "0000:00:0a.0"
+
global scenario_test_folder
global test_image_name
global management_network
+global manual
def check_instance_scenario_active(uuid):
instance = client.get_instance(uuid=uuid)
for net in instance['nets']:
status = net['status']
- if status != 'ACTIVE':
+ if status != 'BUILD':
return (False, status)
for vnf in instance['vnfs']:
scenario_test_folder)
self.__class__.test_index += 1
+ if manual:
+ raw_input('Scenario has been deployed. Perform manual check and press any key to resume')
+ return
+
keep_waiting = 50
instance_active = False
while(keep_waiting):
default=default_logger_file)
parser.add_option('--list-tests', help='List all available tests', dest='list-tests', action="store_true",
default=False)
+ parser.add_option('-m', '--manual-check', help='Pause execution once deployed to allow manual checking of the deployed instance scenario', dest='manual', action="store_true", default=False)
parser.add_option('--test', '--tests', help='Specify the tests to run', dest='tests', default=None)
#Mandatory arguments
# set test image name and management network
test_image_name = options.__dict__['image-name']
management_network = options.__dict__['mgmt-net']
+ manual = options.__dict__['manual']
#Create the list of tests to be run
descriptor_based_tests = []
elif 'threads' in numa:
vcpus = numa['threads']
numa_properties["hw:cpu_policy"] = "isolated"
- for interface in numa.get("interfaces",() ):
- if interface["dedicated"]=="yes":
- raise vimconn.vimconnException("Passthrough interfaces are not supported for the openstack connector", http_code=vimconn.HTTP_Service_Unavailable)
- #TODO, add the key 'pci_passthrough:alias"="<label at config>:<number ifaces>"' when a way to connect it is available
+ # for interface in numa.get("interfaces",() ):
+ # if interface["dedicated"]=="yes":
+ # raise vimconn.vimconnException("Passthrough interfaces are not supported for the openstack connector", http_code=vimconn.HTTP_Service_Unavailable)
+ # #TODO, add the key 'pci_passthrough:alias"="<label at config>:<number ifaces>"' when a way to connect it is available
#create flavor
new_flavor=self.nova.flavors.create(name,
for net in net_list:
if not net.get("net_id"): #skip non connected iface
continue
- if net["type"]=="virtual" or net["type"]=="VF":
- port_dict={
- "network_id": net["net_id"],
- "name": net.get("name"),
- "admin_state_up": True
- }
- if net["type"]=="virtual":
- if "vpci" in net:
- metadata_vpci[ net["net_id"] ] = [[ net["vpci"], "" ]]
- else: # for VF
- if "vpci" in net:
- if "VF" not in metadata_vpci:
- metadata_vpci["VF"]=[]
- metadata_vpci["VF"].append([ net["vpci"], "" ])
- port_dict["binding:vnic_type"]="direct"
- if not port_dict["name"]:
- port_dict["name"]=name
- if net.get("mac_address"):
- port_dict["mac_address"]=net["mac_address"]
- if net.get("port_security") == False:
- port_dict["port_security_enabled"]=net["port_security"]
- new_port = self.neutron.create_port({"port": port_dict })
- net["mac_adress"] = new_port["port"]["mac_address"]
- net["vim_id"] = new_port["port"]["id"]
- net["ip"] = new_port["port"].get("fixed_ips", [{}])[0].get("ip_address")
- net_list_vim.append({"port-id": new_port["port"]["id"]})
- else: # for PF
- self.logger.warn("new_vminstance: Warning, can not connect a passthrough interface ")
- #TODO insert this when openstack consider passthrough ports as openstack neutron ports
+
+ port_dict={
+ "network_id": net["net_id"],
+ "name": net.get("name"),
+ "admin_state_up": True
+ }
+ if net["type"]=="virtual":
+ if "vpci" in net:
+ metadata_vpci[ net["net_id"] ] = [[ net["vpci"], "" ]]
+ elif net["type"]=="VF": # for VF
+ if "vpci" in net:
+ if "VF" not in metadata_vpci:
+ metadata_vpci["VF"]=[]
+ metadata_vpci["VF"].append([ net["vpci"], "" ])
+ port_dict["binding:vnic_type"]="direct"
+ else: #For PT
+ if "vpci" in net:
+ if "PF" not in metadata_vpci:
+ metadata_vpci["PF"]=[]
+ metadata_vpci["PF"].append([ net["vpci"], "" ])
+ port_dict["binding:vnic_type"]="direct-physical"
+ if not port_dict["name"]:
+ port_dict["name"]=name
+ if net.get("mac_address"):
+ port_dict["mac_address"]=net["mac_address"]
+ if net.get("port_security") == False:
+ port_dict["port_security_enabled"]=net["port_security"]
+ new_port = self.neutron.create_port({"port": port_dict })
+ net["mac_adress"] = new_port["port"]["mac_address"]
+ net["vim_id"] = new_port["port"]["id"]
+ net["ip"] = new_port["port"].get("fixed_ips", [{}])[0].get("ip_address")
+ net_list_vim.append({"port-id": new_port["port"]["id"]})
+
if net.get('floating_ip', False):
net['exit_on_floating_ip_error'] = True
external_network.append(net)
# interface["pci"] = pci[:-4] + "00." + str(int(pci[-1]) % 2)
interface["pci"] = pci
interface["vlan"] = None
+ #if network is of type vlan and port is of type direct (sr-iov) then set vlan id
network = self.neutron.show_network(port["network_id"])
- if network['network'].get('provider:network_type') == 'vlan':
+ if network['network'].get('provider:network_type') == 'vlan' and \
+ port.get("binding:vnic_type") == "direct":
interface["vlan"] = network['network'].get('provider:segmentation_id')
ips=[]
#look for floating ip address