blob: 8993d2e49493ee0074ae8f2883a337be2827b031 [file] [log] [blame]
Thomas Vachuskab1906d22018-02-14 16:50:16 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Creates a spine-leaf fabric with large number of hosts using null providers
4# -----------------------------------------------------------------------------
5
6# config
7node=${1:-$OCI}
8
9# Create the script of ONOS commands first and then execute it all at once.
10export CMDS="/tmp/fab-onos.cmds"
11rm $CMDS
12
13function sim {
14 echo "$@" >> $CMDS
15}
16
17sim "wipe-out please"
18
19spinePorts=48
20leafPorts=64
21accessPorts=1024
22
23# Create spines
24for spine in {1..2}; do
25 sim "null-create-device switch Spine-${spine} ${spinePorts}"
26done
27
28# Create 2 leaf pairs with dual links to the spines and a link between the pair
29for pair in A B; do
30 sim "null-create-device switch Leaf-${pair}1 ${leafPorts}"
31 sim "null-create-device switch Leaf-${pair}2 ${leafPorts}"
32 sim "null-create-link direct Leaf-${pair}1 Leaf-${pair}2"
33
34 for spine in {1..2}; do
35 for link in {1..2}; do
36 sim "null-create-link direct Spine-${spine} Leaf-${pair}1"
37 sim "null-create-link direct Spine-${spine} Leaf-${pair}2"
38 done
39 done
40
41 # Create hosts for each leaf group; multi-homed to each leaf in the pair
42 [ $pair = A ] && pn=1 || pn=2
43 for host in {1..10}; do
44 sim "null-create-host Leaf-${pair}1,Leaf-${pair}2 10.${pn}.1.${host}"
45 done
46done
47
48# Create 8 single leafs with dual links to the spines
49for access in {1..8}; do
50 sim "null-create-device switch Access-${access} ${accessPorts}"
51
52 for spine in {1..2}; do
53 for link in {1..2}; do
54 sim "null-create-link direct Spine-${spine} Access-${access}"
55 done
56 done
57
58 # Create hosts for each single leaf
59 for host in {1..25}; do
60 sim "null-create-host Access-${access} 10.0.${access}.${host}"
61 done
62done
63
64
65
66# make sure null providers are activated
67onos ${node} app activate org.onosproject.null
68
69sleep 2
70
71# start custom simulation..
72onos ${node} null-simulation start custom
73
74# Generate the recipe using the following:
75# 2 spines, can potentially be few more
76# 12 leaves in total
77#     2 leaf pair
78#     8 non-paired
79# Host per leaf up to 1K
80
81sleep 5
82
83# Add devices, links, and hosts
84cat $CMDS | onos ${node}
85