sonic-buildimage/platform/vs
Richard.Yu 47d63bcd06
[SAI PTF] SAI PTF docker support sai-ptf v2 (#12719)
* [SAI PTF] SAI PTF docker support sai-ptf v2

Publish the sai-ptf docker.

Take part of the change from previous PR #11610 (already reverted as some cache issue)
Cause in #11610, added two new target in it, one is sai-ptf another one is syncd-rpc with sai-ptf v2, to make the upgrade with more clear target, use this one take the sai-ptf one.

Test one:
NOSTRETCH=y NOJESSIE=y make configure PLATFORM=vs
NOSTRETCH=y NOJESSIE=y NOBULLSEYE=y SAITHRIFT_V2=y make target/docker-ptf-sai.gz

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless change

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless parameters

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless change

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* Update azure-pipelines-build.yml

remove a useless option

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
2022-11-17 04:42:51 -08:00
..
docker-gbsyncd-vs Upgrade gbsyncd container to bullseye (#11288) 2022-06-30 15:54:36 +08:00
docker-sonic-vs Remove LOGLEVEL DB since is no longer used (#12657) 2022-11-14 12:10:44 -08:00
docker-syncd-vs Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
sonic-version [build]: add branch and release name in sonic_version.yml (#6356) 2021-08-08 20:44:02 -07:00
tests [DPB]Removing default admin status initialization in DPB flow while loading minigraph (#8711) 2021-09-13 09:01:29 -07:00
create_vnet.sh
docker-gbsyncd-vs.dep
docker-gbsyncd-vs.mk [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
docker-ptf-sai.dep [PTF-SAIv2]Add ptf docker for sai-ptf (saiv2) (#9729) 2022-02-18 01:48:50 -08:00
docker-ptf-sai.mk [SAI PTF] SAI PTF docker support sai-ptf v2 (#12719) 2022-11-17 04:42:51 -08:00
docker-ptf.dep [docker-ptf]: build docker ptf 2021-01-27 08:28:21 -08:00
docker-ptf.mk Revert "[SAI PTF]Syncd-rpc and PTF docker support sai ptf v2 (#11610)" (#12677) 2022-11-14 09:56:10 +08:00
docker-sonic-vs.dep
docker-sonic-vs.mk Remove swsssdk from sonic OS image and docker container image (#12323) 2022-10-12 13:04:14 +08:00
docker-syncd-vs.dep
docker-syncd-vs.mk [build] Remove dulplicated DOCKER_SYNCD_BASE target. (#9378) 2021-12-13 11:06:10 +08:00
gbsyncd-vs.mk
kvm-image.dep
kvm-image.mk [vs][multi-asic]: Add new platforms for multi-asic vs. (#8269) 2021-08-31 22:45:59 -07:00
libsaithrift-dev.dep [docker-ptf]: build docker ptf 2021-01-27 08:28:21 -08:00
libsaithrift-dev.mk Revert "[SAI PTF]Syncd-rpc and PTF docker support sai ptf v2 (#11610)" (#12677) 2022-11-14 09:56:10 +08:00
one-image.dep
one-image.mk
onie.dep
onie.mk [vs][multi-asic]: Add new platforms for multi-asic vs. (#8269) 2021-08-31 22:45:59 -07:00
platform.conf
raw-image.dep
raw-image.mk
README.gns3.md
README.vsdocker.md
README.vsvm.md [multi-asic][vs]: Update readme file to create multi-asic vs (#6867) 2021-03-05 12:46:07 -08:00
rules.dep [PTF-SAIv2]Add ptf docker for sai-ptf (saiv2) (#9729) 2022-02-18 01:48:50 -08:00
rules.mk [PTF-SAIv2]Add ptf docker for sai-ptf (saiv2) (#9729) 2022-02-18 01:48:50 -08:00
sonic_multiasic.xml
sonic-gns3a.sh Update azure.github.io links to sonic-net.github.io (#12209) 2022-10-02 14:02:10 +08:00
sonic-version.dep
sonic-version.mk
sonic.xml
syncd-vs.dep
syncd-vs.mk

HOWTO Use Virtual Switch (VM)

  1. Install libvirt, kvm, qemu
sudo apt-get install libvirt-clients qemu-kvm libvirt-bin
  1. 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 # 
  1. 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.
  1. Access virtual switch:

    1. Connect SONiC VM via console
    $ telnet 127.0.0.1 7000
    

    OR

    1. Connect SONiC VM via SSH

      1. Connect via console (see 3.1 above)

      2. Request a new DHCP address

      sudo dhclient -v
      
      1. Connect via SSH
      $ ssh -p 3040 admin@127.0.0.1