Intro
Lustre development on ARM machines is possible but requires some more care on an Apple Silicon Mac due to some kernel restrictions. Most out of the box EL8 aarch64 versions assume a 64K page size which is not supported on Apple Silicon. 4k and 16k are supported. As result a install ISO file loops in Grub since the kernel cannot boot. This is fixed for EL9+ aarch64 versions and do not require this process.
This document walks through the steps required to run EL8 virtualized on an Apple Silicon Mac.
Process
Virtualization is not possible. Therefore, we must emulate a VM to build a kernel with a compatible page size. Due to emulation, this is very slow. Here, we use UTM with QEMU. This walk-through uses Rocky 8.7 aarch64 as an example.
Setup
- Install UTM and create a new VM with the Rocky iso. This loops in Grub due to the above restriction.
- Stop the VM. Right-click on VM
Edit->QEMU
and untickUse Hypervisor
to enable emulation. In the same settings window, changeDisplay->Emulated Display Card
fromvirtio-gpu-pci
tovirtio-ramfb
otherwise there is not display output. - Boot and install OS as usual.
New kernel
- First install some build dependencies as root:
dnf -y groupinstall 'C Development Tools and Libraries' dnf -y groupinstall 'Development Tools' dnf -y install ncurses-devel openssl-devel elfutils-libelf-devel python3 dnf config-manager --set-enabled powertools dnf -y install dwarves wget
- Grab a kernel and unpack:
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.18.tar.gz tar xf linux-4.18.tar.gz
- Config kernel and use booted kernel config as a base
cd linux-4.18/ make O=~/build/kernel mrproper cp /boot/config-`uname -r` ~/build/kernel/.config
- Change kernel page size. With, e.g.,
make menuconfig
searchCONFIG_ARM64_64K_PAGES
and change it to4K
.make O=~/build/kernel menuconfig sed -ri '/CONFIG_SYSTEM_TRUSTED_KEYS/s/=.+/=""/g' ~/build/kernel/.config grep PAGES ~/build/kernel/.config # sanity check
- (optional) set target name
vim Makefile # to change `EXTRAVERSION` kernel name suffix sed -i 's/^EXTRAVERSION.*/EXTRAVERSION = -4Kpages/' Makefile # alternative make O=~/build/kernel kernelversion # check kernel version target
- Build the kernel (this takes a while due to emulation...)
make -j 4 O=~/build/kernel make O=~/build/kernel modules_install
- Install kernel
cp ~/build/kernel/arch/arm64/boot/Image /boot/vmlinuz-4.18.0-4Kpages cp -v ~/build/kernel/System.map /boot/System.map-4.18.0-4Kpages kernel-install add 4.18.0-4Kpages /boot/vmlinuz-4.18.0-4Kpages
Reboot into the new kernel. If successful, shutdown the VM.
Re-enable the
Use Hypervisor
option and change theEmulated Display Card
back tovirtio-gpu-pci
to enable virtualization.Refer to this guide for building Lustre MASTER with Rocky 8.7. Double check there is enough space available in the VM.
(Optional) Migrate VM from UTM to VMware Fusion Pro
VMware Fusion Pro does not support emulation and therefore the used Rocky image cannot boot without building a kernel with a compatible page size first. Moreover, even when migrating to VMware, the stock kernel is incompatible. So, it is important to first build the Lustre kernel.
Note, Oracle Linux 8.7 is the only flavor that can boot out of the box with VMware Fusion. Rocky/Alma/CentOS do not boot without a compatible kernel.
The following documents the steps for a successful migration:
- Make sure to have build a Lustre kernel before continuing. (Other kernel configurations probably work too except the stock kernel).
- In UTM first run
dracut --force --no-hostonly
which rebuilds the initramfs with all drivers available. This is important to support the storage bus type in VMware. Later (when in VMware),dracut --force
rebuilds initramfs only with the needed drivers. - Shutdown the VM and convert the qcow2 VM file to vmdk via
qemu-img
. If command not available, install qemu (e.g., via brew:brew install qemu
). This command creates a new vmdk file, leaving qcow2 untouched.:# First, navigate to the UTM VM directory qemu-img convert -p -f qcow2 -O vmdk <VM_file_name>.utm/Data/*.qcow2 ~/Downloads/rocky8-7.vmdk
Add VM in VMware Fusion and use
Create a custom virtual machine
, chooseUse an existing virtual disk
.Boot into the existing Lustre kernel.
Final steps:
Fix swap:
swapon /dev/mapper/rl-swap --fixpgsz
The NIC has changed, so the old config file no longer applies: Navigate to
/etc/sysconfig/network-scripts/
, change the file name and the config, i.e., theNAME
andDEVICE
fields.Set a new hostname
Regenerate hostkeys
cd /etc/ssh && rm ssh_host_* && ssh-keygen -A
- (optional) nvme drivers on EL8 seem to be buggy regarding low power states. This results in an unresponsive machine for 30 seconds. syslog reports
nvme nvme0: I/O 123 QID 2 timeout, aborting; nvme nvme0: Abort status: 0x0
. This can be avoided by changing the disk interface to SATA in the VM disk settings.
Reboot and done.