How to set up /var on separate disk during Single-Node OpenShift installation?

Posted on

I'm trying to install Single-Node OpenShift on a server which has a ca 250 GB HDD and a ca 1 TB SSD. Installing only on the SSD doesn't work as I can not convince this server to boot off it.

It seems anyway like the best use of resources will be to use the HDD for /boot and /root, and the SDD for /var.

I've tried roughly following the instructions on A Guide for Creating a Separate-disk Partition at Installation Time but haven't been successful so far.

I've tried using Butane myself to generate the manifest. My .bu file looks like this:

---
variant: openshift
version: 4.15.0
metadata:
  labels:
    machineconfiguration.openshift.io/role: worker
  name: 98-var-partition
storage:
  disks:
    - device: /dev/sda
      wipe_table: true
    - device: /dev/nvme0n1
      wipe_table: true
      partitions:
        - number: 1
          label: var
  filesystems:
    - path: /var
      device: /dev/disk/by-partlabel/var
      format: xfs
      wipe_filesystem: true
      mount_options:
        - defaults
        - prjquota
      with_mount_unit: true

Running this through Butane results in:

# Generated by Butane; do not edit
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: worker
  name: 98-var-partition
spec:
  config:
    ignition:
      version: 3.4.0
    storage:
      disks:
        - device: /dev/sda
          wipeTable: true
        - device: /dev/nvme0n1
          partitions:
            - label: var
              number: 1
          wipeTable: true
      filesystems:
        - device: /dev/disk/by-partlabel/var
          format: xfs
          mountOptions:
            - defaults
            - prjquota
          path: /var
          wipeFilesystem: true
    systemd:
      units:
        - contents: |-
            # Generated by Butane
            [Unit]
            Requires=systemd-fsck@dev-disk-by\x2dpartlabel-var.service
            After=systemd-fsck@dev-disk-by\x2dpartlabel-var.service

            [Mount]
            Where=/var
            What=/dev/disk/by-partlabel/var
            Type=xfs
            Options=defaults,prjquota

            [Install]
            RequiredBy=local-fs.target
          enabled: true
          name: var.mount

Now, I've run the installation using these steps:

$ aicli create cluster foo -P pull_secret=pull-secret.json -P sno=true --paramfile foo-host-parameters.yaml
Creating cluster foo
Using version 4.15.11
Creating infraenv foo_infra-env
$ aicli create manifests --dir foo-manifests foo
Uploading manifests for Cluster foo
Skipping file 98-var-partition.bu
Uploading file 98-var-partition.yaml
$ aicli create iso foo

[installing server from ISO]

$ aicli start cluster foo

The resulting installation ends up only using the HDD at /dev/sda, and not setting up any partition on the SSD.

I have also tried not listing /dev/sda in the manifest at all, but then I end up with the installer only using the SDD, which results in the system being unbootable, as the server in question can not boot from the SDD.

What should I change to make it set up the /var partition on the SSD as I want?

Responses