Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[multi-asic]: Add multi-asic virtual switch testbed #2168

Merged
merged 25 commits into from
Jan 21, 2021

Conversation

SuvarnaMeenakshi
Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi commented Sep 1, 2020

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Add new testbed for multi-asic VS platform with HwSKU: msft_multi_asic_vs

How did you do it?

To create a multi-asic VS testbed, the assumption is that the vs image is a multi-asic VS, which means that the asic.conf is updated with the right number of asics. In this PR, multi-asic VS of SKU: msft_multi_asic_vs is used with number of ASICS as 6.The below changes will address the modification:

  • Add new HwSKU msft_multi_asic_vs with 64 front-panel interfaces.
  • Add new testbed information.
  • Modify sonic.xml.j2 to have higher vcpu and vmemory for multi-asic vs.
  • Add num_asics parameter in veos_vtb to denote number of asics of that device.
  • Update port_alias to parse port_config files for each asic for multi-asic device and retrieve external interfaces so that VS image can come up with required number of external interfaces.

How did you verify/test it?

Bring up vs testbed using the command: ./testbed-cli.sh -t vtestbed.csv -m veos_vtb -k ceos add-topo vms-kvm-multi-asic-t1-lag password.txt
Ensure that the sonic-vs testbed comes up fine. Sonic vm should be accessible via console access. Configuration changes are not added in this PR.

Ensure that single-asic vs testbed comes up fine using:
./testbed-cli.sh -t vtestbed.csv -m veos_vtb -k ceos add-topo vms-kvm-t0 password.txt
./testbed-cli.sh -t vtestbed.csv -m veos_vtb deploy-mg vms-kvm-t0 lab password.txt

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Add a new parameter in port_alias.py to retrieve only
external interfaces.
Remove incorrect changes.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
multi-asic vs.
- Add num_asic parameter in veos_vtb to denote number of asics
  of that device.
- Update port_alias to get port_config files for each asic
  for multi-asic device.
- Update sonic-kickstart to add number of asics in asic.conf file.
- Reboot sonic-vs number of asics is more than 1 so that the vs
  comes up as multi-asic vs.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
of minigraph.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@SuvarnaMeenakshi SuvarnaMeenakshi marked this pull request as ready for review September 11, 2020 01:43
Ubuntu added 3 commits November 4, 2020 18:15
…vs_check

Signed-off-by: Ubuntu <sumeenak@sumeenak-ubuntu-vm0.q3q211rtov2etb23rce1vewych.cx.internal.cloudapp.net>
Signed-off-by: Ubuntu <sumeenak@sumeenak-ubuntu-vm0.q3q211rtov2etb23rce1vewych.cx.internal.cloudapp.net>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@@ -4,3 +4,4 @@ vms-kvm-t0-64,vms6-1,t0-64,docker-ptf,ptf-01,10.250.0.102/24,fec0::ffff:afa:2/64
vms-kvm-t1-lag,vms6-2,t1-lag,docker-ptf,ptf-02,10.250.0.106/24,fec0::ffff:afa:6/64,server_1,VM0104,[vlab-03],Tests virtual switch vm
vms-kvm-t0-2,vms6-3,t0,docker-ptf,ptf-03,10.250.0.108/24,fec0::ffff:afa:8/64,server_1,VM0104,[vlab-04],Tests virtual switch vm
vms-kvm-dual-t0,vms6-4,dualtor,docker-ptf,ptf-04,10.250.0.109/24,fec0::ffff:afa:9/64,server_1,VM0108,[vlab-05;vlab-06],Dual-TOR testbed
vms-kvm-multi-asic-t1-lag,vms6-4,t1-lag,docker-ptf,ptf-unknown,10.250.0.106/24,fec0::ffff:afa:6/64,server_1,VM0104,[vlab-07],Tests multi-asic virtual switch vm
Copy link
Collaborator

@wangxin wangxin Nov 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a new PTF should be defined for this multi-ASIC setup. For example:

  • ptf-05
  • 10.250.0.109
  • fec0::ffff:afa:a/64

The ptf-05 host also should be added to ansible/veos_vtb.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added new ptf-docker as suggested.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@SuvarnaMeenakshi
Copy link
Contributor Author

retest vsimage please

@wangxin
Copy link
Collaborator

wangxin commented Nov 6, 2020

retest vsimage please

1 similar comment
@SuvarnaMeenakshi
Copy link
Contributor Author

retest vsimage please

else:
num_asic = allmap.get_num_asic()
if num_asic == 1:
(aliases, portmap, aliasmap, portspeed) = allmap.get_portmap(all_ports)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this if else.. for loop should be enough.

if m_args['num_asic'] is not None:
num_asic = m_args['num_asic']
else:
num_asic = allmap.get_num_asic()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use sonic-py-common utility here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to use sonic_py_common utility.
But as port_alias.py script is invoked from sonic_mgmt docker during VS bring up or is run on the device/VS during minigraph generation, the import of sonic_py_common library cannot be done globally as it will not present when run on sonic-mgmt docker.

if os.path.exists(portconfig):
return portconfig
return None

def get_portmap(self):
def get_num_asic(self):
num_asic = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -117,6 +117,7 @@ def session(new_params):
('ip route add 0.0.0.0/0 via %s table default' % str(new_params['mgmt_gw']), [r'#']),
('ip route', [r'#']),
('echo %s:%s | chpasswd' % (str(new_params['login']), str(new_params['new_password'])), [r'#']),
('echo NUM_ASIC=%s > /usr/share/sonic/device/x86_64-kvm_x86_64-r0/asic.conf' % (str(new_params['num_asic'])), [r'#']),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will not be needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

register: kickstart_output

- name: Fail if kickstart gives error for {{ dut_name }}
fail: msg="Start sonic vm weren't succesfull"
when: kickstart_output.kickstart_code != 0

- name: Reboot sonic-vm to bring up as multi-asic vs {{ num_asic }}
command: "virsh reboot {{ dut_name }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as we can use a pre-built sonic-vs image where number of asics is updated in asic.conf.

Ubuntu added 4 commits November 17, 2020 22:57
- Use a pre build sonic multiasic VS image with asic.conf updated with number of asics.
- Remove updation on asic.conf during multiasic VS testbed image bring up.
- Remove function added to retrieve number of asics in port_alias. When executed
from DUT, use sonic_py_common function to retrieve number of asics.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@wangxin
Copy link
Collaborator

wangxin commented Nov 23, 2020

retest vsimage please

exception on import error.
Remove all_ports variable added, will always retrieve
external ports alone.

Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
For multi-asic platform, there will be multiple swss services
running. So instead of checking for each swss services, check
if all services are up and then proceed with configuring eth0
IP address.

Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
@@ -108,7 +108,7 @@ def logout(self):

def session(new_params):
seq = [
('while true; do if [ $(systemctl is-active swss) == "active" ]; then break; fi; echo $(systemctl is-active swss); sleep 1; done', [r'#'], 180),
('while true; do if [ $(systemctl is-system-running) == "degraded" ]; then break; fi; echo $(systemctl is-system-running); sleep 1; done', [r'#'], 180),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the check for the state "is-system-running" == "running" also ? It could go into this state as well.
https://www.freedesktop.org/software/systemd/man/systemctl.html.

before assigning eth0 IP address.
As there is no default configuration for multi-asic VS,
interfaces-config will nto override the configured
eth0 IP address so we do not need to check for
interfaces-config service completion for multi-asic VS.
No change in behavior for single asic VS.

Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
@SuvarnaMeenakshi SuvarnaMeenakshi merged commit 4f4c6f1 into sonic-net:master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants