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
3 changes: 3 additions & 0 deletions ansible/lab
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ sonic_s6000:
ansible_host: 10.250.0.122
ansible_hostv6: fec0::ffff:afa:12
card_type: supervisor
vlab-vpp-01:
ansible_host: 10.250.0.92
ansible_hostv6: fec0::ffff:afa:70

sonic_s6100:
vars:
Expand Down
5 changes: 4 additions & 1 deletion ansible/roles/vm_set/tasks/start_sonic_vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
- "{{ sonic_vm_storage_location }}/disks"

- set_fact:
src_disk_image: "{{ sonic_vm_storage_location }}/images/sonic-vs.img"
disk_image: "{{ sonic_vm_storage_location }}/disks/sonic_{{ dut_name }}.img"
mgmt_ip_address: " {{ hostvars[dut_name]['ansible_host'] }}"
mgmt_gw: "{{ vm_mgmt_gw | default(mgmt_gw) }}"
serial_port: "{{ hostvars[dut_name]['serial_port'] }}"
hwsku: "{{ hostvars[dut_name].hwsku }}"
num_asic: "{{ hostvars[dut_name]['num_asics'] | default(1) }}"
card_type: "{{ hostvars[dut_name]['card_type'] | default('pizzabox') }}"
asic_type: "{{ hostvars[dut_name].asic_type | default('') }}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The default vpp image file name should be like "sonic-vpp.img".
Still using "sonic-vs.img" here is confusing. It means that before deploy a VPP image KVM testbed, we need to get the VPP image with name like "sonic-vpp.img", then put it under "{{ sonic_vm_storage_location }}/images/" and rename it to "sonic-vs.img". This does not really make sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated - will use 'sonic-vpp.img' when asic_type is vpp.


- set_fact:
src_disk_image: "{{ sonic_vm_storage_location }}/images/sonic-{{ 'vpp' if 'vpp' == asic_type else 'vs' }}.img"

- name: Remove arp entry for {{ dut_name }}
shell: arp -d {{ mgmt_ip_address }}
Expand Down
16 changes: 16 additions & 0 deletions ansible/roles/vm_set/templates/sonic.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
<model fallback='forbid'/>
<topology sockets='1' dies='1' cores='5' threads='2'/>
</cpu>
{% elif asic_type == 'vpp' %}
<memory unit='GiB'>8</memory>
<currentMemory unit='GiB'>8</currentMemory>
<vcpu placement='static'>6</vcpu>
<cpu mode='host-model'>
<model fallback='forbid'/>
<topology sockets='1' dies='1' cores='6' threads='1'/>
</cpu>
{% else %}
<memory unit='GiB'>6</memory>
<currentMemory unit='GiB'>6</currentMemory>
Expand Down Expand Up @@ -68,12 +76,20 @@
</serial>
<interface type='ethernet'>
<target dev='{{ dut_name }}-0' />
{% if asic_type == 'vpp' %}
<model type='virtio-net-pci' />
{% else %}
<model type='e1000' />
{% endif %}
</interface>
{% for i in range(port_alias|length) %}
<interface type='ethernet' >
<target dev='{{ dut_name }}-{{ i + 1 }}' />
{% if asic_type == 'vpp' %}
<model type='virtio-net-pci' />
{% else %}
<model type='e1000' />
{% endif %}
<mtu size='{{ fp_mtu_size }}' />
</interface>
{% endfor %}
Expand Down
10 changes: 10 additions & 0 deletions ansible/veos_vtb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ all:
vlab-t2-1-2:
vlab-t2-1-sup:
vlab-c-02:
vlab-vpp-01:
ptf:
hosts:
ptf-01:
Expand Down Expand Up @@ -328,6 +329,15 @@ all:
ansible_user: admin
ansible_ssh_user: admin
ansible_altpassword: admin
vlab-vpp-01:
ansible_host: 10.250.0.92
ansible_hostv6: fec0::ffff:afa:70
type: kvm
hwsku: Force10-S6000
asic_type: vpp
serial_port: 9001
ansible_password: password
ansible_user: admin

# The groups below are helpers to limit running playbooks to a specific server only
server_1:
Expand Down
30 changes: 30 additions & 0 deletions ansible/vtestbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,33 @@
inv_name: veos_vtb
auto_recover: 'False'
comment: Tests virtual force vs vm with 7 nodes

- conf-name: vms-kvm-vpp-t1-lag
group-name: vms6-2
topo: t1-lag
ptf_image_name: docker-ptf
ptf: ptf-02
ptf_ip: 10.250.0.106/24
ptf_ipv6: fec0::ffff:afa:6/64
server: server_1
vm_base: VM0104
dut:
- vlab-vpp-01
inv_name: veos_vtb
auto_recover: 'False'
comment: Tests virtual vpp switch vm

- conf-name: vms-kvm-vpp-t1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since there is already a vms-kvm-vpp-t1-lag, is it better to replace vms-kvm-vpp-t1 with t0 topo like vms-kvm-vpp-t0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Support is currently only for T1 and T1-lag, will add support for T0 in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, if the preparation is ready, we can add optional PR checks on these topologys. I will provide Elastictest support and guide that you can follow to setup new pr checks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, if the preparation is ready, we can add optional PR checks on these topologys. I will provide test infra support and the guide that you can follow to setup new pr checks.

group-name: vms6-2
topo: t1
ptf_image_name: docker-ptf
ptf: ptf-02
ptf_ip: 10.250.0.106/24
ptf_ipv6: fec0::ffff:afa:6/64
server: server_1
vm_base: VM0104
dut:
- vlab-vpp-01
inv_name: veos_vtb
auto_recover: 'False'
comment: Tests virtual vpp switch vm
23 changes: 23 additions & 0 deletions docs/testbed/README.testbed.VPP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Running Sonic-mgmt with Sonic-VPP as DUT
To set up a testbed with a Sonic-VPP DUT follow the [VS testbed setup](README.testbed.VsSetup.md), and use the following commands during bringup. All of the following commands are to be run from the sonic-mgmt container.

### Add topology:
```
cd /data/sonic-mgmt/ansible
./testbed-cli.sh -t vtestbed.yaml -m veos_vtb -k ceos add-topo vms-kvm-vpp-t1-lag password.txt
```
### Deploy minigraph:
```
cd /data/sonic-mgmt/ansible
./testbed-cli.sh -t vtestbed.yaml -m veos_vtb deploy-mg vms-kvm-vpp-t1-lag veos_vtb password.txt
```
### Example test run:
```
cd /data/sonic-mgmt/tests
./run_tests.sh -n vms-kvm-vpp-t1-lag -d vlab-vpp-01 -O -u -l debug -e -s -e "--disable_loganalyzer --skip_sanity --mark-conditions-files common/plugins/conditional_mark/tests_mark_conditions.yaml" -e "--mark-conditions-files common/plugins/conditional_mark/tests_mark_conditions_sonic_vpp.yaml" -m individual -f vtestbed.yaml -i ../ansible/veos_vtb -p <log> -c <tests>
```
### Remove topology:
```
cd /data/sonic-mgmt/ansible
./testbed-cli.sh -t vtestbed.yaml -m veos_vtb -k ceos remove-topo vms-kvm-vpp-t1-lag password.txt
```
Loading