f0873f29d8
* support sai-ptf-v2 in libsaithrift vs * add build target docker-ptf-sai syncd-rpcv2 and saiserverv2 Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * add docker ptf sai Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * add build condition for broadcom Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * add docker syncd dbg and add debug symbol to docker-saiserverv2 Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * correct the build option * change the azure pipeline build template Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * change build option for docker-ptf-sai * enable ptf-sai docker build * remove the build for syncd-rpcv2 Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * fix issue in build tempalte * ignore useless package build when build sai-ptf Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * remove scapy version contraint Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * remove duplicated target docker-ptf Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * change template for testing the pipeline Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * remove duplicated target Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * fix error in make script Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * add shel to setup env Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * replace with certain platform name Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * disable cache for syncd-rpcv2 Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * test without cache Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * disable cache Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * testing: disable the cache for build syncd-rpcv2 Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * add cache back and get the code ready for testing Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * refactor code Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * add workaround for issue in rules/sairedis.dep Signed-off-by: richardyu-ms <richard.yu@microsoft.com> * refactor code Signed-off-by: richardyu-ms <richard.yu@microsoft.com> Signed-off-by: richardyu-ms <richard.yu@microsoft.com> |
||
---|---|---|
.. | ||
docker-gbsyncd-vs | ||
docker-sonic-vs | ||
docker-syncd-vs | ||
sonic-version | ||
tests | ||
create_vnet.sh | ||
docker-gbsyncd-vs.dep | ||
docker-gbsyncd-vs.mk | ||
docker-ptf-sai.dep | ||
docker-ptf-sai.mk | ||
docker-ptf.dep | ||
docker-ptf.mk | ||
docker-sonic-vs.dep | ||
docker-sonic-vs.mk | ||
docker-syncd-vs.dep | ||
docker-syncd-vs.mk | ||
gbsyncd-vs.mk | ||
kvm-image.dep | ||
kvm-image.mk | ||
libsaithrift-dev.dep | ||
libsaithrift-dev.mk | ||
one-image.dep | ||
one-image.mk | ||
onie.dep | ||
onie.mk | ||
platform.conf | ||
raw-image.dep | ||
raw-image.mk | ||
README.gns3.md | ||
README.vsdocker.md | ||
README.vsvm.md | ||
rules.dep | ||
rules.mk | ||
sonic_multiasic.xml | ||
sonic-gns3a.sh | ||
sonic-version.dep | ||
sonic-version.mk | ||
sonic.xml | ||
syncd-vs.dep | ||
syncd-vs.mk |
HOWTO Use Virtual Switch (VM)
- Install libvirt, kvm, qemu
sudo apt-get install libvirt-clients qemu-kvm libvirt-bin
- Create SONiC VM for single ASIC HWSKU
$ sudo virsh
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh #
virsh # create sonic.xml
Domain sonic created from sonic.xml
virsh #
- Create SONiC VM for multi-ASIC HWSKU
- Based on the number of asics of hwsku, update device/x86_64-kvm_x86_64-r0/asic.conf
NUM_ASIC=<n>
DEV_ID_ASIC_0=0
DEV_ID_ASIC_1=1
DEV_ID_ASIC_2=2
DEV_ID_ASIC_3=3
..
DEV_ID_ASIC_<n-1>=<n-1>
For example, a four asic VS asic.conf will be:
NUM_ASIC=4
DEV_ID_ASIC_0=0
DEV_ID_ASIC_1=1
DEV_ID_ASIC_2=2
DEV_ID_ASIC_3=3
-
Create a topology.sh script which will create the internal asic topology for the specific hwsku. For example, for msft_multi_asic_vs: https://github.com/Azure/sonic-buildimage/blob/master/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/topology.sh
-
With the updated asic.conf and topology.sh, build sonic-vs.img which can be used to bring up multi-asic virtual switch.
-
Update platform/vs/sonic_multiasic.xml with higher memory and vcpu as required.
- For 4-asic vs platform msft_four_asic_vs hwsku, 8GB memory and 10vCPUs.
- For 7-ASIC vs platform msft_multi_asic_vs hwsku, 8GB and 16vCPUs.
-
Update the number of front-panel interfaces in sonic_multliasic.xml
- For 4-ASIC vs platform, 8 front panel interfaces.
- For 6-ASIC vs platform, 64 front panel interfaces.
-
With multi-asic sonic_vs.img and sonic_multiasic.xml file, bring up multi-asic vs as:
$ sudo virsh
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh #
virsh # create sonic_multiasic.xml
Domain sonic created from sonic.xml
virsh #
-
Steps to convert a prebuilt single asic sonic-vs.img:
- Use the updated sonic_multiasic.xml file and bring up virtual switch.
- Update /usr/share/sonic/device/x86_64-kvm_x86_64-r0/asic.conf as above.
- Add topology.sh in /usr/share/sonic/device/x86_64-kvm_x86_64-r0/
- stop database service and remove database docker, so that when vs is
rebooted, database_global.json is created with the right namespaces.
- systemctl stop database
- docker rm database
- sudo reboot
- Once rebooted, VS should be multi-asic VS.
-
Start topology service.
sudo systemctl start topology.
- Load configuration using minigraph or config_dbs.
-
Access virtual switch:
- Connect SONiC VM via console
$ telnet 127.0.0.1 7000
OR
-
Connect SONiC VM via SSH
-
Connect via console (see 3.1 above)
-
Request a new DHCP address
sudo dhclient -v
- Connect via SSH
$ ssh -p 3040 admin@127.0.0.1
-