From f8c31589066ef70ba749ba694bf4dea732290b24 Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Tue, 18 Apr 2017 10:04:48 +0200 Subject: xci: Fix network configuration This change - sets static IP for controller nodes' vxlan bridges as stated in osa documentation: compute and network hosts must have an IP [1] - configures IPs for controller nodes' vxlan bridges. - removes the additional vlan ip from compute nodes as it seems to be there for all in one. - removes glean.rules as they mess with the network configuration once the network changes are applied. - removes the contents of interfaces.d as osa populates config for lxc bridges and includes this config in interfaces file thus all the files in interfaces.d must be removed in order not to mess with the network configuration. - updates modules appropriately. [1] https://docs.openstack.org/project-deploy-guide/openstack-ansible/draft/app-config-prod.html Change-Id: I84d5f07216c8d0246da06080fb0ed19f917d6637 Signed-off-by: Fatih Degirmenci --- xci/file/ha/configure-targethosts.yml | 8 ++---- xci/file/ha/flavor-vars.yml | 26 ++++++++++--------- xci/file/mini/configure-targethosts.yml | 8 ++---- xci/file/mini/flavor-vars.yml | 9 ++++--- xci/file/modules | 8 ------ xci/file/noha/configure-targethosts.yml | 8 ++---- xci/file/noha/flavor-vars.yml | 12 ++++----- .../roles/configure-network/tasks/main.yml | 30 +++++++++++++++++----- xci/template/compute.interface.j2 | 19 +++----------- xci/template/controller.interface.j2 | 15 +++-------- xci/template/opnfv.interface.j2 | 15 +++-------- 11 files changed, 66 insertions(+), 92 deletions(-) delete mode 100644 xci/file/modules (limited to 'xci') diff --git a/xci/file/ha/configure-targethosts.yml b/xci/file/ha/configure-targethosts.yml index 6dc147f3..cdbe390b 100644 --- a/xci/file/ha/configure-targethosts.yml +++ b/xci/file/ha/configure-targethosts.yml @@ -6,10 +6,6 @@ copy: src: ../file/authorized_keys dest: /root/.ssh/authorized_keys - - name: configure modules - copy: - src: ../file/modules - dest: /etc/modules - hosts: controller remote_user: root @@ -18,7 +14,7 @@ - ../var/flavor-vars.yml roles: # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros - - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } - hosts: compute remote_user: root @@ -27,7 +23,7 @@ - ../var/flavor-vars.yml roles: # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros - - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } - hosts: compute01 remote_user: root diff --git a/xci/file/ha/flavor-vars.yml b/xci/file/ha/flavor-vars.yml index 3cd1d624..167502c9 100644 --- a/xci/file/ha/flavor-vars.yml +++ b/xci/file/ha/flavor-vars.yml @@ -1,37 +1,39 @@ --- host_info: { 'opnfv': { - 'MGMT_IP': '172.29.236.10', 'VLAN_IP': '192.168.122.2', + 'MGMT_IP': '172.29.236.10', + 'VXLAN_IP': '172.29.240.10', 'STORAGE_IP': '172.29.244.10' }, 'controller00': { - 'MGMT_IP': '172.29.236.11', 'VLAN_IP': '192.168.122.3', + 'MGMT_IP': '172.29.236.11', + 'VXLAN_IP': '172.29.240.11', 'STORAGE_IP': '172.29.244.11' }, 'controller01': { - 'MGMT_IP': '172.29.236.12', 'VLAN_IP': '192.168.122.4', + 'MGMT_IP': '172.29.236.12', + 'VXLAN_IP': '172.29.240.12', 'STORAGE_IP': '172.29.244.12' }, 'controller02': { - 'MGMT_IP': '172.29.236.13', 'VLAN_IP': '192.168.122.5', + 'MGMT_IP': '172.29.236.13', + 'VXLAN_IP': '172.29.240.13', 'STORAGE_IP': '172.29.244.13' }, 'compute00': { - 'MGMT_IP': '172.29.236.14', 'VLAN_IP': '192.168.122.6', - 'STORAGE_IP': '172.29.244.14', - 'VLAN_IP_SECOND': '173.29.241.1', - 'VXLAN_IP': '172.29.240.14' + 'MGMT_IP': '172.29.236.14', + 'VXLAN_IP': '172.29.240.14', + 'STORAGE_IP': '172.29.244.14' }, 'compute01': { - 'MGMT_IP': '172.29.236.15', 'VLAN_IP': '192.168.122.7', - 'STORAGE_IP': '172.29.244.15', - 'VLAN_IP_SECOND': '173.29.241.2', - 'VXLAN_IP': '172.29.240.15' + 'MGMT_IP': '172.29.236.15', + 'VXLAN_IP': '172.29.240.15', + 'STORAGE_IP': '172.29.244.15' } } diff --git a/xci/file/mini/configure-targethosts.yml b/xci/file/mini/configure-targethosts.yml index 395f44a6..8daf7d44 100644 --- a/xci/file/mini/configure-targethosts.yml +++ b/xci/file/mini/configure-targethosts.yml @@ -6,10 +6,6 @@ copy: src: ../file/authorized_keys dest: /root/.ssh/authorized_keys - - name: configure modules - copy: - src: ../file/modules - dest: /etc/modules - hosts: controller remote_user: root @@ -18,7 +14,7 @@ - ../var/flavor-vars.yml roles: # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros - - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } - hosts: compute remote_user: root @@ -27,6 +23,6 @@ - ../var/flavor-vars.yml roles: # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros - - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } # TODO: this role is for configuring NFS on xenial and adjustment needed for other distros - role: configure-nfs diff --git a/xci/file/mini/flavor-vars.yml b/xci/file/mini/flavor-vars.yml index 01fba712..0d446ba2 100644 --- a/xci/file/mini/flavor-vars.yml +++ b/xci/file/mini/flavor-vars.yml @@ -1,19 +1,20 @@ --- host_info: { 'opnfv': { - 'MGMT_IP': '172.29.236.10', 'VLAN_IP': '192.168.122.2', + 'MGMT_IP': '172.29.236.10', + 'VXLAN_IP': '172.29.240.10', 'STORAGE_IP': '172.29.244.10' }, 'controller00': { - 'MGMT_IP': '172.29.236.11', 'VLAN_IP': '192.168.122.3', + 'MGMT_IP': '172.29.236.11', + 'VXLAN_IP': '172.29.240.11', 'STORAGE_IP': '172.29.244.11' }, 'compute00': { - 'MGMT_IP': '172.29.236.12', 'VLAN_IP': '192.168.122.4', - 'VLAN_IP_SECOND': '173.29.241.1', + 'MGMT_IP': '172.29.236.12', 'VXLAN_IP': '172.29.240.12', 'STORAGE_IP': '172.29.244.12' }, diff --git a/xci/file/modules b/xci/file/modules deleted file mode 100644 index 60a517f1..00000000 --- a/xci/file/modules +++ /dev/null @@ -1,8 +0,0 @@ -# /etc/modules: kernel modules to load at boot time. -# -# This file contains the names of kernel modules that should be loaded -# at boot time, one per line. Lines beginning with "#" are ignored. -# Parameters can be specified after the module name. - -bonding -8021q diff --git a/xci/file/noha/configure-targethosts.yml b/xci/file/noha/configure-targethosts.yml index 6dc147f3..cdbe390b 100644 --- a/xci/file/noha/configure-targethosts.yml +++ b/xci/file/noha/configure-targethosts.yml @@ -6,10 +6,6 @@ copy: src: ../file/authorized_keys dest: /root/.ssh/authorized_keys - - name: configure modules - copy: - src: ../file/modules - dest: /etc/modules - hosts: controller remote_user: root @@ -18,7 +14,7 @@ - ../var/flavor-vars.yml roles: # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros - - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } - hosts: compute remote_user: root @@ -27,7 +23,7 @@ - ../var/flavor-vars.yml roles: # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros - - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } - hosts: compute01 remote_user: root diff --git a/xci/file/noha/flavor-vars.yml b/xci/file/noha/flavor-vars.yml index 7f52d343..3c69a34b 100644 --- a/xci/file/noha/flavor-vars.yml +++ b/xci/file/noha/flavor-vars.yml @@ -1,26 +1,26 @@ --- host_info: { 'opnfv': { - 'MGMT_IP': '172.29.236.10', 'VLAN_IP': '192.168.122.2', + 'MGMT_IP': '172.29.236.10', + 'VXLAN_IP': '172.29.240.10', 'STORAGE_IP': '172.29.244.10' }, 'controller00': { - 'MGMT_IP': '172.29.236.11', 'VLAN_IP': '192.168.122.3', + 'MGMT_IP': '172.29.236.11', + 'VXLAN_IP': '172.29.240.11', 'STORAGE_IP': '172.29.244.11' }, 'compute00': { - 'MGMT_IP': '172.29.236.12', 'VLAN_IP': '192.168.122.4', - 'VLAN_IP_SECOND': '173.29.241.1', + 'MGMT_IP': '172.29.236.12', 'VXLAN_IP': '172.29.240.12', 'STORAGE_IP': '172.29.244.12' }, 'compute01': { - 'MGMT_IP': '172.29.236.13', 'VLAN_IP': '192.168.122.5', - 'VLAN_IP_SECOND': '173.29.241.2', + 'MGMT_IP': '172.29.236.13', 'VXLAN_IP': '172.29.240.13', 'STORAGE_IP': '172.29.244.13' } diff --git a/xci/playbooks/roles/configure-network/tasks/main.yml b/xci/playbooks/roles/configure-network/tasks/main.yml index 8bc84822..aafadf71 100644 --- a/xci/playbooks/roles/configure-network/tasks/main.yml +++ b/xci/playbooks/roles/configure-network/tasks/main.yml @@ -8,9 +8,27 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## # TODO: this role needs to be adjusted for different distros -- name: configure network for {{ ansible_os_family }} on interface {{ interface }} - template: - src: "{{ src }}" - dest: "{{ dest }}" -- name: restart ubuntu xenial network service - shell: "/sbin/ifconfig {{ interface }} 0 &&/sbin/ifdown -a && /sbin/ifup -a" +- block: + - name: configure modules + lineinfile: + dest: /etc/modules + state: present + create: yes + line: "8021q" + - name: add modules + modprobe: + name: 8021q + state: present + - name: ensure glean rules are removed + file: + path: "/etc/udev/rules.d/99-glean.rules" + state: absent + - name: ensure interfaces.d folder is empty + shell: "/bin/rm -rf /etc/network/interfaces.d/*" + - name: ensure interfaces file is updated + template: + src: "{{ src }}" + dest: "{{ dest }}" + - name: restart network service + shell: "/sbin/ifconfig {{ interface }} 0 && /sbin/ifdown -a && /sbin/ifup -a" + when: ansible_distribution_release == "xenial" diff --git a/xci/template/compute.interface.j2 b/xci/template/compute.interface.j2 index 0c5147c4..094544c3 100644 --- a/xci/template/compute.interface.j2 +++ b/xci/template/compute.interface.j2 @@ -1,11 +1,7 @@ -# This file describes the network interfaces available on your system -# and how to activate them. For more information, see interfaces(5). - # The loopback network interface auto lo iface lo inet loopback - # Physical interface auto {{ interface }} iface {{ interface }} inet manual @@ -20,7 +16,7 @@ auto {{ interface }}.30 iface {{ interface }}.30 inet manual vlan-raw-device {{ interface }} -# Storage network VLAN interface (optional) +# Storage network VLAN interface auto {{ interface }}.20 iface {{ interface }}.20 inet manual vlan-raw-device {{ interface }} @@ -55,6 +51,7 @@ iface br-vlan inet static address {{host_info[inventory_hostname].VLAN_IP}} netmask 255.255.255.0 gateway 192.168.122.1 + dns-nameserver 8.8.8.8 8.8.4.4 offload-sg off # Create veth pair, don't bomb if already exists pre-up ip link add br-vlan-veth type veth peer name eth12 || true @@ -65,17 +62,7 @@ iface br-vlan inet static post-down ip link del br-vlan-veth || true bridge_ports br-vlan-veth -# Add an additional address to br-vlan -iface br-vlan inet static - # Flat network default gateway - # -- This needs to exist somewhere for network reachability - # -- from the router namespace for floating IP paths. - # -- Putting this here is primarily for tempest to work. - address {{host_info[inventory_hostname].VLAN_IP_SECOND}} - netmask 255.255.252.0 - dns-nameserver 8.8.8.8 8.8.4.4 - -# compute1 Storage bridge +# OpenStack Storage bridge auto br-storage iface br-storage inet static bridge_stp off diff --git a/xci/template/controller.interface.j2 b/xci/template/controller.interface.j2 index fbaa8b8d..638e78e1 100644 --- a/xci/template/controller.interface.j2 +++ b/xci/template/controller.interface.j2 @@ -1,6 +1,3 @@ -# This file describes the network interfaces available on your system -# and how to activate them. For more information, see interfaces(5). - # The loopback network interface auto lo iface lo inet loopback @@ -35,18 +32,14 @@ iface br-mgmt inet static netmask 255.255.252.0 # OpenStack Networking VXLAN (tunnel/overlay) bridge -# -# Only the COMPUTE and NETWORK nodes must have an IP address -# on this bridge. When used by infrastructure nodes, the -# IP addresses are assigned to containers which use this -# bridge. -# auto br-vxlan -iface br-vxlan inet manual +iface br-vxlan inet static bridge_stp off bridge_waitport 0 bridge_fd 0 bridge_ports {{ interface }}.30 + address {{host_info[inventory_hostname].VXLAN_IP}} + netmask 255.255.252.0 # OpenStack Networking VLAN bridge auto br-vlan @@ -60,7 +53,7 @@ iface br-vlan inet static gateway 192.168.122.1 dns-nameserver 8.8.8.8 8.8.4.4 -# compute1 Storage bridge +# OpenStack Storage bridge auto br-storage iface br-storage inet static bridge_stp off diff --git a/xci/template/opnfv.interface.j2 b/xci/template/opnfv.interface.j2 index fbaa8b8d..e9f8649c 100644 --- a/xci/template/opnfv.interface.j2 +++ b/xci/template/opnfv.interface.j2 @@ -1,6 +1,3 @@ -# This file describes the network interfaces available on your system -# and how to activate them. For more information, see interfaces(5). - # The loopback network interface auto lo iface lo inet loopback @@ -35,18 +32,14 @@ iface br-mgmt inet static netmask 255.255.252.0 # OpenStack Networking VXLAN (tunnel/overlay) bridge -# -# Only the COMPUTE and NETWORK nodes must have an IP address -# on this bridge. When used by infrastructure nodes, the -# IP addresses are assigned to containers which use this -# bridge. -# auto br-vxlan -iface br-vxlan inet manual +iface br-vxlan inet static bridge_stp off bridge_waitport 0 bridge_fd 0 bridge_ports {{ interface }}.30 + address {{ host_info[inventory_hostname].VXLAN_IP }} + netmask 255.255.252.0 # OpenStack Networking VLAN bridge auto br-vlan @@ -60,7 +53,7 @@ iface br-vlan inet static gateway 192.168.122.1 dns-nameserver 8.8.8.8 8.8.4.4 -# compute1 Storage bridge +# OpenStack Storage bridge auto br-storage iface br-storage inet static bridge_stp off -- cgit 1.2.3-korg