Longhorn, the storage system in my cluster, worked until a node rebooted.

Every time I rebooted a node, it broke again. That pointed away from Longhorn itself. Something it depends on wasn’t surviving the reboot.

The iSCSI extension wasn’t surviving reboots. I needed to put the schematic installer image in the machine config.

What Longhorn needs from Talos

Talos is immutable. I can’t SSH in and install a missing tool, because there’s no package manager. Anything the OS needs has to be in the image.

Longhorn needs iSCSI. It needs the iscsi-tools system extension in the Talos image, and the longhorn-system namespace has to be privileged.

If the extension is missing, this is what happens:

  1. iSCSI tools are missing on the node.
  2. Longhorn’s CSI components fail.
  3. Persistent volume claims can’t mount.
  4. Pods that need storage sit in ContainerCreating.

From the pod’s side, it just looks stuck. The cause was the missing extension in the node image.

I don’t remember which volume or pod I noticed first, and it doesn’t matter.

Why it kept coming back

I got this wrong at first.

I had built an image with the right extension, using a Talos schematic from Image Factory. The April build ran schematic 75e66505…, which included iscsi-tools.

But the extensions vanished after reboots because I hadn’t put the schematic installer image in the machine config. The machine config has to point at that schematic image, in machine.install.image. That sets the installer image the node uses. Upgrades take their image from the upgrade command, so I used the schematic image there too.

I patched that in with schematic-patch-02.yaml, which is in the repo. Until then, the extensions could vanish after a reboot.

I also upgrade with --preserve.

talosctl upgrade --nodes <node-ip> --preserve --image factory.talos.dev/installer/<schematic-id>:<version>

--preserve keeps the data on the node’s ephemeral partition through an upgrade instead of wiping it.

What I changed

  1. I built a schematic in Image Factory that includes iscsi-tools. The schematic I use now is 613e1592…, which added util-linux-tools as well.
  2. I set machine.install.image in the machine config to that schematic image.
  3. I kept the longhorn-system namespace privileged.
  4. I upgraded nodes with talosctl upgrade --preserve and the schematic image.

After those changes, the post check passed.

What I took from this

On Talos, only what’s in the config survives a reinstall. The schematic installer image has to be specified in the machine config, and the upgrade command has to use that image too.

If a fix isn’t in the config, a reboot or an upgrade can take it away.