blob: 0925c3735bbcb89e127ab623fdeba3a4ef24929f [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
36 xosEndpoint: http://xos/
37 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 Bavierf4e6a152016-08-02 15:29:37 -040051 FIP=$(ssh -i node_key -o StrictHostKeyChecking=no $NODE ip -4 addr show fabric 2> /dev/null | grep inet | awk '{print $2}')
Andy Bavier3c008372016-08-02 15:10:42 -040052 if [ -z "$FIP" ]
53 then
54 # Single-node POD case
55 FIP="10.168.0.253/24"
56 fi
57
Scott Baker50421662016-06-27 22:09:48 -070058 cat >> $FN <<EOF
59 $NODE:
60 type: tosca.nodes.Node
61
62 # VTN bridgeId field for node $NODE
63 ${NODE}_bridgeId_tag:
64 type: tosca.nodes.Tag
65 properties:
66 name: bridgeId
Andy Bavier3c008372016-08-02 15:10:42 -040067 value: $BRIDGE_ID
Scott Baker50421662016-06-27 22:09:48 -070068 requirements:
69 - target:
70 node: $NODE
71 relationship: tosca.relationships.TagsObject
72 - service:
73 node: service#ONOS_CORD
74 relationship: tosca.relationships.MemberOfService
75
76 # VTN dataPlaneIntf field for node $NODE
77 ${NODE}_dataPlaneIntf_tag:
78 type: tosca.nodes.Tag
79 properties:
80 name: dataPlaneIntf
81 value: fabric
82 requirements:
83 - target:
84 node: $NODE
85 relationship: tosca.relationships.TagsObject
86 - service:
87 node: service#ONOS_CORD
88 relationship: tosca.relationships.MemberOfService
89
90 # VTN dataPlaneIp field for node $NODE
91 ${NODE}_dataPlaneIp_tag:
92 type: tosca.nodes.Tag
93 properties:
94 name: dataPlaneIp
Andy Bavier3c008372016-08-02 15:10:42 -040095 value: $FIP
Scott Baker50421662016-06-27 22:09:48 -070096 requirements:
97 - target:
98 node: $NODE
99 relationship: tosca.relationships.TagsObject
100 - service:
101 node: service#ONOS_CORD
102 relationship: tosca.relationships.MemberOfService
103
Scott Bakerb08cd8d2016-10-12 09:56:34 -0700104 # VTN dataPlaneIntf field for node $NODE
Scott Baker53f01352016-10-19 10:05:56 -0700105# ${NODE}_hostManagementIface_tag:
106# type: tosca.nodes.Tag
107# properties:
108# name: hostManagementIface
109# value: veth3
110# requirements:
111# - target:
112# node: $NODE
113# relationship: tosca.relationships.TagsObject
114# - service:
115# node: service#ONOS_CORD
116# relationship: tosca.relationships.MemberOfService
Scott Bakerb08cd8d2016-10-12 09:56:34 -0700117
Scott Baker50421662016-06-27 22:09:48 -0700118EOF
119done
120
121cat >> $FN <<EOF
122 VTN_ONOS_app:
123 type: tosca.nodes.ONOSVTNApp
124 requirements:
125 - onos_tenant:
126 node: service#ONOS_CORD
127 relationship: tosca.relationships.TenantOfService
128 - vtn_service:
129 node: service#vtn
130 relationship: tosca.relationships.UsedByService
131 properties:
Charles Chanf95f74e2016-07-27 14:28:49 -0700132 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 -0700133 dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp
134 autogenerate: vtn-network-cfg
135EOF