Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions ansible/README.testbed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Requirenments for the server
1. Ubuntu 16.04 x64
2. Installed docker-engine
3. Three network cards:
1. first is used for the server management
2. second is used to connect management interfaces of VMs and docker containers to network.
3. third is used to connect VMs and ptf containers to DUTs

Content of /etc/network/interfaces:
```
root@STR-AZURE-SERV-02:~# cat /etc/network/interfaces
# The primary network interface
auto em1
iface em1 inet static
address 10.250.0.245
netmask 255.255.255.0
network 10.250.0.0
broadcast 10.250.0.255
gateway 10.250.0.1
dns-nameservers 10.250.0.1 10.250.0.2
# dns-* options are implemented by the resolvconf package, if installed
dns-search SOMECOMPANY

auto br1
iface br1 inet manual
bridge_ports em2
bridge_stp on
bridge_maxwait 0
bridge_fd 0

auto p4p1
iface p4p1 inet manual
up ip link set p4p1 up
```

## To deploy testbed with one VM set
1. clone sonic-mgmt repo to local directory
2. Edit 'ansible/veos' file. Put ip address of your server after 'ansible_host='
3. Edit 'ansible/group_vars/vm_host'. Put your credentials to reach the server
4. Check, that you can reach the server by running command 'ansible -i veos -m ping vm_host_1' from ansible directory. The output should contain 'pong'
5. Edit 'ansible/group_vars/vm_host/main.yml'.
* 'root_path': path where VMs virtual disks resides
* 'vm_images_url': URL where VM images could be downloaded
* 'cd_image_filename': filename of cd image of veos
* 'hdd_image_filename': filename of hdd image of veos
* 'http_proxy': your http_proxy
* 'http_proxy': your https_proxy
6. Edit 'ansible/host_vars/SERV-01.yml'. It contains settings for SERV-01. SERV-02 contains similar settings which are applied to SERV-02
* 'mgmt_gw': ip address of gateway for management interfaces of VM. See 3.2
* 'vm_X_enabled': true, if you want to run X vm set
* 'vm_X_external_iface': name of interface which connected to DUT. See 3.3
* 'vm_X_vlan_base': vlan number which is used for connection to first port of DUT.
7. Edit 'ansible/vars/configurations/*.yml' files. You need to adjust 'minigraph_mgmt_interface' to settings of your network See 3.2
8. Start testbed with command 'ANSIBLE_SCP_IF_SSH=y ansible-playbook -i veos start_vm_sets.yml --limit server_1 -e vm_set_1=true'
9. Stop testbed with command 'ANSIBLE_SCP_IF_SSH=y ansible-playbook -i veos stop_vm_sets.yml --limit server_1 -e vm_set_1=true'
2 changes: 1 addition & 1 deletion ansible/roles/vm_set/tasks/start_vm.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Gathering facts about the device
include_vars: name=vars/configurations/{{ filename }}
include_vars: vars/configurations/{{ filename }}

- name: Device debug output
debug: msg="hostname = {{ hostname }} serial port = {{ serial_port }} ip = {{ minigraph_mgmt_interface.addr }}"
Expand Down
131 changes: 57 additions & 74 deletions ansible/vars/configurations/01-ARISTA01T0.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,61 @@
minigraph_as_xml: minigraph/01-ARISTA01T0.xml
minigraph_bgp:
- addr: 10.0.0.32
asn: 65100
name: str-s6000-on-3
peer_addr: 10.0.0.33


minigraph_bgp_asn:
64001
...


minigraph_console:
{}


minigraph_devices:
{}


minigraph_hwsku:
Arista-VEOS
...


- addr: 10.0.0.32
asn: 65100
name: str-s6000-on-3
peer_addr: 10.0.0.33
- addr: FC00::41
asn: 65100
name: str-s6000-on-3
peer_addr: FC00::42
minigraph_bgp_asn: 64001
minigraph_console: {}
minigraph_devices: {}
minigraph_hwsku: Arista-VEOS
minigraph_interfaces:
- addr: 10.0.0.33
alias: Ethernet1
family: inet
mask: 255.255.255.254
name: Ethernet1
peer_addr: 10.0.0.32
prefixlen: 31
subnet: 10.0.0.32/31
- addr: 10.10.246.17
alias: Ethernet2
family: inet
mask: 255.255.255.0
name: Ethernet2
prefixlen: 24
subnet: 10.10.246.0/24


