Skip to content

Commit 399efd6

Browse files
authored
update testbed config, setup and FAQ section (#228)
1 parent db066dd commit 399efd6

File tree

3 files changed

+76
-30
lines changed

3 files changed

+76
-30
lines changed

ansible/doc/README.testbed.Config.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
# Testbed Configuration
22

3-
```testbed.csv``` is the topology configuration file for the testbed.
3+
## Testbed Inventory
44

5-
# ```testbed.csv```
5+
- [```ansible/lab```](../lab): Include all lab DUTs, fanout switches and testbed server topologies
6+
7+
- [```ansible/veos```](../veos): all servers and VMs
8+
9+
## Testbed Physical Topology
10+
11+
- [```ansible/files/sonic_lab_devices.csv```](../files/sonic_lab_devices.csv): Helper file helps you create lab_connection_graph.xml, list all devices that are physically connected to fanout testbed (all devices should be in ansible/lab)
12+
13+
- [```ansible/files/sonic_lab_links.csv```](../files/sonic_lab_links.csv): Helper file helps you to create lab_connection_graph.xml, list all physical links between DUT, Fanoutleaf and Fanout root switches, servers and vlan configurations for each link
14+
15+
- [```ansible/files/lab_connection_graph.xml```](../files/lab_connection_graph.xml): This is the lab graph file for library/conn_graph_facts.py to parse and get all lab fanout switch connections information. If you have only one fanout switch, you may go head manually modify the sample lab_connection_graph.xml file to set bot your fanout leaf and fanout root switch management IP point to the same fanout switch management IP and make sure all DUT and Fanout name and IP are matching your testbed.
16+
17+
- ```ansible/files/creategraph.py```: Helper file helps you generate a lab_connection_graph.xml based on the device file and link file specified above.
18+
19+
Based on ansible_facts, you may write ansible playbooks to deploy fanout switches or run test which requires to know the DUT physical connections to fanout switch
20+
21+
22+
## Testbed Logical Topology
23+
24+
[```testbed.csv```](../testbed.csv) is the topology configuration file for the testbed.
25+
26+
### ```testbed.csv``` format
627
```
728
# conf-name,group-name,topo,ptf_image_name,ptf_mgmt_ip,server,vm_base,dut,comment
829
ptf1-m,ptf1,ptf32,docker-ptf-sai-mlnx,10.255.0.188/24,server_1,,str-msn2700-01,Tests ptf
@@ -21,7 +42,7 @@ vms-t1-lag,vms1-1,t1-lag,docker-ptf-sai-mlnx,10.255.0.178/24,server_1,VM0100,str
2142
- dut – target dut name
2243
- comment – any text here
2344
24-
# ```testbed.csv``` consistency rules
45+
### ```testbed.csv``` consistency rules
2546
```
2647
# uniq-name,testbed-name,topo,ptf_image_name,ptf_ip,server,vm_base,dut,owner
2748
vms2-2-b,vms2-2,t1,docker-ptf-sai-brcm,10.0.10.7/23,server_1,VM0100,str-d6000-05,brcm test

ansible/doc/README.testbed.FAQ.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# FAQ
22

3+
## Minimum hardware requirement
4+
5+
- One 'Fanout' layer-2 switch to connect all SONiC Switch ports and Linux server NIC.
6+
you may need more 'Fanout' Switches connects to multiple SONiC switches as DUTs.
7+
8+
- Linux Server with minimum 92G memory.
9+
310
## How to find IP addresses of VMs and PTF
411
- IP address of testbed PTF container could be found in testbed.csv
512
- To find some VM IP address:

ansible/doc/README.testbed.Setup.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,55 +30,73 @@ iface br1 inet static
3030
```
3131

3232
- Installed python 2.7 (required by ansible).
33-
- Add Dockers official GPG key
33+
- Add Docker's official GPG key
3434
```
3535
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
3636
```
3737

38-
## Build and run ```sonic-mgmt``` docker
38+
## Setup docker registry for *PTF* docker
3939

40-
ansible playbook in ```sonic-mgmt``` repo requires to setup ansible and various dependencies.
41-
We have built a ```sonic-mgmt``` docker that installs all dependencies, and you can simply
42-
build that docker and ansible playbook inside the docker.
40+
PTF docker is used to send and receive packets to test data plane.
4341

44-
- Build ```sonic-mgmt``` docker
42+
- Build PTF docker
43+
```
44+
git clone --recursive https://github.com/Azure/sonic-buildimage.git
45+
make target/docker-ptf.gz
46+
```
47+
48+
- Setup [docker registry](https://docs.docker.com/registry/) and upload *docker-ptf* to the docker registry.
49+
50+
## Build and run *sonic-mgmt* docker
51+
52+
ansible playbook in *sonic-mgmt* repo requires to setup ansible and various dependencies.
53+
We have built a *sonic-mgmt* docker that installs all dependencies, and you can build
54+
the docker and run ansible playbook inside the docker.
55+
56+
- Build *sonic-mgmt* docker
4557
```
4658
git clone --recursive https://github.com/Azure/sonic-buildimage.git
4759
make target/docker-sonic-mgmt.gz
4860
```
4961

50-
- Run ```sonic-mgmt``` docker
62+
Pre-built *sonic-mgmt* can also be downloaded from [here](https://sonic-jenkins.westus.cloudapp.azure.com/job/common/job/docker-sonic-mgmt/lastSuccessfulBuild/artifact/target/docker-sonic-mgmt.gz).
63+
64+
- Run *sonic-mgmt* docker
5165
```
5266
docker load -i target/docker-sonic-mgmt.gz
5367
docker run -it docker-sonic-mgmt bash
5468
cd ~/sonic-mgmt
5569
```
5670

57-
From now on, all steps are running inside the ```sonic-mgmt``` docker.
71+
From now on, all steps are running inside the *sonic-mgmt* docker.
5872

5973
## Prepare testbed configurations
6074

61-
Prepare various configuration files for your testbed.
62-
63-
- Add/Update your testbed server management IP in veos file. Example:'STR-ACS-SERV-01 ansible_host=10.0.0.5' where 10.0.0.5 your server mgmt ip
64-
- Add testbed server credentials in ```ansible/group_vars/vm_host/creds.yml```
65-
- Check that ansible could reach this device by command ```ansible -m ping -i veos vm_host_1```
66-
- Put files: ```Aboot-veos-serial-8.0.0.iso``` and ```vEOS-lab-4.15.9M.vmdk``` to /home/{your_username from step 3}/veos-vm/images on your testbed server
67-
- Edit ```ansible/host_vars/STR-ACS-SERV-01.yml```. You need to change ```external_iface```,```mgmt_gw``` and ```mgmt_prefixlen```. These settings define network parameters for VM/ptf management interfaces. Example:
68-
69-
```
70-
external_iface: p4p1   <--- trunk port of the server (connected to the fanout switch)
71-
mgmt_gw: 10.250.0.1    <--- ip of gateway for VM mgmt interfaces
72-
mgmt_prefixlen: 24     <--- prefixlen for management interfaces
73-
```
74-
75-
- Add ip addresses for your VMs in veos inventory file ```ansible/veos``` inventory file. These IP addresses should be in the management subnet defined in above file.
76-
- Update VM credentials in ```ansible/group_vars/eos/creds.yml```. Use root:123456 as credentials
77-
- Add information about your docker registry here: ```vars/docker_registry.yml```
75+
Latest *sonic-mgmt* repo is cloned into *sonic-mgmt* docker under '/var/[your-login-username]/sonic-mgmt`.
76+
Once you are in the docker, you need to modify the testbed configuration files to reflect your lab setup.
77+
78+
- Server
79+
- Update server management IP in [```ansible/veos```](../veos).
80+
- Update testbed server credentials in [```ansible/group_vars/vm_host/creds.yml```](../group_vars/vm_host/creds.yml).
81+
- Update server network configuration for VM and PTF management interface in [```ansible/host_vars/STR-ACS-SERV-01.yml```](../host_vars/STR-ACS-SERV-01.yml).
82+
- ```external_iface```: server trunk port name (connected to the fanout switch)
83+
- ```mgmt_gw```: ip of gateway for VM mgmt interfaces
84+
- ```mgmt_prefixlen```: prefixlen for management interfaces
85+
- Check that ansible could reach this device by command ```ansible -m ping -i veos vm_host_1```.
86+
87+
- VM
88+
- Download vEOS image from [arista](https://www.arista.com/en/support/software-download).
89+
- Copy below image files to ```~/veos-vm/images``` on your testbed server.
90+
- ```Aboot-veos-serial-8.0.0.iso```
91+
- ```vEOS-lab-4.15.9M.vmdk```
92+
- Update VM IP addresses [```ansible/veos```](../voes) inventory file. These IP addresses should be in the management subnet defined above.
93+
- Update VM credentials in [```ansible/group_vars/eos/creds.yml```](../group_vars/eos/creds.yml).
94+
95+
- ```PTF``` docker
96+
- Update docker registry information in [```vars/docker_registry.yml```](../vars/docker_registry.yml).
7897

7998
## Setup VMs in the server
8099

81-
82100
```
83101
./testbed-cli.sh start-vms server_1 password.txt
84102
```
@@ -87,7 +105,7 @@ Check that all VMs are up and running: ```ansible -m ping -i veos server_1```
87105

88106
## Deploy topology
89107

90-
- Update testbed.csv with your data. At least update PTF mgmt interface settings
108+
- Update ```testbed.csv``` with your data. At least update PTF mgmt interface settings
91109
- To deploy PTF topology run: ```./testbed-cli.sh add-topo ptf1-m ~/.password```
92110
- To remove PTF topology run: ```./testbed-cli.sh remove-topo ptf1-m ~/.password```
93111
- To deploy T1 topology run: ```./testbed-cli.sh add-topo vms-t1 ~/.password```

0 commit comments

Comments
 (0)