blob: 3239537992eeb0c1a4611be119ed0c155ba54f20 [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 Black7c5aebc2017-01-12 22:30:09 +000020 kind: CORD-Platform
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:
Gabe Black7c5aebc2017-01-12 22:30:09 +000030 kind: CORD-Platform
Pingping Lin82366d32016-08-31 00:21:56 +000031 view_url: /admin/vtn/vtnservice/\$id$/
32 privateGatewayMac: 00:00:00:00:00:01
Gabe Blackcaf7e1c2016-11-08 21:49:04 +000033 localManagementIp: 172.27.0.1/24
Pingping Lin82366d32016-08-31 00:21:56 +000034 ovsdbPort: 6641
35 sshUser: root
36 sshKeyFile: /root/node_key
37 sshPort: 22
Gabe Black86b1afe2017-01-12 18:52:51 +000038 xosEndpoint: http://xos:8888/
Pingping Lin82366d32016-08-31 00:21:56 +000039 xosUser: padmin@vicci.org
40 xosPassword: letmein
41 replaces: service_vtn
Gabe Black86b1afe2017-01-12 18:52:51 +000042 vtnAPIVersion: 2
43 controllerPort: onos-cord:6654
Pingping Lin82366d32016-08-31 00:21:56 +000044
45EOF
46
47NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
48I=0
49BRIDGE_IDX=1
50for NODE in $NODES; do
51 echo $NODE
52 BRIDGE_ID=$(printf "of:%016d" $BRIDGE_IDX )
53 BRIDGE_IDX=$(expr $BRIDGE_IDX + 1)
54 FIP=$(ssh -i node_key -o StrictHostKeyChecking=no $NODE ip -4 addr show fabric 2> /dev/null | grep inet | awk '{print $2}')
55 if [ -z "$FIP" ]
56 then
57 # Single-node POD case
58 FIP="10.168.0.253/24"
59 fi
60
61 cat >> $FN <<EOF
62 $NODE:
63 type: tosca.nodes.Node
64
65 # VTN bridgeId field for node $NODE
66 ${NODE}_bridgeId_tag:
67 type: tosca.nodes.Tag
68 properties:
69 name: bridgeId
70 value: $BRIDGE_ID
71 requirements:
72 - target:
73 node: $NODE
74 relationship: tosca.relationships.TagsObject
75 - service:
76 node: service#ONOS_CORD
77 relationship: tosca.relationships.MemberOfService
78
79 # VTN dataPlaneIntf field for node $NODE
80 ${NODE}_dataPlaneIntf_tag:
81 type: tosca.nodes.Tag
82 properties:
83 name: dataPlaneIntf
84 value: fabric
85 requirements:
86 - target:
87 node: $NODE
88 relationship: tosca.relationships.TagsObject
89 - service:
90 node: service#ONOS_CORD
91 relationship: tosca.relationships.MemberOfService
92
93 # VTN dataPlaneIp field for node $NODE
94 ${NODE}_dataPlaneIp_tag:
95 type: tosca.nodes.Tag
96 properties:
97 name: dataPlaneIp
98 value: $FIP
99 requirements:
100 - target:
101 node: $NODE
102 relationship: tosca.relationships.TagsObject
103 - service:
104 node: service#ONOS_CORD
105 relationship: tosca.relationships.MemberOfService
106
Pingping Lin2fe8efb2017-01-24 05:00:59 +0000107 # VTN hostManagementIface field for node $NODE
108 ${NODE}_dataPlaneIp_tag:
109 type: tosca.nodes.Tag
110 properties:
111 name: hostManagementIface
112 value: veth3
113 requirements:
114 - target:
115 node: $NODE
116 relationship: tosca.relationships.TagsObject
117 - service:
118 node: service#ONOS_CORD
119 relationship: tosca.relationships.MemberOfService
120
Pingping Lin82366d32016-08-31 00:21:56 +0000121EOF
122done
123
124cat >> $FN <<EOF
125 VTN_ONOS_app:
126 type: tosca.nodes.ONOSVTNApp
127 requirements:
128 - onos_tenant:
129 node: service#ONOS_CORD
130 relationship: tosca.relationships.TenantOfService
131 - vtn_service:
132 node: service#vtn
133 relationship: tosca.relationships.UsedByService
134 properties:
135 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
136 dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp
137 autogenerate: vtn-network-cfg
138EOF