blob: d52c862c9e3261d55c75cd39907ab5df0761aa7d [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
40
41EOF
42
43NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
44I=0
Andy Bavier3c008372016-08-02 15:10:42 -040045BRIDGE_IDX=1
Scott Baker50421662016-06-27 22:09:48 -070046for NODE in $NODES; do
47 echo $NODE
Andy Bavier3c008372016-08-02 15:10:42 -040048 BRIDGE_ID=$(printf "of:%016d" $BRIDGE_IDX )
49 BRIDGE_IDX=$(expr $BRIDGE_IDX + 1)
50 FIP=$(ssh -o StrictHostKeyChecking=no $NODE ip -4 addr show fabric 2> /dev/null | grep inet | awk '{print $2}')
51 if [ -z "$FIP" ]
52 then
53 # Single-node POD case
54 FIP="10.168.0.253/24"
55 fi
56
Scott Baker50421662016-06-27 22:09:48 -070057 cat >> $FN <<EOF
58 $NODE:
59 type: tosca.nodes.Node
60
61 # VTN bridgeId field for node $NODE
62 ${NODE}_bridgeId_tag:
63 type: tosca.nodes.Tag
64 properties:
65 name: bridgeId
Andy Bavier3c008372016-08-02 15:10:42 -040066 value: $BRIDGE_ID
Scott Baker50421662016-06-27 22:09:48 -070067 requirements:
68 - target:
69 node: $NODE
70 relationship: tosca.relationships.TagsObject
71 - service:
72 node: service#ONOS_CORD
73 relationship: tosca.relationships.MemberOfService
74
75 # VTN dataPlaneIntf field for node $NODE
76 ${NODE}_dataPlaneIntf_tag:
77 type: tosca.nodes.Tag
78 properties:
79 name: dataPlaneIntf
80 value: fabric
81 requirements:
82 - target:
83 node: $NODE
84 relationship: tosca.relationships.TagsObject
85 - service:
86 node: service#ONOS_CORD
87 relationship: tosca.relationships.MemberOfService
88
89 # VTN dataPlaneIp field for node $NODE
90 ${NODE}_dataPlaneIp_tag:
91 type: tosca.nodes.Tag
92 properties:
93 name: dataPlaneIp
Andy Bavier3c008372016-08-02 15:10:42 -040094 value: $FIP
Scott Baker50421662016-06-27 22:09:48 -070095 requirements:
96 - target:
97 node: $NODE
98 relationship: tosca.relationships.TagsObject
99 - service:
100 node: service#ONOS_CORD
101 relationship: tosca.relationships.MemberOfService
102
103EOF
104done
105
106cat >> $FN <<EOF
107 VTN_ONOS_app:
108 type: tosca.nodes.ONOSVTNApp
109 requirements:
110 - onos_tenant:
111 node: service#ONOS_CORD
112 relationship: tosca.relationships.TenantOfService
113 - vtn_service:
114 node: service#vtn
115 relationship: tosca.relationships.UsedByService
116 properties:
Charles Chanf95f74e2016-07-27 14:28:49 -0700117 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 -0700118 dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp
119 autogenerate: vtn-network-cfg
120EOF