- addr: 10.0.0.33
alias: Ethernet1
mask: 255.255.255.254
name: Ethernet1
peer_addr: 10.0.0.32
prefixlen: 31
subnet: 10.0.0.32/31
- addr: fc00::42
alias: Ethernet1
mask: '126'
name: Ethernet1
peer_addr: fc00::41
prefixlen: 126
subnet: fc00::40/126
- addr: 10.10.246.17
alias: Ethernet2
mask: 255.255.255.0
name: Ethernet2
prefixlen: 24
subnet: 10.10.246.0/24
- addr: fc0a::22
alias: Ethernet2
mask: '64'
name: Ethernet2
prefixlen: 64
subnet: fc0a::/64
minigraph_lo_interfaces:
- addr: 100.1.0.17
family: inet
mask: 255.255.255.255
name: Loopback0
prefixlen: 32


- addr: 100.1.0.17
mask: 255.255.255.255
name: Loopback0
prefixlen: 32
- addr: 2064:100::11
mask: '128'
name: Loopback0
prefixlen: 128
minigraph_mgmt: {}
minigraph_mgmt_interface:
addr: 10.255.0.222
gwaddr: 10.255.0.1
mask: 255.255.255.0
prefixlen: '24'


minigraph_neighbors:
{}


minigraph_portchannel_interfaces:
[]


minigraph_underlay_devices:
null
...


minigraph_underlay_neighbors:
null
...


minigraph_vlan_interfaces:
[]
addr: 10.255.0.222
gwaddr: 10.255.0.1
mask: 255.255.255.0
prefixlen: '24'
minigraph_neighbors: {}
minigraph_portchannel_interfaces: []
minigraph_underlay_devices: null
minigraph_underlay_neighbors: null
minigraph_vlan_interfaces: []
131 changes: 57 additions & 74 deletions ansible/vars/configurations/01-ARISTA01T2.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,61 @@
minigraph_as_xml: minigraph/01-ARISTA01T2.xml
minigraph_bgp:
- addr: 10.0.0.0
asn: 65100
name: str-s6000-on-3
peer_addr: 10.0.0.1


minigraph_bgp_asn:
65200
...


minigraph_console:
{}


minigraph_devices:
{}


minigraph_hwsku:
Arista-VEOS
...


- addr: 10.0.0.0
asn: 65100
name: str-s6000-on-3
peer_addr: 10.0.0.1
- addr: FC00::1
asn: 65100
name: str-s6000-on-3
peer_addr: FC00::2
minigraph_bgp_asn: 65200
minigraph_console: {}
minigraph_devices: {}
minigraph_hwsku: Arista-VEOS
minigraph_interfaces:
- addr: 10.0.0.1
alias: Ethernet1
family: inet
mask: 255.255.255.254
name: Ethernet1
peer_addr: 10.0.0.0
prefixlen: 31
subnet: 10.0.0.0/31
- addr: 10.10.246.1
alias: Ethernet2
family: inet
mask: 255.255.255.0
name: Ethernet2
prefixlen: 24
subnet: 10.10.246.0/24


- addr: 10.0.0.1
alias: Ethernet1
mask: 255.255.255.254
name: Ethernet1
peer_addr: 10.0.0.0
prefixlen: 31
subnet: 10.0.0.0/31
- addr: fc00::2
alias: Ethernet1
mask: '126'
name: Ethernet1
peer_addr: fc00::1
prefixlen: 126
subnet: fc00::/126
- addr: 10.10.246.1
alias: Ethernet2
mask: 255.255.255.0
name: Ethernet2
prefixlen: 24
subnet: 10.10.246.0/24
- addr: fc0a::2
alias: Ethernet2
mask: '64'
name: Ethernet2
prefixlen: 64
subnet: fc0a::/64
minigraph_lo_interfaces:
- addr: 100.1.0.1
family: inet
mask: 255.255.255.255
name: Loopback0
prefixlen: 32


- addr: 100.1.0.1
mask: 255.255.255.255
name: Loopback0
prefixlen: 32
- addr: 2064:100::1
mask: '128'
name: Loopback0
prefixlen: 128
minigraph_mgmt: {}
minigraph_mgmt_interface:
addr: 10.255.0.238
gwaddr: 10.255.0.1
mask: 255.255.255.0
prefixlen: '24'


minigraph_neighbors:
{}


minigraph_portchannel_interfaces:
[]


minigraph_underlay_devices:
null
...


minigraph_underlay_neighbors:
null
...


minigraph_vlan_interfaces:
[]
addr: 10.255.0.238
gwaddr: 10.255.0.1
mask: 255.255.255.0
prefixlen: '24'
minigraph_neighbors: {}
minigraph_portchannel_interfaces: []
minigraph_underlay_devices: null
minigraph_underlay_neighbors: null
minigraph_vlan_interfaces: []
Loading