Disk layouts: worked examples

How the node installer is told what to do with a node's disks: one layout per shape, with the commands that put it in place. Every layout below is written in the shorthand the luna command accepts; luna group showdisklayout shows the same layout with every default filled in.

All examples assume a group that installs to disk, so its scripts must not mount a tmpfs root:

# luna group clone compute diskful
# luna group change diskful --install-mode auto -qpart 'true' -qpost 'true'

A layout is loaded from a file with -qdl, or written in $EDITOR with --disklayout:

# luna group change diskful -qdl /root/layout.yaml
# luna group showdisklayout diskful

Nodes inherit the group's layout; a layout set on a node replaces it as a whole.

One disk, found at boot

The OS on any disk of at least 20 GB. The three volumes take their defaults: a 600 MB EFI partition, a 1 GB /boot and the rest as / on LVM.

version: 2
sets:
  - role: os
    match: {min_size: 20G}
    volumes: [/boot/efi, /boot, /]

Stored, and as the node receives it, the same layout reads:

{
  "version": 2,
  "sets": [
    {
      "name": "os", "role": "os", "selection": "discover", "raid": "none",
      "match": {"min_size": "20G"},
      "volumes": [
        {"name": "uefi", "mountpoint": "/boot/efi", "fs": "vfat", "provider": "partition", "size": "600M"},
        {"name": "boot", "mountpoint": "/boot",     "fs": "xfs",  "provider": "partition", "size": "1G"},
        {"name": "root", "mountpoint": "/",         "fs": "xfs",  "provider": "lvm",       "size": "100%"}
      ]
    }
  ]
}

One named disk

The same, on exactly one device. Listing devices makes the set manual.

version: 2
sets:
  - role: os
    devices: [/dev/disk/by-path/pci-0000:03:00.0]
    volumes: [/boot/efi, /boot, /]

RAID 1: the OS mirrored over two SSDs

version: 2
sets:
  - role: os
    raid: "1"
    match: {tags: [ssd]}
    volumes: [/boot/efi, /boot, /]

The mirror takes the two smallest SSDs that match. Quote the RAID level: "1", not 1.

RAID 0: the OS striped over two NVMe disks

Speed, no redundancy; a lost disk means a reinstall, which auto performs by itself.

version: 2
sets:
  - role: os
    raid: "0"
    match: {tags: [nvme]}
    volumes: [/boot/efi, /boot, /]

RAID 5: a data set next to the OS

The OS on one SSD; four spinning disks as a single-parity set mounted on /data. Parity RAID is for data sets only — the OS set refuses it. A data volume needs an explicit size.

version: 2
sets:
  - role: os
    match: {tags: [ssd]}
    volumes: [/boot/efi, /boot, /]
  - role: data
    raid: "5"
    match: {tags: [rotary]}
    volumes:
      - {mountpoint: /data, size: 100%}

auto and sync never wipe a data set; only full does.

RAID 1 OS with a RAID 6 workspace

The OS mirrored over two SSDs, and six spinning disks of at least 8 TB as a dual-parity workspace on /scratch. count fixes the number of members where the RAID level allows a range.

version: 2
sets:
  - role: os
    raid: "1"
    match: {tags: [ssd]}
    volumes: [/boot/efi, /boot, /]
  - role: data
    raid: "6"
    count: 6
    match: {tags: [rotary], min_size: 8T}
    volumes:
      - {mountpoint: /scratch, size: 100%}

OS from RAM, local data kept

The node runs diskless, and one local disk holds data that must survive every reinstall. A persistent set is never partitioned, formatted or written by the installer; it is only mounted, and only sanitize erases it. With no OS set declared, install_mode: auto runs the OS from RAM.

version: 2
sets:
  - role: data
    persistent: true
    devices: [/dev/disk/by-path/pci-0000:05:00.0]
    volumes:
      - {mountpoint: /data, size: 100%}

Discover once, then pin

The first install resolves the recipe and writes the disks it used back to the node as a manual layout; every boot after that reproduces exactly those disks.

version: 2
sets:
  - role: os
    raid: "1"
    match: {tags: [ssd]}
    save: true
    volumes: [/boot/efi, /boot, /]

After the first install, luna node showdisklayout node001 shows the pinned devices. To return the node to the group's recipe, clear its layout:

# luna node change node001 -qdl ''

Reinstalling and handing over

The layout stays; only the mode changes.

# luna node change node001 --install-mode full       # wipe and reinstall, data sets included
# luna node change node001 --install-mode sanitize   # securely erase every disk, no install
# luna node change node001 --install-mode auto       # back to the default afterwards