Chapter 7. Configuring additional persistent storage for the RHEL AI instance
Some cloud or bare-metal instances might not have enough storage on the default disk to run RHEL AI and store downloaded models. You can configure additional storage for Red Hat Enterprise Linux AI to store models and data.
Prerequisites
- You have deployed a Red Hat Enterprise Linux AI instance.
- You have attached and formatted an additional storage volume to your Red Hat Enterprise Linux AI instance.
Procedure
Review the disks attached to the instance:
$ lsblkCreate a
DISKvariable for the newly provisioned disk path. For example:$ DISK=/dev/vdbConfigure the system to automatically mount the disk to the
/mntdirectory. Add an entry to/etc/fstab:$ echo "${DISK} /mnt xfs defaults 0 0" | sudo tee -a /etc/fstabNoteReplace
xfswith your disk’s file system type if different (for example,ext4).Reload the
systemdservice:$ sudo systemctl daemon-reloadMount the disk:
$ sudo mount -aCreate folders for Red Hat AI Inference data on the mounted disk:
$ sudo mkdir -p /mnt/rhaiis/cache /mnt/rhaiis/models /mnt/rhaiis/tmp /mnt/rhaiis/config /mnt/vllm /mnt/flashinferGrant appropriate permissions to the mounted directory:
$ sudo chmod u+rwX /mnt/$ sudo chown -R 1001:root /mnt/If the configuration file does not already exist, create it by copying the example file:
$ sudo cp /etc/containers/systemd/rhaiis.container.d/install.conf.example /etc/containers/systemd/rhaiis.container.d/install.confConfigure Red Hat AI Inference to use the additional storage by editing the configuration file:
$ sudo vi /etc/containers/systemd/rhaiis.container.d/install.confAdd the following environment variables to the
[Container]section:[Container] # Configure cache locations to use the additional storage disk Environment=VLLM_CACHE_ROOT=/mnt/vllm Environment=FLASHINFER_WORKSPACE_BASE=/mnt/flashinferExpand Table 7.1. Storage configuration parameters Parameter Description VLLM_CACHE_ROOTLocation where vLLM stores compiled kernels and other cache files.
FLASHINFER_WORKSPACE_BASELocation where FlashInfer stores JIT-compiled kernel workspaces.
Update the volume mounts in the Red Hat AI Inference container configuration to include the additional storage paths. Edit the main container file:
$ sudo vi /etc/containers/systemd/rhaiis.containerReplace the existing
Volumelines with the following updated volume mounts that point to the additional storage disk. Delete the following existing lines:Volume=/var/lib/rhaiis/cache:/opt/app-root/src/.cache:Z Volume=/var/lib/rhaiis/models:/opt/app-root/src/models:Z Volume=/var/lib/rhaiis/tmp:/tmp:Z Volume=/var/lib/rhaiis/config:/opt/app-root/src/.config:ZReplace them with:
Volume=/mnt/rhaiis/cache:/opt/app-root/src/.cache:Z Volume=/mnt/rhaiis/models:/opt/app-root/src/models:Z Volume=/mnt/rhaiis/tmp:/tmp:Z Volume=/mnt/rhaiis/config:/opt/app-root/src/.config:Z Volume=/mnt/vllm:/mnt/vllm:Z Volume=/mnt/flashinfer:/mnt/flashinfer:ZReload the systemd configuration:
$ sudo systemctl daemon-reloadRestart the Red Hat AI Inference service to apply the changes:
$ sudo systemctl restart rhaiis
Verification
Verify that the disk is mounted correctly:
$ df -h /mntThe additional storage disk mounted at
/mntis listed.Verify that Red Hat AI Inference is using the additional storage by checking the container mounts:
$ sudo podman inspect rhaiis --format '{{range .Mounts}}{{.Source}} -> {{.Destination}}{{"\n"}}{{end}}'The output lists the 6 volume mounts, all of which are
/mntpaths mapped to their corresponding container destinations.