blob: 8063f6372a6e9cfd5bfc626422d59b397bc07fae [file] [log] [blame]
Pingping Lin82366d32016-08-31 00:21:56 +00001FN=$SETUPDIR/vtn-external.yaml
2
3rm -f $FN
4
5cat >> $FN <<EOF
6tosca_definitions_version: tosca_simple_yaml_1_0
7
8imports:
9 - custom_types/xos.yaml
10
11description: autogenerated node tags file for VTN configuration
12
13topology_template:
14 node_templates:
15
16 service#ONOS_CORD:
17 type: tosca.nodes.ONOSService
18 requirements:
19 properties:
Gabe Black86b1afe2017-01-12 18:52:51 +000020 kind: onos
Pingping Lin82366d32016-08-31 00:21:56 +000021 view_url: /admin/onos/onosservice/\$id$/
22 no_container: true
23 rest_hostname: onos-cord
Gabe Black86b1afe2017-01-12 18:52:51 +000024 rest_port: 8182
Pingping Lin82366d32016-08-31 00:21:56 +000025 replaces: service_ONOS_CORD
26
27 service#vtn:
28 type: tosca.nodes.VTNService
29 properties:
Pingping Lin82366d32016-08-31 00:21:56 +000030 view_url: /admin/vtn/vtnservice/\$id$/
31 privateGatewayMac: 00:00:00:00:00:01
Gabe Blackcaf7e1c2016-11-08 21:49:04 +000032 localManagementIp: 172.27.0.1/24
Pingping Lin82366d32016-08-31 00:21:56 +000033 ovsdbPort: 6641
34 sshUser: root
35 sshKeyFile: /root/node_key
36 sshPort: 22
Gabe Black86b1afe2017-01-12 18:52:51 +000037 xosEndpoint: http://xos:8888/
Pingping Lin82366d32016-08-31 00:21:56 +000038 xosUser: padmin@vicci.org
39 xosPassword: letmein
40 replaces: service_vtn
Gabe Black86b1afe2017-01-12 18:52:51 +000041 vtnAPIVersion: 2
42 controllerPort: onos-cord:6654
Pingping Lin82366d32016-08-31 00:21:56 +000043
44EOF
45
46NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
47I=0
48BRIDGE_IDX=1
49for NODE in $NODES; do
50 echo $NODE
51 BRIDGE_ID=$(printf "of:%016d" $BRIDGE_IDX )
52 BRIDGE_IDX=$(expr $BRIDGE_IDX + 1)
53 FIP=$(ssh -i node_key -o StrictHostKeyChecking=no $NODE ip -4 addr show fabric 2> /dev/null | grep inet | awk '{print $2}')
54 if [ -z "$FIP" ]
55 then
56 # Single-node POD case
57 FIP="10.168.0.253/24"
58 fi
59
60 cat >> $FN <<EOF
61 $NODE:
62 type: tosca.nodes.Node
63
64 # VTN bridgeId field for node $NODE
65 ${NODE}_bridgeId_tag:
66 type: tosca.nodes.Tag
67 properties:
68 name: bridgeId
69 value: $BRIDGE_ID
70 requirements:
71 - target:
72 node: $NODE
73 relationship: tosca.relationships.TagsObject
74 - service:
75 node: service#ONOS_CORD
76 relationship: tosca.relationships.MemberOfService
77
78 # VTN dataPlaneIntf field for node $NODE
79 ${NODE}_dataPlaneIntf_tag:
80 type: tosca.nodes.Tag
81 properties:
82 name: dataPlaneIntf
83 value: fabric
84 requirements:
85 - target:
86 node: $NODE
87 relationship: tosca.relationships.TagsObject
88 - service:
89 node: service#ONOS_CORD
90 relationship: tosca.relationships.MemberOfService
91
92 # VTN dataPlaneIp field for node $NODE
93 ${NODE}_dataPlaneIp_tag:
94 type: tosca.nodes.Tag
95 properties:
96 name: dataPlaneIp
97 value: $FIP
98 requirements:
99 - target:
100 node: $NODE
101 relationship: tosca.relationships.TagsObject
102 - service:
103 node: service#ONOS_CORD
104 relationship: tosca.relationships.MemberOfService
105
106EOF
107done
108
109cat >> $FN <<EOF
110 VTN_ONOS_app:
111 type: tosca.nodes.ONOSVTNApp
112 requirements:
113 - onos_tenant:
114 node: service#ONOS_CORD
115 relationship: tosca.relationships.TenantOfService
116 - vtn_service:
117 node: service#vtn
118 relationship: tosca.relationships.UsedByService
119 properties:
120 install_dependencies: http://mavenrepo:8080/repository/org/opencord/cord-config/1.1-SNAPSHOT/cord-config-1.1-SNAPSHOT.oar,http://mavenrepo:8080/repository/org/opencord/vtn/1.1-SNAPSHOT/vtn-1.1-SNAPSHOT.oar
121 dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp
122 autogenerate: vtn-network-cfg
123EOF