In the first part of the blog we created the dns, two iscsi san’s and now we will focus on creating our base Scale template. In my lab I’ve got Scale 5.18.2 software so we will use that..
In one of my previous attempts to deploy Scale on Ubuntu 20.X few years back it never worked and the reason was If the headers are missing or a different version, mmbuildgpl fails for that reason alone, not because of Scale and guess what happened there, i ran apt upgrade after that ubuntu template got build so rule is Never run apt upgrade on the template.
Step 1 – Confirm the kernel and headers.
root@scale-template:/scale# uname -r
5.15.0-198-generic
root@scale-template:/scale#uname -r prints the running kernel so we are on .15.0-198-generic. The 22.04.1 ISO ships 5.15.0-43, but the installer pulled a newer kernel because it had network access. The catch here is that the IBM FAQ lists Storage Scale 5.1.9.12 as tested up to 5.15.0-157 on Ubuntu 22.04, and 5.1.8.2 is older still, so -198 is newer than anything so we are good..
Step 2 – Install the 5 build prerequisites
apt install -y build-essential linux-headers-$(uname -r) cpp gcc g++ make ksh m4 libaio1 python3These are the five prerequisites scale software needs
| build-essential, gcc, g++, make, cpp | Compile the portability layer |
| ksh | Korn Shell |
| linux-headers-$(uname -r) | Kernel headers matching the running kernel exactly |
| m4 | macro processor |
| libaio1 | Asynchronous I/O library the Scale daemon uses |
| ptthon3 | used by Scale for tooling |
Step3- Extract the Installer
Copy the installer files to /tmp path and unzip 5.1.8.2
oot@scale-template:/usr/lpp/mmfs/5.1.8.2# ls /root/scale/5.1.8.2/
Storage_Scale_Developer-5.1.8.2-x86_64-Linux-install Storage_Scale_Developer-5.1.8.2-x86_64-Linux-install.md5 Storage_Scale_Developer-5.1.8.2-x86_64-Linux.README Storage_Scale_public_key.pgp
root@scale-template:/usr/lpp/mmfs/5.1.8.2#
Install the core packages and run the GPFS installer to mkdir -p /root/scale/5.1.8.2

The packages are extracted to the path

Step 4- Install the Scale packages
To install a cluster packages browse to cd /usr/lpp/mmfs/5.1.8.2 and run dpkg -i which actually installs the extracted packages onto the system. This is the step that gives us the mmbuildgpl and mmbuildgpl compiles the kernel module.

Step 5: Build the portability layer
This is the real test of the kernel. mmbuildgpl compiles the source gpfs against the running kernel’s headers and installs the resulting modules. /usr/lpp/mmfs/bin/mmbuildgpl is the command that does it and this takes a minute or two.

Check if the kernel and headers match: both should be at 5.15.0-198
uname -r
ls -d /lib/modules/$(uname -r)/build
/usr/lpp/mmfs/bin/mmbuildgpl 2>&1 | tail -20So Scale 5.1.8.2 builds on kernel 5.15.0-198, and the template keeps that kernel..
Step 6: Setup path variables.
Lets define the path variables in our master template and then we can start cloning it around to create all our other VM’s.
To ensure the mm commands work without typing the full path lets add a path variable.
echo ‘export PATH=$PATH:/usr/lpp/mmfs/bin’ > /etc/profile.d/gpfs.sh
source /etc/profile.d/gpfs.sh
mmlsconfig answers this node does not belong to a GPFS cluster. That is the expected result so the command works, there is just no cluster yet.

Step 7: Install Encryption and Replication Packages
There are two more missing Scale packages apart from the 5 core ones and this is for encryption and advanced replication etc.
cd /usr/lpp/mmfs/5.1.8.2
dpkg -i $(find . -name ‘gpfs.adv_*.deb’ -o -name ‘gpfs.crypto_*.deb’)
dpkg -l | grep gpfs
dpkg -l shows now list 7 gpfs packages: base, gpl, gskit, msg, license.dev, adv and crypto.

| Package | What it is |
|---|---|
| gpfs.base | The core: the Scale daemon and all the mm admin commands |
| gpfs.gpl | Source code of the portability layer, compiled in Step 5 |
| gpfs.gskit | Crypto library used to authenticate nodes to each other |
| gpfs.msg.en-us | Messages and help text |
| gpfs.license.dev | The Developer Edition licence |
| gpfs.adv | Advanced features of this edition |
| gpfs.crypto | Encryption support |
Step 8: Setup preshared keys
Usually this is done from the admin node, but we will create a shared key so we can distribute out
Create root’s SSH key pair and save it as root’s default key
ssh-keygen -t rsa -b 4096 -N '' -f /root/.ssh/id_rsa
Trust the key so it adds the pub key to root account
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
Use chmod to make the file readable and writable by root only.
chmod 600 /root/.ssh/authorized_keysTest it
ssh -o StrictHostKeyChecking=no localhost hostname
This test shows scale-template does not ask for a password so we are now good
Step 9: Wipe machine identity
Now the last thing we will do is Wipe the machine identity and shut down so this is similar to what we do in Sysprep in Windows… All we are doing here is ensure a unique ID for each linux install just like the Windows SID..
apt clean
rm -f /etc/ssh/ssh_host_*
rm -f /root/.ssh/known_hosts
truncate -s 0 /etc/machine-id
rm -f /var/lib/dbus/machine-id && ln -s /etc/machine-id /var/lib/dbus/machine-id
poweroff
Shut down the VM

Step 10: Convert to Scale Golden Image
Right click VM and convert to template

Now all VM’s can be created from this Scale Golden Image

