From 38de9ff18e44e5c3c1393c060481fbbb27543704 Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Tue, 19 Jul 2016 13:17:17 -0400 Subject: migrating to proposed common network settings file - proposed in genesis https://wiki.opnfv.org/display/genesis/Common+Network+Settings - This patch updates the network_settings files in the config/network dir and updates the associated bash, python and python tests relative to the new yaml structure and nomenclature used in the proposed settings file JIRA: APEX-262 Change-Id: Ib0dc9d0f21465b38f2a53cff20f71fb9230bfc48 Signed-off-by: Dan Radez --- build/Makefile | 3 --- build/nics-template.yaml.jinja2 | 36 ++++++++++++++++++------------------ build/undercloud.sh | 2 +- 3 files changed, 19 insertions(+), 22 deletions(-) (limited to 'build') diff --git a/build/Makefile b/build/Makefile index 7374215e..479d09bc 100644 --- a/build/Makefile +++ b/build/Makefile @@ -19,9 +19,6 @@ export RPMODL = $(shell pwd)/noarch/opnfv-apex-$(RPMVERS)-$(shell echo ${RELEASE export RPMONO = $(shell pwd)/noarch/opnfv-apex-onos-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMSFC = $(shell pwd)/noarch/opnfv-apex-opendaylight-sfc-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm -all_networks="admin_network private_network storage_network external_network api_network" - - .PHONY: all all: iso diff --git a/build/nics-template.yaml.jinja2 b/build/nics-template.yaml.jinja2 index 0680a26f..ee830114 100644 --- a/build/nics-template.yaml.jinja2 +++ b/build/nics-template.yaml.jinja2 @@ -85,16 +85,16 @@ resources: os_net_config: network_config: - - {%- if vlans['private_network'] is number or vlans['storage_network'] is number or vlans['api_network'] is number or vlans['public_network'] is number %} + {%- if nets['tenant']['nic_mapping'][role]['vlan'] is number or nets['storage']['nic_mapping'][role]['vlan'] is number or nets['api']['nic_mapping'][role]['vlan'] is number or nets['external'][0]['nic_mapping'][role]['vlan'] is number %} type: ovs_bridge name: {get_input: bridge_name} members: - type: interface - name: {{ nics[role]['admin_network'] }} + name: {{ nets[role]['admin']['members'][0] }} # force the MAC address of the bridge to this interface primary: true - {%- if 'public_network' in enabled_networks and vlans['public_network'] is number %} + {%- if nets['external'][0]['enabled'] and nets['external'][0]['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: ExternalNetworkVlanID} @@ -106,7 +106,7 @@ resources: default: true next_hop: {get_param: ExternalInterfaceDefaultRoute} {%- endif %} - {%- if 'private_network' in enabled_networks and vlans['private_network'] is number %} + {%- if nets['tenant']['enabled'] and nets['tenant']['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: TenantNetworkVlanID} @@ -114,7 +114,7 @@ resources: - ip_netmask: {get_param: TenantIpSubnet} {%- endif %} - {%- if 'storage_network' in enabled_networks and vlans['storage_network'] is number %} + {%- if nets['storage']['enabled'] and nets['storage']['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: StorageNetworkVlanID} @@ -122,7 +122,7 @@ resources: - ip_netmask: {get_param: StorageIpSubnet} {%- endif %} - {%- if 'api_network' in enabled_networks and vlans['api_network'] is number %} + {%- if nets['api']['enabled'] and nets['api']['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: InternalApiNetworkVlanID} @@ -132,7 +132,7 @@ resources: {%- endif %} {%- else %} type: interface - name: {{ nics[role]['admin_network'] }} + name: {{ nets['admin']['nic_mapping'][role]['members'][0] }} {%- endif %} use_dhcp: false dns_servers: {get_param: DnsServers} @@ -153,7 +153,7 @@ resources: next_hop: {get_param: ControlPlaneDefaultRoute} {%- endif %} - {%- if 'private_network' in enabled_networks and vlans['private_network'] == 'native' %} + {%- if nets['tenant']['enabled'] and nets['tenant']['nic_mapping'][role]['vlan'] == 'native' %} {%- if ovs_dpdk_bridge == 'br-phy' and role == 'compute' %} - type: ovs_bridge @@ -165,7 +165,7 @@ resources: members: - type: interface - name: {{ nics[role]['private_network'] }} + name: {{ nets['tenant']['nic_mapping'][role]['members'][0] }} # force the MAC address of the bridge to this interface primary: true - @@ -175,17 +175,17 @@ resources: {%- else %} - type: interface - name: {{ nics[role]['private_network'] }} + name: {{ nets['tenant']['nic_mapping'][role]['members'][0] }} use_dhcp: false addresses: - ip_netmask: {get_param: TenantIpSubnet} {%- endif %} {%- endif %} - {%- if 'public_network' in enabled_networks and external_net_type == 'interface' and vlans['public_network'] == 'native' %} + {%- if nets['external'][0]['enabled'] and external_net_type == 'interface' and nets['external'][0]['nic_mapping'][role]['vlan'] == 'native' %} - type: interface - name: {{ nics[role]['public_network'] }} + name: {{ nets['external'][0]['nic_mapping'][role]['members'][0] }} {%- if role == 'controller' %} dns_servers: {get_param: DnsServers} {%- endif %} @@ -200,7 +200,7 @@ resources: {%- endif %} ip_netmask: 0.0.0.0/0 next_hop: {get_param: ExternalInterfaceDefaultRoute} - {%- elif 'public_network' in enabled_networks and external_net_type == 'br-ex' and vlans['public_network'] == 'native' %} + {%- elif nets['external'][0]['enabled'] and external_net_type == 'br-ex' and nets['external'][0]['nic_mapping'][role]['vlan'] == 'native' %} - type: ovs_bridge name: {get_input: bridge_name} @@ -208,7 +208,7 @@ resources: members: - type: interface - name: {{ nics[role]['public_network'] }} + name: {{ nets['external'][0]['nic_mapping'][role]['members'][0] }} # force the MAC address of the bridge to this interface primary: true {%- if role == 'controller' %} @@ -223,19 +223,19 @@ resources: next_hop: {get_param: ExternalInterfaceDefaultRoute} {%- endif %} {%- endif %} - {%- if 'storage_network' in enabled_networks and vlans['storage_network'] == 'native' %} + {%- if nets['storage']['enabled'] and nets['storage']['nic_mapping'][role]['vlan'] == 'native' %} - type: interface - name: {{ nics[role]['storage_network'] }} + name: {{ nets['storage']['nic_mapping'][role]['members'][0] }} use_dhcp: false addresses: - ip_netmask: {get_param: StorageIpSubnet} {%- endif %} - {%- if 'api_network' in enabled_networks and vlans['api_network'] == 'native' %} + {%- if nets['api']['enabled'] and nets['api']['nic_mapping'][role]['vlan'] == 'native' %} - type: interface - name: {{ nics[role]['api_network'] }} + name: {{ nets['api']['nic_mapping'][role]['members'][0] }} use_dhcp: false addresses: - diff --git a/build/undercloud.sh b/build/undercloud.sh index a4d008ee..3cc56009 100755 --- a/build/undercloud.sh +++ b/build/undercloud.sh @@ -62,7 +62,7 @@ LIBGUESTFS_BACKEND=direct virt-customize \ # Add custom IPA to allow kernel params wget https://raw.githubusercontent.com/trozet/ironic-python-agent/opnfv_kernel/ironic_python_agent/extensions/image.py -python3.4 -c 'import py_compile; py_compile.compile("image.py", cfile="image.pyc")' +python3 -c 'import py_compile; py_compile.compile("image.py", cfile="image.pyc")' # Add performance image scripts LIBGUESTFS_BACKEND=direct virt-customize --upload ../build_perf_image.sh:/home/stack \ -- cgit 1.2.3-korg