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
130 changes: 64 additions & 66 deletions ansible/host_vars/STR-ACS-SERV-01.yml

Large diffs are not rendered by default.

130 changes: 64 additions & 66 deletions ansible/host_vars/STR-ACS-SERV-02.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ansible/renumber_vm_set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

12 changes: 6 additions & 6 deletions ansible/roles/vm_set/library/vm_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions ansible/roles/vm_set/tasks/start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions ansible/start_vm_sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

4 changes: 2 additions & 2 deletions ansible/stop_vm_sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

12 changes: 12 additions & 0 deletions ansible/veos
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down