From 111216618e87d69b943a03a6419352a08a64025a Mon Sep 17 00:00:00 2001 From: Aviram Bar-Haim Date: Tue, 17 Jun 2014 23:53:15 +0300 Subject: [PATCH] Adding OFED drivers installation 1. adding OFED pre req to CentOS if mlnx enabled 2. adding OFED installation at kickstart postinstall 3. adding OFED pre req to Ubuntu if mlnx enabled 4. adding OFED installation to preseed late command partially implements: blueprint mellanox-features-support Signed-off-by: Moshe Levi Change-Id: I10d1e26aff99f6d6360a6de6f1f385d1c28157d9 --- .../puppet/cobbler/manifests/snippets.pp | 2 ++ .../cobbler/templates/kickstart/centos.ks.erb | 7 ++++ .../templates/preseed/ubuntu-1204.preseed.erb | 1 + .../centos_ofed_prereq_pkgs_if_enabled.erb | 5 +++ .../snippets/ofed_install_with_sriov.erb | 32 +++++++++++++++++++ .../templates/snippets/ubuntu_packages.erb | 5 +++ 6 files changed, 52 insertions(+) create mode 100644 deployment/puppet/cobbler/templates/snippets/centos_ofed_prereq_pkgs_if_enabled.erb create mode 100644 deployment/puppet/cobbler/templates/snippets/ofed_install_with_sriov.erb diff --git a/deployment/puppet/cobbler/manifests/snippets.pp b/deployment/puppet/cobbler/manifests/snippets.pp index c8cdc35193..57246aaef3 100644 --- a/deployment/puppet/cobbler/manifests/snippets.pp +++ b/deployment/puppet/cobbler/manifests/snippets.pp @@ -59,6 +59,7 @@ class cobbler::snippets { cobbler_snippet {"centos_authorized_keys": } cobbler_snippet {"centos_blacklist_i2c_piix4":} cobbler_snippet {"centos_static_net":} + cobbler_snippet {"ofed_install_with_sriov":} cobbler_snippet {"ubuntu_authorized_keys":} cobbler_snippet {"ubuntu_blacklist_i2c_piix4":} cobbler_snippet {"ubuntu_disable_pxe":} @@ -73,6 +74,7 @@ class cobbler::snippets { cobbler_snippet {"anaconda_ssh_console":} cobbler_snippet {'centos_post_kernel_lt_if_enabled':} cobbler_snippet {'centos_pkg_kernel_lt_if_enabled':} + cobbler_snippet {'centos_ofed_prereq_pkgs_if_enabled':} case $operatingsystem { /(?i)(debian|ubuntu)/: { diff --git a/deployment/puppet/cobbler/templates/kickstart/centos.ks.erb b/deployment/puppet/cobbler/templates/kickstart/centos.ks.erb index 320d21eff0..afda4d8e3a 100644 --- a/deployment/puppet/cobbler/templates/kickstart/centos.ks.erb +++ b/deployment/puppet/cobbler/templates/kickstart/centos.ks.erb @@ -131,6 +131,10 @@ perl daemonize rsync +# COBBLER EMBEDDED SNIPPET: 'centos_ofed_prereq_pkgs_if_enabled' +# LISTS ofed prereq PACKAGES IF mlnx_plugin_mode VARIABLE IS SET TO enabled +$SNIPPET('centos_ofed_prereq_pkgs_if_enabled') + # COBBLER EMBEDDED SNIPPET: 'puppet_install_if_enabled' # LISTS puppet PACKAGE IF puppet_auto_setup VARIABLE IS SET TO 1 $SNIPPET('puppet_install_if_enabled') @@ -252,6 +256,9 @@ $SNIPPET('centos_static_net') # Blacklist i2c_piix4 module so it does not create kernel errors $SNIPPET('centos_blacklist_i2c_piix4') +# Install OFED components for RDMA if needed +$SNIPPET('ofed_install_with_sriov') + # COBBLER EMBEDDED SNIPPET: 'kickstart_done' # DISABLES PXE BOOTING $SNIPPET('kickstart_done') diff --git a/deployment/puppet/cobbler/templates/preseed/ubuntu-1204.preseed.erb b/deployment/puppet/cobbler/templates/preseed/ubuntu-1204.preseed.erb index 3256af23c3..d0b4539d5e 100644 --- a/deployment/puppet/cobbler/templates/preseed/ubuntu-1204.preseed.erb +++ b/deployment/puppet/cobbler/templates/preseed/ubuntu-1204.preseed.erb @@ -128,6 +128,7 @@ echo "UseDNS no" >> /target/etc/ssh/sshd_config && \ in-target apt-get -y install linux-image-3.11 linux-headers-3.11 && \ $SNIPPET('ubuntu_blacklist_i2c_piix4') $SNIPPET('ubuntu_static_net') +$SNIPPET('ofed_install_with_sriov') # Rsyslogd should send all messages to master node $SNIPPET('target_logs_to_master_ubuntu') true diff --git a/deployment/puppet/cobbler/templates/snippets/centos_ofed_prereq_pkgs_if_enabled.erb b/deployment/puppet/cobbler/templates/snippets/centos_ofed_prereq_pkgs_if_enabled.erb new file mode 100644 index 0000000000..a196da82cf --- /dev/null +++ b/deployment/puppet/cobbler/templates/snippets/centos_ofed_prereq_pkgs_if_enabled.erb @@ -0,0 +1,5 @@ +#set mlnx_mode=$getVar('mlnx_plugin_mode','disabled') + +#if $mlnx_mode != "disabled" +mlnx-ofed-light +#end if diff --git a/deployment/puppet/cobbler/templates/snippets/ofed_install_with_sriov.erb b/deployment/puppet/cobbler/templates/snippets/ofed_install_with_sriov.erb new file mode 100644 index 0000000000..9e81c5ccf1 --- /dev/null +++ b/deployment/puppet/cobbler/templates/snippets/ofed_install_with_sriov.erb @@ -0,0 +1,32 @@ +#set mlnx_mode=$getVar('mlnx_plugin_mode','disabled') +#set iser_enabled=$getVar('mlnx_iser_enabled','false') + +#if $mlnx_mode != "disabled" or $iser_enabled == 'true' + +#set ofed_install_cmd="/usr/bin/perl /opt/ofed/MLNX_OFED_light/mlnxofedinstall -q --enable-sriov" + +#if $breed == "redhat" +$ofed_install_cmd +#elif $breed == "debian" or $breed == "ubuntu" +in-target $ofed_install_cmd && \ +#end if + +#set $mlnx_opt = "options mlx4_core port_type_array=2,2" + +#if $mlnx_mode in ("ethernet") or $iser_enabled == 'true' +#set $vf_num = $getVar('mlnx_vf_num','1') +#set $mlnx_opt += " num_vfs=%s enable_64b_cqe_eqe=0 log_num_mgm_entry_size=-1" % ($vf_num) +#end if + +#if $iser_enabled == 'true' +#set $mlnx_opt += " probe_vf=1" +#end if + +#set mlnx4_core_file="/etc/modprobe.d/mlx4_core.conf" +#if $breed == "debian" or $breed == "ubuntu" +#set mlnx4_core_file = "/target" + $mlnx4_core_file + " && \\" +#end if +#set mlnx_option_cmd="echo -e \"%s\" > %s" % ($mlnx_opt, $mlnx4_core_file) +$mlnx_option_cmd + +#end if diff --git a/deployment/puppet/cobbler/templates/snippets/ubuntu_packages.erb b/deployment/puppet/cobbler/templates/snippets/ubuntu_packages.erb index a5a54f8eee..4fa7ad0649 100644 --- a/deployment/puppet/cobbler/templates/snippets/ubuntu_packages.erb +++ b/deployment/puppet/cobbler/templates/snippets/ubuntu_packages.erb @@ -5,4 +5,9 @@ #silent $pkgsel_packages.append("mcollective") #end if +#set mlnx_mode=$getVar('mlnx_plugin_mode','disabled') +#if $mlnx_mode != "disabled" + #silent $pkgsel_packages.append("mlnx-ofed-light") +#end if + d-i pkgsel/include string #echo " ".join($pkgsel_packages)