From e8e37f6abc18e3c7c5ccbcfd1e2b11926cb69d74 Mon Sep 17 00:00:00 2001 From: davidplunkett Date: Thu, 23 May 2019 03:29:51 +0000 Subject: [PATCH] Add platform kernel_params support, fix vxlan Add support for platform kernel params in input file to be mapped to rack.j2 and SRV_KERNEL_PARAMS Signed-off-by: davidplunkett Change-Id: Iac6ca2c905845541aba3a1255f69fb285cac7ce6 Signed-off-by: davidplunkett --- dellgen10.yaml | 17 +++++++---------- hpgen10.yaml | 19 +++++++------------ site_type/ovsdpdk/templates/baremetal/rack.j2 | 13 +++++++++++++ site_type/sriov/templates/baremetal/rack.j2 | 13 +++++++++++++ tools/j2/serverrc.j2 | 7 ++++--- 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/dellgen10.yaml b/dellgen10.yaml index 9cb3f47..171020c 100644 --- a/dellgen10.yaml +++ b/dellgen10.yaml @@ -215,9 +215,6 @@ genesis: ksn: 172.29.1.40 neutron: 10.0.102.40 root_password: akraino,d -# bios_template: dell_r740_g14_uefi_base.xml.template -# boot_template: dell_r740_g14_uefi_httpboot.xml.template -# http_boot_device: NIC.Slot.2-1-1 masters: - name : aknode41 oob: 192.168.41.41 @@ -245,13 +242,13 @@ masters: # pxe: 172.30.2.43 # ksn: 172.29.1.43 # neutron: 10.0.102.43 -# - name : aknode44 -# oob: 192.168.41.44 -# host: 192.168.2.44 -# storage: 172.31.2.44 -# pxe: 172.30.2.44 -# ksn: 172.29.1.44 -# neutron: 10.0.102.44 +platform: + kernel_params: + hugepagesz: '1G' + hugepages: 32 + default_hugepagesz: '1G' + iommu: 'pt' + intel_iommu: 'on' hardware: vendor: DELL generation: '10' diff --git a/hpgen10.yaml b/hpgen10.yaml index 0b336b8..39c6d5e 100644 --- a/hpgen10.yaml +++ b/hpgen10.yaml @@ -214,9 +214,6 @@ genesis: neutron: 10.0.101.30 root_password: akraino,d mac_address: 3c:fd:fe:aa:90:b0 -# bios_template: hpe_dl380_g10_uefi_base.json.template -# boot_template: hpe_dl380_g10_uefi_httpboot.json.template -# http_boot_device: NIC.Slot.3-1-1 masters: - name : aknode31 oob: 192.168.41.131 @@ -244,15 +241,13 @@ masters: # pxe: 172.30.1.33 # ksn: 172.29.1.33 # neutron: 10.0.101.33 -# oob_user: Administrator -# oob_password: Admin123 -# - name : aknode34 -# oob: 192.168.41.134 -# host: 192.168.2.34 -# storage: 172.31.1.34 -# pxe: 172.30.1.34 -# ksn: 172.29.1.34 -# neutron: 10.0.101.34 +platform: + kernel_params: + hugepagesz: '1G' + hugepages: 32 + default_hugepagesz: '1G' + iommu: 'pt' + intel_iommu: 'on' hardware: vendor: HP generation: '10' diff --git a/site_type/ovsdpdk/templates/baremetal/rack.j2 b/site_type/ovsdpdk/templates/baremetal/rack.j2 index 464a826..25ddcde 100644 --- a/site_type/ovsdpdk/templates/baremetal/rack.j2 +++ b/site_type/ovsdpdk/templates/baremetal/rack.j2 @@ -48,6 +48,12 @@ data: rack: RACK01 tags: - 'masters' +{% if 'platform' in yaml %} + platform: + kernel_params: +{% for key, value in yaml.platform.kernel_params.items() %} + {{key}}: {{value}} +{% endfor %}{% endif %} {% endfor %} {% if 'workers' in yaml %}{% for server in yaml.workers %} --- @@ -84,5 +90,12 @@ data: rack: RACK01 tags: - 'workers' +{% if 'platform' in yaml %} + platform: + kernel_params: +{% for key, value in yaml.platform.kernel_params.items() %} + {{key}}: {{value}} +{% endfor %}{% endif %} {% endfor %}{% endif %} ... + diff --git a/site_type/sriov/templates/baremetal/rack.j2 b/site_type/sriov/templates/baremetal/rack.j2 index 464a826..25ddcde 100644 --- a/site_type/sriov/templates/baremetal/rack.j2 +++ b/site_type/sriov/templates/baremetal/rack.j2 @@ -48,6 +48,12 @@ data: rack: RACK01 tags: - 'masters' +{% if 'platform' in yaml %} + platform: + kernel_params: +{% for key, value in yaml.platform.kernel_params.items() %} + {{key}}: {{value}} +{% endfor %}{% endif %} {% endfor %} {% if 'workers' in yaml %}{% for server in yaml.workers %} --- @@ -84,5 +90,12 @@ data: rack: RACK01 tags: - 'workers' +{% if 'platform' in yaml %} + platform: + kernel_params: +{% for key, value in yaml.platform.kernel_params.items() %} + {{key}}: {{value}} +{% endfor %}{% endif %} {% endfor %}{% endif %} ... + diff --git a/tools/j2/serverrc.j2 b/tools/j2/serverrc.j2 index d20c2ab..0356fd3 100644 --- a/tools/j2/serverrc.j2 +++ b/tools/j2/serverrc.j2 @@ -54,6 +54,7 @@ SRV_HTTP_BOOT_DEV={% if 'http_boot_device' in yaml.genesis %}{{yaml.genesis.http # tempalte to run to configure OS after first boot # current options are: firstboot.sh.template, firstboot-genesis.sh.tempate or firstboot-airship-iab.sh.template SRV_FIRSTBOOT_TEMPLATE=firstboot-genesis.sh.template +SRV_KERNEL_PARAMS="{% if 'platform' in yaml %}{% for key, value in yaml.platform.kernel_params.items() %}{{key}}={{value}}{{ ' ' if not loop.last else '' }}{% endfor %}{% endif %}" # VLAN to use during build and for final network configuration SRV_VLAN={{yaml.networks.host.vlan}} @@ -61,7 +62,7 @@ SRV_STORAGE_VLAN={{yaml.networks.storage.vlan}} SRV_CALICO_VLAN={{yaml.networks.ksn.vlan}} SRV_NEUTRON_VLAN={{yaml.networks.neutron.vlan}} SRV_PXE_INF={{yaml.networks.pxe.interface}} -SRV_VXLAN_INF={{yaml.networks.vxlan.interface}} +SRV_VXLAN_INF={% if 'vxlan' in yaml.networks %}{{yaml.networks.vxlan.interface}}{% endif %} # basic network information for dhcp config and final server network settings SRV_MTU=9000 @@ -70,7 +71,8 @@ SRV_STORAGE_IP={{yaml.genesis.storage}} SRV_CALICO_IP={{yaml.genesis.ksn}} SRV_NEUTRON_IP={{yaml.genesis.neutron}} SRV_PXE_IP={{yaml.genesis.pxe}} -SRV_VXLAN_IP={{yaml.genesis.vxlan}} +SRV_VXLAN_IP={% if 'vxlan' in yaml.networks %}{{yaml.genesis.vxlan}}{% endif %} + SRV_SUBNET={{yaml.networks.host.cidr | cidr_subnet}} SRV_NETMASK={{yaml.networks.host.cidr | cidr_netmask}} SRV_GATEWAY={{yaml.networks.host.routes.gateway}} @@ -91,4 +93,3 @@ SRV_BOND={{yaml.networks.primary}} {% for slave in yaml.networks.slaves %} SRV_SLAVE{{loop.index}}={{slave.name}} {% endfor %} - -- 2.16.6