From 0db45e140467be234b76a424577d25d88dddda7d Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Fri, 26 Aug 2016 16:09:56 +0300 Subject: [PATCH] Allocate dpdk socket memory * allocate dpdk socket memory if configured * update main task to conform to F9.0+ Change-Id: I520b92cfbda083ad5781c8bc89bde9b43dcbfa0f --- deployment_scripts/install.sh | 8 ++++++++ .../puppet/manifests/ovs-install-compute.pp | 16 +++++++++++----- deployment_tasks.yaml | 8 +++++--- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/deployment_scripts/install.sh b/deployment_scripts/install.sh index 67bd6cb..0b8332a 100644 --- a/deployment_scripts/install.sh +++ b/deployment_scripts/install.sh @@ -8,6 +8,7 @@ cd $INSTALL_HOME host=$1 nsh=$2 dpdk=$3 +dpdk_socket_mem=$4 if [ $nsh = 'true' ] @@ -36,7 +37,14 @@ else dpkg -i libdpdk0_16.07-1_amd64.deb dpkg -i dpdk_16.07-1_amd64.deb dpkg -i openvswitch-switch-dpdk_2.5.90-1_amd64.deb + + dpdk_pages=$(($dpdk_socket_mem / 2)) + sed "s/#*\(NR_2M_PAGES=\).*/\1${dpdk_pages}/" /etc/dpdk/dpdk.conf + service dpdk start + ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true + [ -n $dpdk_socket_mem ] && vs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem="$dpdk_socket_mem" + service openvswitch-switch restart fi fi diff --git a/deployment_scripts/puppet/manifests/ovs-install-compute.pp b/deployment_scripts/puppet/manifests/ovs-install-compute.pp index 3991454..27e96fb 100644 --- a/deployment_scripts/puppet/manifests/ovs-install-compute.pp +++ b/deployment_scripts/puppet/manifests/ovs-install-compute.pp @@ -1,10 +1,16 @@ -$fuel_settings = parseyaml(file('/etc/astute.yaml')) -$master_ip = $::fuel_settings['master_ip'] -$install_nsh = $::fuel_settings['fuel-plugin-ovs']['install_nsh'] -$install_dpdk = $::fuel_settings['fuel-plugin-ovs']['install_dpdk'] +# get options +$master_ip = hiera('master_ip') +$ovs_settings = hiera('fuel-plugin-ovs') +$dpdk = hiera('dpdk') + +$install_nsh = $ovs_settings['install_nsh'] +$install_dpdk = $ovs_settings['install_dpdk'] +$ovs_socket_mem = join(pick($dpdk['ovs_socket_mem'], []), ',') + + if $operatingsystem == 'Ubuntu' { exec { 'install ovs_nsh_dpdk': - command => "curl http://${master_ip}:8080/plugins/fuel-plugin-ovs-0.9/deployment_scripts/install.sh | bash -s ${master_ip} ${install_nsh} ${install_dpdk}", + command => "curl http://${master_ip}:8080/plugins/fuel-plugin-ovs-0.9/deployment_scripts/install.sh | bash -s ${master_ip} ${install_nsh} ${install_dpdk} ${ovs_socket_mem}", path => "/usr/bin:/usr/sbin:/bin:/sbin"; } } elsif $operatingsystem == 'CentOS' { diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index d190afb..350ccb1 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -1,9 +1,11 @@ - id: ovs_install_compute type: puppet - version: 2.0.0 + version: 2.1.0 groups: [compute] - required_for: [pre_deployment_end] - requires: [pre_deployment_start] + requires: [allocate_hugepages] + required_for: [netconfig] + condition: + yaql_exp: changedAny($.get('fuel-plugin-ovs'), $.get('dpdk')) parameters: puppet_manifest: puppet/manifests/ovs-install-compute.pp puppet_modules: puppet/modules:/etc/puppet/modules