blob: 0327a17f633c4bb3daa4d163ffb64a3443ca8b53 [file] [log] [blame]
Scott Baker50421662016-06-27 22:09:48 -07001FN=$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:
20 kind: onos
21 view_url: /admin/onos/onosservice/\$id$/
22 no_container: true
23 rest_hostname: onos-cord
24 replaces: service_ONOS_CORD
25
26 service#vtn:
27 type: tosca.nodes.VTNService
28 properties:
29 view_url: /admin/vtn/vtnservice/\$id$/
30 privateGatewayMac: 00:00:00:00:00:01
31 localManagementIp: 172.27.0.1/24
32 ovsdbPort: 6641
33 sshUser: root
34 sshKeyFile: /root/node_key
35 sshPort: 22
Scott Baker0d369d12016-11-08 16:37:30 -080036 xosEndpoint: http://xos:8888/
Scott Baker50421662016-06-27 22:09:48 -070037 xosUser: padmin@vicci.org
38 xosPassword: letmein
39 replaces: service_vtn
Scott Bakereccc7d52016-09-09 11:43:22 -070040 vtnAPIVersion: 2
Scott Baker50421662016-06-27 22:09:48 -070041
42EOF
43
44NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
45I=0
Andy Bavier3c008372016-08-02 15:10:42 -040046BRIDGE_IDX=1
Scott Baker50421662016-06-27 22:09:48 -070047for NODE in $NODES; do
48 echo $NODE
Andy Bavier3c008372016-08-02 15:10:42 -040049 BRIDGE_ID=$(printf "of:%016d" $BRIDGE_IDX )
50 BRIDGE_IDX=$(expr $BRIDGE_IDX + 1)
Andy Bavier04ac8d92016-11-21 14:15:12 -050051 # Get the static IP address that the provisioner has written to /etc/network/interfaces
52 FIP=$(ssh -i node_key -o StrictHostKeyChecking=no ubuntu@$NODE "awk '/iface fabric/,/address/' /etc/network/interfaces" |grep address|awk '{print $2}')
Andy Bavier3c008372016-08-02 15:10:42 -040053 if [ -z "$FIP" ]
54 then
Andy Bavier04ac8d92016-11-21 14:15:12 -050055 echo "[WARNING] IP address not found for $NODE, skipping..."
56 continue
Andy Bavier3c008372016-08-02 15:10:42 -040057 fi
58
Scott Baker50421662016-06-27 22:09:48 -070059 cat >> $FN <<EOF
60 $NODE:
61 type: tosca.nodes.Node
62
63 # VTN bridgeId field for node $NODE
64 ${NODE}_bridgeId_tag:
65 type: tosca.nodes.Tag
66 properties:
67 name: bridgeId
Andy Bavier3c008372016-08-02 15:10:42 -040068 value: $BRIDGE_ID
Scott Baker50421662016-06-27 22:09:48 -070069 requirements:
70 - target:
71 node: $NODE
72 relationship: tosca.relationships.TagsObject
73 - service:
74 node: service#ONOS_CORD
75 relationship: tosca.relationships.MemberOfService
76
77 # VTN dataPlaneIntf field for node $NODE
78 ${NODE}_dataPlaneIntf_tag:
79 type: tosca.nodes.Tag
80 properties:
81 name: dataPlaneIntf
82 value: fabric
83 requirements:
84 - target:
85 node: $NODE
86 relationship: tosca.relationships.TagsObject
87 - service:
88 node: service#ONOS_CORD
89 relationship: tosca.relationships.MemberOfService
90
91 # VTN dataPlaneIp field for node $NODE
92 ${NODE}_dataPlaneIp_tag:
93 type: tosca.nodes.Tag
94 properties:
95 name: dataPlaneIp
Andy Bavier3c008372016-08-02 15:10:42 -040096 value: $FIP
Scott Baker50421662016-06-27 22:09:48 -070097 requirements:
98 - target:
99 node: $NODE
100 relationship: tosca.relationships.TagsObject
101 - service:
102 node: service#ONOS_CORD
103 relationship: tosca.relationships.MemberOfService
104
Scott Bakerb08cd8d2016-10-12 09:56:34 -0700105 # VTN dataPlaneIntf field for node $NODE
Scott Baker53f01352016-10-19 10:05:56 -0700106# ${NODE}_hostManagementIface_tag:
107# type: tosca.nodes.Tag
108# properties:
109# name: hostManagementIface
110# value: veth3
111# requirements:
112# - target:
113# node: $NODE
114# relationship: tosca.relationships.TagsObject
115# - service:
116# node: service#ONOS_CORD
117# relationship: tosca.relationships.MemberOfService
Scott Bakerb08cd8d2016-10-12 09:56:34 -0700118
Scott Baker50421662016-06-27 22:09:48 -0700119EOF
120done
121
122cat >> $FN <<EOF
123 VTN_ONOS_app:
124 type: tosca.nodes.ONOSVTNApp
125 requirements:
126 - onos_tenant:
127 node: service#ONOS_CORD
128 relationship: tosca.relationships.TenantOfService
129 - vtn_service:
130 node: service#vtn
131 relationship: tosca.relationships.UsedByService
132 properties:
Charles Chanf95f74e2016-07-27 14:28:49 -0700133 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
Scott Baker50421662016-06-27 22:09:48 -0700134 dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp
135 autogenerate: vtn-network-cfg
136EOF