diff --git a/ansible/host_vars/STR-ACS-SERV-01.yml b/ansible/host_vars/STR-ACS-SERV-01.yml index 163824bd0d6..2ea0e284794 100644 --- a/ansible/host_vars/STR-ACS-SERV-01.yml +++ b/ansible/host_vars/STR-ACS-SERV-01.yml @@ -29,398 +29,396 @@ ptf_6_vlan_base: 425 vm_1_enabled: true vm_1_vlan_base: 489 -vm_1_injected_ptf: true vm_1_injected_ip: 10.255.0.178/24 VMs_1: ARISTA01T0: num: 0 filename: 01-ARISTA01T0.xml serial_port: 5000 - vlans: "17" + vlans: "16" memory: "{{ tor_memory }}" ARISTA01T2: num: 1 filename: 01-ARISTA01T2.xml serial_port: 5016 - vlans: "1" + vlans: "0" memory: "{{ spine_memory }}" ARISTA02T0: num: 2 filename: 01-ARISTA02T0.xml serial_port: 5001 - vlans: "18" + vlans: "17" memory: "{{ tor_memory }}" ARISTA02T2: num: 3 filename: 01-ARISTA02T2.xml serial_port: 5017 - vlans: "2" + vlans: "1" memory: "{{ spine_memory }}" ARISTA03T0: num: 4 filename: 01-ARISTA03T0.xml serial_port: 5002 - vlans: "19" + vlans: "18" memory: "{{ tor_memory }}" ARISTA03T2: num: 5 filename: 01-ARISTA03T2.xml serial_port: 5018 - vlans: "3" + vlans: "2" memory: "{{ spine_memory }}" ARISTA04T0: num: 6 filename: 01-ARISTA04T0.xml serial_port: 5003 - vlans: "20" + vlans: "19" memory: "{{ tor_memory }}" ARISTA04T2: num: 7 filename: 01-ARISTA04T2.xml serial_port: 5019 - vlans: "4" + vlans: "3" memory: "{{ spine_memory }}" ARISTA05T0: num: 8 filename: 01-ARISTA05T0.xml serial_port: 5004 - vlans: "21" + vlans: "20" memory: "{{ tor_memory }}" ARISTA05T2: num: 9 filename: 01-ARISTA05T2.xml serial_port: 5020 - vlans: "5" + vlans: "4" memory: "{{ spine_memory }}" ARISTA06T0: num: 10 filename: 01-ARISTA06T0.xml serial_port: 5005 - vlans: "22" + vlans: "21" memory: "{{ tor_memory }}" ARISTA06T2: num: 11 filename: 01-ARISTA06T2.xml serial_port: 5021 - vlans: "6" + vlans: "5" memory: "{{ spine_memory }}" ARISTA07T0: num: 12 filename: 01-ARISTA07T0.xml serial_port: 5006 - vlans: "23" + vlans: "22" memory: "{{ tor_memory }}" ARISTA07T2: num: 13 filename: 01-ARISTA07T2.xml serial_port: 5022 - vlans: "7" + vlans: "6" memory: "{{ spine_memory }}" ARISTA08T0: num: 14 filename: 01-ARISTA08T0.xml serial_port: 5007 - vlans: "24" + vlans: "23" memory: "{{ tor_memory }}" ARISTA08T2: num: 15 filename: 01-ARISTA08T2.xml serial_port: 5023 - vlans: "8" + vlans: "7" memory: "{{ spine_memory }}" ARISTA09T0: num: 16 filename: 01-ARISTA09T0.xml serial_port: 5008 - vlans: "25" + vlans: "24" memory: "{{ tor_memory }}" ARISTA09T2: num: 17 filename: 01-ARISTA09T2.xml serial_port: 5024 - vlans: "9" + vlans: "8" memory: "{{ spine_memory }}" ARISTA10T0: num: 18 filename: 01-ARISTA10T0.xml serial_port: 5009 - vlans: "26" + vlans: "25" memory: "{{ tor_memory }}" ARISTA10T2: num: 19 filename: 01-ARISTA10T2.xml serial_port: 5025 - vlans: "10" + vlans: "9" memory: "{{ spine_memory }}" ARISTA11T0: num: 20 filename: 01-ARISTA11T0.xml serial_port: 5010 - vlans: "27" + vlans: "26" memory: "{{ tor_memory }}" ARISTA11T2: num: 21 filename: 01-ARISTA11T2.xml serial_port: 5026 - vlans: "11" + vlans: "10" memory: "{{ spine_memory }}" ARISTA12T0: num: 22 filename: 01-ARISTA12T0.xml serial_port: 5011 - vlans: "28" + vlans: "27" memory: "{{ tor_memory }}" ARISTA12T2: num: 23 filename: 01-ARISTA12T2.xml serial_port: 5027 - vlans: "12" + vlans: "11" memory: "{{ spine_memory }}" ARISTA13T0: num: 24 filename: 01-ARISTA13T0.xml serial_port: 5012 - vlans: "29" + vlans: "28" memory: "{{ tor_memory }}" ARISTA13T2: num: 25 filename: 01-ARISTA13T2.xml serial_port: 5028 - vlans: "13" + vlans: "12" memory: "{{ spine_memory }}" ARISTA14T0: num: 26 filename: 01-ARISTA14T0.xml serial_port: 5013 - vlans: "30" + vlans: "29" memory: "{{ tor_memory }}" ARISTA14T2: num: 27 filename: 01-ARISTA14T2.xml serial_port: 5029 - vlans: "14" + vlans: "13" memory: "{{ spine_memory }}" ARISTA15T0: num: 28 filename: 01-ARISTA15T0.xml serial_port: 5014 - vlans: "31" + vlans: "30" memory: "{{ tor_memory }}" ARISTA15T2: num: 29 filename: 01-ARISTA15T2.xml serial_port: 5030 - vlans: "15" + vlans: "14" memory: "{{ spine_memory }}" ARISTA16T0: num: 30 filename: 01-ARISTA16T0.xml serial_port: 5015 - vlans: "32" + vlans: "31" memory: "{{ tor_memory }}" ARISTA16T2: num: 31 filename: 01-ARISTA16T2.xml serial_port: 5031 - vlans: "16" + vlans: "15" memory: "{{ spine_memory }}" vm_2_enabled: true vm_2_vlan_base: 297 -vm_2_injected_ptf: true vm_2_injected_ip: 10.255.0.179/24 VMs_2: ARISTA01T0: num: 0 filename: 03-ARISTA01T0.xml serial_port: 5032 - vlans: "17" + vlans: "16" memory: "{{ tor_memory }}" ARISTA01T2: num: 1 filename: 03-ARISTA01T2.xml serial_port: 5048 - vlans: "1" + vlans: "0" memory: "{{ spine_memory }}" ARISTA02T0: num: 2 filename: 03-ARISTA02T0.xml serial_port: 5033 - vlans: "18" + vlans: "17" memory: "{{ tor_memory }}" ARISTA02T2: num: 3 filename: 03-ARISTA02T2.xml serial_port: 5049 - vlans: "2" + vlans: "1" memory: "{{ spine_memory }}" ARISTA03T0: num: 4 filename: 03-ARISTA03T0.xml serial_port: 5034 - vlans: "19" + vlans: "18" memory: "{{ tor_memory }}" ARISTA03T2: num: 5 filename: 03-ARISTA03T2.xml serial_port: 5050 - vlans: "3" + vlans: "2" memory: "{{ spine_memory }}" ARISTA04T0: num: 6 filename: 03-ARISTA04T0.xml serial_port: 5035 - vlans: "20" + vlans: "19" memory: "{{ tor_memory }}" ARISTA04T2: num: 7 filename: 03-ARISTA04T2.xml serial_port: 5051 - vlans: "4" + vlans: "3" memory: "{{ spine_memory }}" ARISTA05T0: num: 8 filename: 03-ARISTA05T0.xml serial_port: 5036 - vlans: "21" + vlans: "20" memory: "{{ tor_memory }}" ARISTA05T2: num: 9 filename: 03-ARISTA05T2.xml serial_port: 5052 - vlans: "5" + vlans: "4" memory: "{{ spine_memory }}" ARISTA06T0: num: 10 filename: 03-ARISTA06T0.xml serial_port: 5037 - vlans: "22" + vlans: "21" memory: "{{ tor_memory }}" ARISTA06T2: num: 11 filename: 03-ARISTA06T2.xml serial_port: 5053 - vlans: "6" + vlans: "5" memory: "{{ spine_memory }}" ARISTA07T0: num: 12 filename: 03-ARISTA07T0.xml serial_port: 5038 - vlans: "23" + vlans: "22" memory: "{{ tor_memory }}" ARISTA07T2: num: 13 filename: 03-ARISTA07T2.xml serial_port: 5054 - vlans: "7" + vlans: "6" memory: "{{ spine_memory }}" ARISTA08T0: num: 14 filename: 03-ARISTA08T0.xml serial_port: 5039 - vlans: "24" + vlans: "23" memory: "{{ tor_memory }}" ARISTA08T2: num: 15 filename: 03-ARISTA08T2.xml serial_port: 5055 - vlans: "8" + vlans: "7" memory: "{{ spine_memory }}" ARISTA09T0: num: 16 filename: 03-ARISTA09T0.xml serial_port: 5040 - vlans: "25" + vlans: "24" memory: "{{ tor_memory }}" ARISTA09T2: num: 17 filename: 03-ARISTA09T2.xml serial_port: 5056 - vlans: "9" + vlans: "8" memory: "{{ spine_memory }}" ARISTA10T0: num: 18 filename: 03-ARISTA10T0.xml serial_port: 5041 - vlans: "26" + vlans: "25" memory: "{{ tor_memory }}" ARISTA10T2: num: 19 filename: 03-ARISTA10T2.xml serial_port: 5057 - vlans: "10" + vlans: "9" memory: "{{ spine_memory }}" ARISTA11T0: num: 20 filename: 03-ARISTA11T0.xml serial_port: 5042 - vlans: "27" + vlans: "26" memory: "{{ tor_memory }}" ARISTA11T2: num: 21 filename: 03-ARISTA11T2.xml serial_port: 5058 - vlans: "11" + vlans: "10" memory: "{{ spine_memory }}" ARISTA12T0: num: 22 filename: 03-ARISTA12T0.xml serial_port: 5043 - vlans: "28" + vlans: "27" memory: "{{ tor_memory }}" ARISTA12T2: num: 23 filename: 03-ARISTA12T2.xml serial_port: 5059 - vlans: "12" + vlans: "11" memory: "{{ spine_memory }}" ARISTA13T0: num: 24 filename: 03-ARISTA13T0.xml serial_port: 5044 - vlans: "29" + vlans: "28" memory: "{{ tor_memory }}" ARISTA13T2: num: 25 filename: 03-ARISTA13T2.xml serial_port: 5060 - vlans: "13" + vlans: "12" memory: "{{ spine_memory }}" ARISTA14T0: num: 26 filename: 03-ARISTA14T0.xml serial_port: 5045 - vlans: "30" + vlans: "29" memory: "{{ tor_memory }}" ARISTA14T2: num: 27 filename: 03-ARISTA14T2.xml serial_port: 5061 - vlans: "14" + vlans: "13" memory: "{{ spine_memory }}" ARISTA15T0: num: 28 filename: 03-ARISTA15T0.xml serial_port: 5046 - vlans: "31" + vlans: "30" memory: "{{ tor_memory }}" ARISTA15T2: num: 29 filename: 03-ARISTA15T2.xml serial_port: 5062 - vlans: "15" + vlans: "14" memory: "{{ spine_memory }}" ARISTA16T0: num: 30 filename: 03-ARISTA16T0.xml serial_port: 5047 - vlans: "32" + vlans: "31" memory: "{{ tor_memory }}" ARISTA16T2: num: 31 filename: 03-ARISTA16T2.xml serial_port: 5063 - vlans: "16" + vlans: "15" memory: "{{ spine_memory }}" diff --git a/ansible/host_vars/STR-ACS-SERV-02.yml b/ansible/host_vars/STR-ACS-SERV-02.yml index 8a13a072d15..1d6aaa8a60f 100644 --- a/ansible/host_vars/STR-ACS-SERV-02.yml +++ b/ansible/host_vars/STR-ACS-SERV-02.yml @@ -28,398 +28,396 @@ ptf_6_vlan_base: 745 # ??? vm_1_enabled: true vm_1_vlan_base: 457 -vm_1_injected_ptf: true vm_1_injected_ip: 10.255.0.180/24 VMs_1: ARISTA01T0: num: 0 filename: 02-ARISTA01T0.xml serial_port: 5000 - vlans: "17" + vlans: "16" memory: "{{ tor_memory }}" ARISTA01T2: num: 1 filename: 02-ARISTA01T2.xml serial_port: 5016 - vlans: "1" + vlans: "0" memory: "{{ spine_memory }}" ARISTA02T0: num: 2 filename: 02-ARISTA02T0.xml serial_port: 5001 - vlans: "18" + vlans: "17" memory: "{{ tor_memory }}" ARISTA02T2: num: 3 filename: 02-ARISTA02T2.xml serial_port: 5017 - vlans: "2" + vlans: "1" memory: "{{ spine_memory }}" ARISTA03T0: num: 4 filename: 02-ARISTA03T0.xml serial_port: 5002 - vlans: "19" + vlans: "18" memory: "{{ tor_memory }}" ARISTA03T2: num: 5 filename: 02-ARISTA03T2.xml serial_port: 5018 - vlans: "3" + vlans: "2" memory: "{{ spine_memory }}" ARISTA04T0: num: 6 filename: 02-ARISTA04T0.xml serial_port: 5003 - vlans: "20" + vlans: "19" memory: "{{ tor_memory }}" ARISTA04T2: num: 7 filename: 02-ARISTA04T2.xml serial_port: 5019 - vlans: "4" + vlans: "3" memory: "{{ spine_memory }}" ARISTA05T0: num: 8 filename: 02-ARISTA05T0.xml serial_port: 5004 - vlans: "21" + vlans: "20" memory: "{{ tor_memory }}" ARISTA05T2: num: 9 filename: 02-ARISTA05T2.xml serial_port: 5020 - vlans: "5" + vlans: "4" memory: "{{ spine_memory }}" ARISTA06T0: num: 10 filename: 02-ARISTA06T0.xml serial_port: 5005 - vlans: "22" + vlans: "21" memory: "{{ tor_memory }}" ARISTA06T2: num: 11 filename: 02-ARISTA06T2.xml serial_port: 5021 - vlans: "6" + vlans: "5" memory: "{{ spine_memory }}" ARISTA07T0: num: 12 filename: 02-ARISTA07T0.xml serial_port: 5006 - vlans: "23" + vlans: "22" memory: "{{ tor_memory }}" ARISTA07T2: num: 13 filename: 02-ARISTA07T2.xml serial_port: 5022 - vlans: "7" + vlans: "6" memory: "{{ spine_memory }}" ARISTA08T0: num: 14 filename: 02-ARISTA08T0.xml serial_port: 5007 - vlans: "24" + vlans: "23" memory: "{{ tor_memory }}" ARISTA08T2: num: 15 filename: 02-ARISTA08T2.xml serial_port: 5023 - vlans: "8" + vlans: "7" memory: "{{ spine_memory }}" ARISTA09T0: num: 16 filename: 02-ARISTA09T0.xml serial_port: 5008 - vlans: "25" + vlans: "24" memory: "{{ tor_memory }}" ARISTA09T2: num: 17 filename: 02-ARISTA09T2.xml serial_port: 5024 - vlans: "9" + vlans: "8" memory: "{{ spine_memory }}" ARISTA10T0: num: 18 filename: 02-ARISTA10T0.xml serial_port: 5009 - vlans: "26" + vlans: "25" memory: "{{ tor_memory }}" ARISTA10T2: num: 19 filename: 02-ARISTA10T2.xml serial_port: 5025 - vlans: "10" + vlans: "9" memory: "{{ spine_memory }}" ARISTA11T0: num: 20 filename: 02-ARISTA11T0.xml serial_port: 5010 - vlans: "27" + vlans: "26" memory: "{{ tor_memory }}" ARISTA11T2: num: 21 filename: 02-ARISTA11T2.xml serial_port: 5026 - vlans: "11" + vlans: "10" memory: "{{ spine_memory }}" ARISTA12T0: num: 22 filename: 02-ARISTA12T0.xml serial_port: 5011 - vlans: "28" + vlans: "27" memory: "{{ tor_memory }}" ARISTA12T2: num: 23 filename: 02-ARISTA12T2.xml serial_port: 5027 - vlans: "12" + vlans: "11" memory: "{{ spine_memory }}" ARISTA13T0: num: 24 filename: 02-ARISTA13T0.xml serial_port: 5012 - vlans: "29" + vlans: "28" memory: "{{ tor_memory }}" ARISTA13T2: num: 25 filename: 02-ARISTA13T2.xml serial_port: 5028 - vlans: "13" + vlans: "12" memory: "{{ spine_memory }}" ARISTA14T0: num: 26 filename: 02-ARISTA14T0.xml serial_port: 5013 - vlans: "30" + vlans: "29" memory: "{{ tor_memory }}" ARISTA14T2: num: 27 filename: 02-ARISTA14T2.xml serial_port: 5029 - vlans: "14" + vlans: "13" memory: "{{ spine_memory }}" ARISTA15T0: num: 28 filename: 02-ARISTA15T0.xml serial_port: 5014 - vlans: "31" + vlans: "30" memory: "{{ tor_memory }}" ARISTA15T2: num: 29 filename: 02-ARISTA15T2.xml serial_port: 5030 - vlans: "15" + vlans: "14" memory: "{{ spine_memory }}" ARISTA16T0: num: 30 filename: 02-ARISTA16T0.xml serial_port: 5015 - vlans: "32" + vlans: "31" memory: "{{ tor_memory }}" ARISTA16T2: num: 31 filename: 02-ARISTA16T2.xml serial_port: 5031 - vlans: "16" + vlans: "15" memory: "{{ spine_memory }}" vm_2_enabled: true vm_2_vlan_base: 777 -vm_2_injected_ptf: true vm_2_injected_ip: 10.255.0.181/24 VMs_2: ARISTA01T0: num: 0 filename: 04-ARISTA01T0.xml serial_port: 5032 - vlans: "17" + vlans: "16" memory: "{{ tor_memory }}" ARISTA01T2: num: 1 filename: 04-ARISTA01T2.xml serial_port: 5048 - vlans: "1" + vlans: "0" memory: "{{ spine_memory }}" ARISTA02T0: num: 2 filename: 04-ARISTA02T0.xml serial_port: 5033 - vlans: "18" + vlans: "17" memory: "{{ tor_memory }}" ARISTA02T2: num: 3 filename: 04-ARISTA02T2.xml serial_port: 5049 - vlans: "2" + vlans: "1" memory: "{{ spine_memory }}" ARISTA03T0: num: 4 filename: 04-ARISTA03T0.xml serial_port: 5034 - vlans: "19" + vlans: "18" memory: "{{ tor_memory }}" ARISTA03T2: num: 5 filename: 04-ARISTA03T2.xml serial_port: 5050 - vlans: "3" + vlans: "2" memory: "{{ spine_memory }}" ARISTA04T0: num: 6 filename: 04-ARISTA04T0.xml serial_port: 5035 - vlans: "20" + vlans: "19" memory: "{{ tor_memory }}" ARISTA04T2: num: 7 filename: 04-ARISTA04T2.xml serial_port: 5051 - vlans: "4" + vlans: "3" memory: "{{ spine_memory }}" ARISTA05T0: num: 8 filename: 04-ARISTA05T0.xml serial_port: 5036 - vlans: "21" + vlans: "20" memory: "{{ tor_memory }}" ARISTA05T2: num: 9 filename: 04-ARISTA05T2.xml serial_port: 5052 - vlans: "5" + vlans: "4" memory: "{{ spine_memory }}" ARISTA06T0: num: 10 filename: 04-ARISTA06T0.xml serial_port: 5037 - vlans: "22" + vlans: "21" memory: "{{ tor_memory }}" ARISTA06T2: num: 11 filename: 04-ARISTA06T2.xml serial_port: 5053 - vlans: "6" + vlans: "5" memory: "{{ spine_memory }}" ARISTA07T0: num: 12 filename: 04-ARISTA07T0.xml serial_port: 5038 - vlans: "23" + vlans: "22" memory: "{{ tor_memory }}" ARISTA07T2: num: 13 filename: 04-ARISTA07T2.xml serial_port: 5054 - vlans: "7" + vlans: "6" memory: "{{ spine_memory }}" ARISTA08T0: num: 14 filename: 04-ARISTA08T0.xml serial_port: 5039 - vlans: "24" + vlans: "23" memory: "{{ tor_memory }}" ARISTA08T2: num: 15 filename: 04-ARISTA08T2.xml serial_port: 5055 - vlans: "8" + vlans: "7" memory: "{{ spine_memory }}" ARISTA09T0: num: 16 filename: 04-ARISTA09T0.xml serial_port: 5040 - vlans: "25" + vlans: "24" memory: "{{ tor_memory }}" ARISTA09T2: num: 17 filename: 04-ARISTA09T2.xml serial_port: 5056 - vlans: "9" + vlans: "8" memory: "{{ spine_memory }}" ARISTA10T0: num: 18 filename: 04-ARISTA10T0.xml serial_port: 5041 - vlans: "26" + vlans: "25" memory: "{{ tor_memory }}" ARISTA10T2: num: 19 filename: 04-ARISTA10T2.xml serial_port: 5057 - vlans: "10" + vlans: "9" memory: "{{ spine_memory }}" ARISTA11T0: num: 20 filename: 04-ARISTA11T0.xml serial_port: 5042 - vlans: "27" + vlans: "26" memory: "{{ tor_memory }}" ARISTA11T2: num: 21 filename: 04-ARISTA11T2.xml serial_port: 5058 - vlans: "11" + vlans: "10" memory: "{{ spine_memory }}" ARISTA12T0: num: 22 filename: 04-ARISTA12T0.xml serial_port: 5043 - vlans: "28" + vlans: "27" memory: "{{ tor_memory }}" ARISTA12T2: num: 23 filename: 04-ARISTA12T2.xml serial_port: 5059 - vlans: "12" + vlans: "11" memory: "{{ spine_memory }}" ARISTA13T0: num: 24 filename: 04-ARISTA13T0.xml serial_port: 5044 - vlans: "29" + vlans: "28" memory: "{{ tor_memory }}" ARISTA13T2: num: 25 filename: 04-ARISTA13T2.xml serial_port: 5060 - vlans: "13" + vlans: "12" memory: "{{ spine_memory }}" ARISTA14T0: num: 26 filename: 04-ARISTA14T0.xml serial_port: 5045 - vlans: "30" + vlans: "29" memory: "{{ tor_memory }}" ARISTA14T2: num: 27 filename: 04-ARISTA14T2.xml serial_port: 5061 - vlans: "14" + vlans: "13" memory: "{{ spine_memory }}" ARISTA15T0: num: 28 filename: 04-ARISTA15T0.xml serial_port: 5046 - vlans: "31" + vlans: "30" memory: "{{ tor_memory }}" ARISTA15T2: num: 29 filename: 04-ARISTA15T2.xml serial_port: 5062 - vlans: "15" + vlans: "14" memory: "{{ spine_memory }}" ARISTA16T0: num: 30 filename: 04-ARISTA16T0.xml serial_port: 5047 - vlans: "32" + vlans: "31" memory: "{{ tor_memory }}" ARISTA16T2: num: 31 filename: 04-ARISTA16T2.xml serial_port: 5063 - vlans: "16" + vlans: "15" memory: "{{ spine_memory }}" diff --git a/ansible/renumber_vm_set.yml b/ansible/renumber_vm_set.yml index f08f8db040d..d366def14b3 100644 --- a/ansible/renumber_vm_set.yml +++ b/ansible/renumber_vm_set.yml @@ -14,6 +14,6 @@ - vars/azure_storage.yml pre_tasks: roles: - - { role: vm_set, action: 'renumber', id: 1, VMs: "{{ VMs_1 }}", vlan_base: "{{ vm_1_vlan_base }}", vm_injected_ptf: "{{ vm_1_injected_ptf }}", when: vm_set_1 and vm_1_enabled } - - { role: vm_set, action: 'renumber', id: 2, VMs: "{{ VMs_2 }}", vlan_base: "{{ vm_2_vlan_base }}", vm_injected_ptf: "{{ vm_2_injected_ptf }}", when: vm_set_2 and vm_2_enabled } + - { role: vm_set, action: 'renumber', id: 1, VMs: "{{ VMs_1 }}", vlan_base: "{{ vm_1_vlan_base }}", when: vm_set_1 and vm_1_enabled } + - { role: vm_set, action: 'renumber', id: 2, VMs: "{{ VMs_2 }}", vlan_base: "{{ vm_2_vlan_base }}", when: vm_set_2 and vm_2_enabled } diff --git a/ansible/roles/vm_set/library/vm_network.py b/ansible/roles/vm_set/library/vm_network.py index 253caeb1873..5fdddb28d83 100644 --- a/ansible/roles/vm_set/library/vm_network.py +++ b/ansible/roles/vm_set/library/vm_network.py @@ -136,8 +136,8 @@ def check_vlans(self, vlans_str, vlans): raise Exception("Wrong vlans parameter: %s" % vlans_str) for vlan in vlans: - if int(vlan) > 32: # FIXME: -1 - raise Exception("Vlan offset %s supposed to be not more then 32: %s" % (vlan, vlans_str)) + if int(vlan) > 31: + raise Exception("Vlan offset %s supposed to be not more then 31: %s" % (vlan, vlans_str)) return @@ -148,9 +148,9 @@ def bind(self): vlans = [int(vlan) for vlan in vlans_str.split(',')] self.check_vlans(vlans_str, vlans) for vlan_num, vlan in enumerate(vlans): - vlan_id = self.vlan_base + vlan - 1 # FIXME: finally change the VMs in host vars with right offsets + vlan_id = self.vlan_base + vlan vlan_iface = "%s.%d" % (self.ext_iface, vlan_id) - injected_iface = INJECTED_INTERFACES_TEMPLATE % (self.vm_set_id, (vlan - 1)) # FIXME: this -1 thing + injected_iface = INJECTED_INTERFACES_TEMPLATE % (self.vm_set_id, vlan) port0_bridge = OVS_BRIDGE_TEMPLATE % (self.vm_set_id, int(vm_num), vlan_num) self.create_phys_vlan(vlan_iface, vlan_id) self.bind_phys_vlan(port0_bridge, vlan_iface, injected_iface) @@ -199,9 +199,9 @@ def unbind(self): vlans = [int(vlan) for vlan in vlans_str.split(',')] self.check_vlans(vlans_str, vlans) for vlan_num, vlan in enumerate(vlans): - vlan_id = self.vlan_base + vlan - 1 # FIXME: finally change the VMs in host vars with right offsets + vlan_id = self.vlan_base + vlan vlan_iface = "%s.%d" % (self.ext_iface, vlan_id) - injected_iface = INJECTED_INTERFACES_TEMPLATE % (self.vm_set_id, (vlan - 1)) # FIXME: fix this -1 thing + injected_iface = INJECTED_INTERFACES_TEMPLATE % (self.vm_set_id, vlan) port0_bridge = OVS_BRIDGE_TEMPLATE % (self.vm_set_id, int(vm_num), vlan_num) self.unbind_phys_vlan(port0_bridge, vlan_iface) self.destroy_phys_vlan(vlan_iface) diff --git a/ansible/roles/vm_set/tasks/start.yml b/ansible/roles/vm_set/tasks/start.yml index 2e815a83683..e3105ecc6db 100644 --- a/ansible/roles/vm_set/tasks/start.yml +++ b/ansible/roles/vm_set/tasks/start.yml @@ -32,7 +32,6 @@ net: none detach: True cap_add: NET_ADMIN - when: vm_injected_ptf - name: Create injected network for the docker container. vm set {{ id }} ptf_network_inj: @@ -43,7 +42,6 @@ mgmt_ip_addr: "{{ vm_injected_ip }}" mgmt_ip_gw: "{{ mgmt_gw }}" mgmt_bridge: "{{ mgmt_bridge }}" - when: vm_injected_ptf - name: Create VM set network. vm set {{ id }} vm_network: diff --git a/ansible/start_vm_sets.yml b/ansible/start_vm_sets.yml index 40c40956bdc..6271249e458 100644 --- a/ansible/start_vm_sets.yml +++ b/ansible/start_vm_sets.yml @@ -39,8 +39,8 @@ vm_set_2: true when: not (vm_set_1 or vm_set_2) roles: - - { role: vm_set, action: 'start', id: 1, VMs: "{{ VMs_1 }}", vlan_base: "{{ vm_1_vlan_base }}", vm_injected_ptf: "{{ vm_1_injected_ptf }}", vm_injected_ip: "{{ vm_1_injected_ip }}", when: vm_set_1 and vm_1_enabled } - - { role: vm_set, action: 'start', id: 2, VMs: "{{ VMs_2 }}", vlan_base: "{{ vm_2_vlan_base }}", vm_injected_ptf: "{{ vm_2_injected_ptf }}", vm_injected_ip: "{{ vm_2_injected_ip }}", when: vm_set_2 and vm_2_enabled } + - { role: vm_set, action: 'start', id: 1, VMs: "{{ VMs_1 }}", vlan_base: "{{ vm_1_vlan_base }}", vm_injected_ip: "{{ vm_1_injected_ip }}", when: vm_set_1 and vm_1_enabled } + - { role: vm_set, action: 'start', id: 2, VMs: "{{ VMs_2 }}", vlan_base: "{{ vm_2_vlan_base }}", vm_injected_ip: "{{ vm_2_injected_ip }}", when: vm_set_2 and vm_2_enabled } - hosts: servers:&eos gather_facts: no @@ -54,5 +54,6 @@ vm_set_2: true when: not (vm_set_1 or vm_set_2) roles: - - { role: eos, when: vm_set_1 or vm_set_2 } + - { role: eos, when: vm_set_1 and "vm_set_1" in group_names } + - { role: eos, when: vm_set_2 and "vm_set_2" in group_names } diff --git a/ansible/stop_vm_sets.yml b/ansible/stop_vm_sets.yml index ddc0dbe447e..148ed9d144d 100644 --- a/ansible/stop_vm_sets.yml +++ b/ansible/stop_vm_sets.yml @@ -27,6 +27,6 @@ vm_set_2: true when: not (vm_set_1 or vm_set_2) roles: - - { role: vm_set, action: 'stop', id: 1, VMs: "{{ VMs_1 }}", vlan_base: "{{ vm_1_vlan_base }}", vm_injected_ptf: "{{ vm_1_injected_ptf }}", when: vm_set_1 and vm_1_enabled } - - { role: vm_set, action: 'stop', id: 2, VMs: "{{ VMs_2 }}", vlan_base: "{{ vm_2_vlan_base }}", vm_injected_ptf: "{{ vm_2_injected_ptf }}", when: vm_set_2 and vm_2_enabled } + - { role: vm_set, action: 'stop', id: 1, VMs: "{{ VMs_1 }}", vlan_base: "{{ vm_1_vlan_base }}", when: vm_set_1 and vm_1_enabled } + - { role: vm_set, action: 'stop', id: 2, VMs: "{{ VMs_2 }}", vlan_base: "{{ vm_2_vlan_base }}", when: vm_set_2 and vm_2_enabled } diff --git a/ansible/veos b/ansible/veos index 34948917edb..81fe8561589 100644 --- a/ansible/veos +++ b/ansible/veos @@ -185,6 +185,18 @@ tor nhipv4=10.10.246.100 nhipv6=FC0A::C9 +[vm_set_1:children] +tor_1 +tor_2 +spine_1 +spine_2 + +[vm_set_2:children] +tor_3 +tor_4 +spine_3 +spine_4 + ## The groups below are helper to limit running playbooks to server_1 or server_2 only [server_1:children] vm_host_1