-
-
Save marcindulak/ff2683c78c841f2fa562ee4412dd0a3e to your computer and use it in GitHub Desktop.
Rebuild lustre 2.9.0 with zfs support on CentOS 7.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Rebuild lustre 2.9.0 with zfs support on CentOS 7.3 | |
# https://lists.01.org/pipermail/hpdd-discuss/2016-December/003037.html | |
# http://lists.lustre.org/pipermail/lustre-discuss-lustre.org/2016-December/014110.html | |
# 0. Install Virtualbox, Vagrant and do: | |
# vagrant up | |
# 1. to rebuild the RPMS | |
# vagrant reload | |
Vagrant.configure(2) do |config| | |
config.vm.define "server" do |machine| | |
machine.vm.box = "centos/7" | |
machine.vm.box_url = machine.vm.box | |
machine.vm.box_version = "1611.01" | |
# installing lustre kernel removes virtualbox guest additions | |
machine.vm.synced_folder ".", "/vagrant", disabled: true | |
machine.vm.provider "virtualbox" do |v| | |
v.memory = 512 | |
v.cpus = 1 | |
end | |
end | |
$epel7 = <<SCRIPT | |
yum -y install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm | |
SCRIPT | |
$zfs_epel73 = <<SCRIPT | |
# lustre-osd-zfs-2.8.0 (lustre-server) Requires: zfs-kmod | |
yum -y install http://download.zfsonlinux.org/epel/zfs-release.el7_3.noarch.rpm | |
SCRIPT | |
$lustre_server_290_rhel = <<SCRIPT | |
yum clean all | |
cat <<'END' > /etc/yum.repos.d/lustre_server.repo | |
[lustre-server] | |
name=CentOS-$releasever - Lustre server | |
baseurl=https://downloads.hpdd.intel.com/public/lustre/lustre-2.9.0/el$releasever/server/ | |
# https://jira.hpdd.intel.com/browse/LU-1354 | |
gpgcheck=0 | |
END | |
SCRIPT | |
# lustre kernel/firmware - install | |
$lustre_kernel_install = <<SCRIPT | |
kernel_version=`yum list --showduplicates kernel | grep lustre-server | awk '{print $2}'` | |
kernel_firmware_version=`yum list --showduplicates kernel-firmware | grep lustre-server | awk '{print $2}'` | |
yum -y install --nogpgcheck --setopt=protected_multilib=false kernel-${kernel_version} kernel-firmware-${kernel_firmware_version} kernel-devel-${kernel_version} kernel-headers-${kernel_version} | |
yum clean all | |
SCRIPT | |
# lustre kernel/firmware - install | |
$kernel_version_lock = <<SCRIPT | |
yum versionlock add kernel | |
yum versionlock add kernel-firmware | |
yum versionlock add kernel-devel | |
yum versionlock add kernel-headers | |
SCRIPT | |
$rpmbuild_rebuild = <<SCRIPT | |
rm -rf ~/rpmbuild | |
yum -y install wget | |
yum -y install rpm-build | |
yum -y install kmod-zfs-devel libzfs2-devel | |
yum -y install libselinux-devel libtool | |
rm -f lustre-2.9.0-1.src.rpm | |
wget -q https://downloads.hpdd.intel.com/public/lustre/lustre-2.9.0/el7/server/SRPMS/lustre-2.9.0-1.src.rpm | |
rpmbuild --rebuild --with zfs lustre-2.9.0-1.src.rpm | |
SCRIPT | |
$configure_local_rpms_repo = <<SCRIPT | |
yum clean all | |
yum -y install createrepo | |
rpmbuild=`readlink -f ~/rpmbuild/RPMS` | |
createrepo ${rpmbuild} | |
cat <<END > /etc/yum.repos.d/lustre.repo | |
[lustre] | |
name=CentOS-$releasever - Lustre locally built RPMS | |
baseurl=file://${rpmbuild} | |
enabled=1 | |
gpgcheck=0 | |
END | |
SCRIPT | |
config.vm.define "server" do |machine| | |
machine.vm.provision :shell, :inline => "hostname server", run: "always" | |
machine.vm.provision :shell, :inline => $epel7 | |
machine.vm.provision :shell, :inline => $lustre_server_290_rhel | |
machine.vm.provision :shell, :inline => $lustre_kernel_install | |
machine.vm.provision :shell, :inline => "yum -y install yum-plugin-versionlock" | |
machine.vm.provision :shell, :inline => $kernel_version_lock | |
machine.vm.provision :shell, :inline => "yum clean all" | |
machine.vm.provision :shell, :inline => "yum-config-manager --disable lustre-server" | |
machine.vm.provision :shell, :inline => $zfs_epel73 | |
machine.vm.provision :shell, :inline => "yum-config-manager --disable zfs" | |
machine.vm.provision :shell, :inline => "yum-config-manager --enable zfs-kmod" | |
machine.vm.provision :reload | |
machine.vm.provision :shell, :inline => "uname -r", run: "always" | |
machine.vm.provision :shell, :inline => "rpm -qa | grep kernel | grep `uname -r`", run: "always" | |
if false | |
machine.vm.provision :shell, :inline => $rpmbuild_rebuild, run: "always" | |
machine.vm.provision :shell, :inline => $configure_local_rpms_repo, run: "always" | |
machine.vm.provision :shell, :inline => "yum -y install kmod-lustre-osd-zfs lustre", run: "always" | |
end | |
if true | |
machine.vm.provision :shell, :inline => "yum -y install wget", run: "always" | |
machine.vm.provision :shell, :inline => "yum -y install rpm-build", run: "always" | |
machine.vm.provision :shell, :inline => "yum -y install kmod-zfs-devel libzfs2-devel", run: "always" | |
machine.vm.provision :shell, :inline => "yum -y install libselinux-devel libtool", run: "always" | |
machine.vm.provision :shell, :inline => "rm -f lustre-2.9.0-1.src.rpm&& wget -q https://downloads.hpdd.intel.com/public/lustre/lustre-2.9.0/el7/server/SRPMS/lustre-2.9.0-1.src.rpm", run: "always" | |
machine.vm.provision :shell, :inline => "rm -rf ~rpmbuild&& rpmbuild --rebuild --with zfs lustre-2.9.0-1.src.rpm", run: "always" | |
machine.vm.provision :shell, :inline => "cd ~/rpmbuild/RPMS/`uname -m`/&& yum -y install kmod-lustre-osd-zfs-2.9.0* kmod-lustre-2.9.0* lustre-osd-zfs-mount-2.9.0* lustre-2.9.0* lustre-iokit*", run: "always" | |
end | |
machine.vm.provision :shell, :inline => "modprobe zfs", run: "always" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment