Thanks for your support.
I uninstall tosca-parser module then I run pip command (sudo pip install tosca-parser) to re-install it.
I also update the header of my .yaml file as suggested by Bob.
Now I get a new error as described below:
tosca = ToscaTemplate(path, parsed_params, a_file)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/tosca_template.py", line 101, in __init__
self.topology_template = self._topology_template()
File "/usr/local/lib/python2.7/dist-packages/toscaparser/tosca_template.py", line 120, in _topology_template
None)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/topology_template.py", line 60, in __init__
self.graph = ToscaGraph(self.nodetemplates)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/tpl_relationship_graph.py", line 19, in __init__
self._create()
File "/usr/local/lib/python2.7/dist-packages/toscaparser/tpl_relationship_graph.py", line 40, in _create
relation = node.relationships
File "/usr/local/lib/python2.7/dist-packages/toscaparser/nodetemplate.py", line 61, in relationships
explicit = self._get_explicit_relationship(r, value)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/nodetemplate.py", line 144, in _get_explicit_relationship
for rtype in self.type_definition.relationship.keys():
File "/usr/local/lib/python2.7/dist-packages/toscaparser/elements/nodetype.py", line 89, in relationship
relatednode = NodeType(node_type, self.custom_def)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/elements/nodetype.py", line 30, in __init__
super(NodeType, self).__init__(ntype, self.NODE_PREFIX, custom_def)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/elements/statefulentitytype.py", line 38, in __init__
if entitytype.startswith(self.TOSCA + ":"):
AttributeError: 'NoneType' object has no attribute 'startswith'
Kindly find bellow my .yaml file in case of further information.
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: This is a basic example for test
topology_template:
outputs:
vnf1_ip:
description: The private IP address of the VNF container1.
value: { get_attribute: [VM1, private_address] }
vnf2_ip:
description: The private IP address of the VNF container2.
value: { get_attribute: [VM2, private_address] }
vnf3_ip:
description: The private IP address of the VNF container3.
value: { get_attribute: [VM3, private_address] }
Thanks for your support. lib/python2. 7/dist- packages/ toscaparser/ tosca_template. py", line 101, in __init__ topology_ template = self._topology_ template( ) lib/python2. 7/dist- packages/ toscaparser/ tosca_template. py", line 120, in _topology_template lib/python2. 7/dist- packages/ toscaparser/ topology_ template. py", line 60, in __init__ self.nodetempla tes) lib/python2. 7/dist- packages/ toscaparser/ tpl_relationshi p_graph. py", line 19, in __init__ lib/python2. 7/dist- packages/ toscaparser/ tpl_relationshi p_graph. py", line 40, in _create lib/python2. 7/dist- packages/ toscaparser/ nodetemplate. py", line 61, in relationships explicit_ relationship( r, value) lib/python2. 7/dist- packages/ toscaparser/ nodetemplate. py", line 144, in _get_explicit_ relationship definition. relationship. keys(): lib/python2. 7/dist- packages/ toscaparser/ elements/ nodetype. py", line 89, in relationship lib/python2. 7/dist- packages/ toscaparser/ elements/ nodetype. py", line 30, in __init__ _init__ (ntype, self.NODE_PREFIX, custom_def) lib/python2. 7/dist- packages/ toscaparser/ elements/ statefulentityt ype.py" , line 38, in __init__ startswith( self.TOSCA + ":"):
I uninstall tosca-parser module then I run pip command (sudo pip install tosca-parser) to re-install it.
I also update the header of my .yaml file as suggested by Bob.
Now I get a new error as described below:
tosca = ToscaTemplate(path, parsed_params, a_file)
File "/usr/local/
self.
File "/usr/local/
None)
File "/usr/local/
self.graph = ToscaGraph(
File "/usr/local/
self._create()
File "/usr/local/
relation = node.relationships
File "/usr/local/
explicit = self._get_
File "/usr/local/
for rtype in self.type_
File "/usr/local/
relatednode = NodeType(node_type, self.custom_def)
File "/usr/local/
super(NodeType, self)._
File "/usr/local/
if entitytype.
AttributeError: 'NoneType' object has no attribute 'startswith'
Kindly find bellow my .yaml file in case of further information.
tosca_definitio ns_version: tosca_simple_ profile_ for_nfv_ 1_0_0
description: This is a basic example for test
topology_template:
inputs:
network_name:
type: string
default: admin_internal_net
odl:
type: string
default: 157.159.233.40:8181
node_templates:
VM1:
properties:
num_ cpus: 2
disk_ size: 10 GB
mem_ size: 512 MB
properties:
architectu re: x86_64
distributi on: ubuntu
version: 14.04
type: tosca.nodes.Compute
capabilities:
# Host container properties
host:
# Guest Operating System properties
os:
# host Operating System image properties
type: sfc_client
VM2:
properties:
num_ cpus: 2
disk_ size: 10 GB
mem_ size: 512 MB
properties:
architectu re: x86_64
distributi on: ubuntu
version: 14.04
type: tosca.nodes.Compute
capabilities:
# Host container properties
host:
# Guest Operating System properties
os:
# host Operating System image properties
type: sfc_client
VM3:
properties:
num_ cpus: 2
disk_ size: 10 GB
mem_ size: 512 MB
properties:
architectu re: x86_64
distributi on: ubuntu
version: 14.04
type: tosca.nodes.Compute
capabilities:
# Host container properties
host:
# Guest Operating System properties
os:
# host Operating System image properties
type: sfc_client
my_network: network. Network
network_ name: { get_input: network_name }
type: tosca.nodes.
properties:
my_port1: network. Port
type: tosca.nodes.
requirements:
- binding:
node: VM1
- link:
node: my_network
my_port2: network. Port
type: tosca.nodes.
requirements:
- binding:
node: VM2
- link:
node: my_network
my_port3: network. Port
type: tosca.nodes.
requirements:
- binding:
node: VM3
- link:
node: my_network
VNF1:
type: tosca.nodes.nfv.VNF
properties:
attributes:
type: dpi
address: 10.100.0.105
port: 40000
nsh_aware: true
requirements:
- host: VM1
CP11: #endpoints of VNF1 linked to VL1
type: tosca.nodes.nfv.CP
properties:
attributes:
IP_address: 10.100.0.105
interface: ens3
port: 30000
requirements:
- virtualBinding: VNF1
- virtualLink: VL1
VNF2:
type: tosca.nodes.nfv.VNF
properties:
attributes:
type: firewall
address: 10.100.0.106
port: 40000
nsh_aware: true
requirements:
- host: VM2
CP21: #endpoints of VNF2 linked to VL1
type: tosca.nodes.nfv.CP
properties:
attributes:
IP_address: 10.100.0.106
interface: ens3
port: 30000
requirements:
- virtualBinding: VNF2
- virtualLink: VL1
VNF3:
type: tosca.nodes.nfv.VNF
properties:
attributes:
type: napt44
address: 10.100.0.107
port: 40000
nsh_aware: true
requirements:
- host: VM3
CP31: #endpoints of VNF3 linked to VL2
type: tosca.nodes.nfv.CP
properties:
attributes:
IP_address: 10.100.0.107
port: 30000
interface: ens3
requirements:
- virtualBinding: VNF3
- virtualLink: VL1
VL1:
transport_ type: vxlan-gpe
type: tosca.nodes.nfv.VL
properties:
vendor: HP
attributes:
type: ip
Forwarding_ path1:
type: tosca.nodes.nfv.FP
description: the path (CP11->CP21->CP31)
properties:
policy:
requirements:
- forwarder: CP11
- forwarder: CP21
- forwarder: CP31
groups: nfv.VNFFG
connection_ point: [ CP11, CP21, CP31 ]
dependent_ virtual_ link: [ VL1 ]
constituent_ vnfs: [ VNF1, VNF2, VNF3 ]
VNF_FG1:
type: tosca.groups.
description: VNF forwarding graph
properties:
vendor:
version:
members: [ Forwarding_path1 ]
outputs:
vnf1_ip:
description: The private IP address of the VNF container1.
value: { get_attribute: [VM1, private_address] }
vnf2_ip:
description: The private IP address of the VNF container2.
value: { get_attribute: [VM2, private_address] }
vnf3_ip:
description: The private IP address of the VNF container3.
value: { get_attribute: [VM3, private_address] }