Storage Design
A datastore's scope decides what its VMs can do. Shared datastores — reachable by every host in a cluster — are what make fast live migration, HA restarts, DRS balancing and multi-host Kubernetes clusters possible.
Datastore Types
| Scope | Type | Backed by | Typical use |
|---|---|---|---|
| Local | Local directory | A directory on the host (libvirt directory pool). | Scratch VMs, the Cockpit appliance during deployment. |
| Local | Local disk device | A whole, unpartitioned, unmounted local disk. | Dedicated local performance disk. |
| Shared | Shared NFS | An NFS export mounted at the same path on every host. | ISOs, templates, general-purpose VMs, Kubernetes RWX volumes. |
| Shared | Shared Clustered FS (OCFS2) | A SAN LUN (iSCSI or Fibre Channel, usually multipathed) formatted with OCFS2 and coordinated by the datacenter's shared group. | Production VMs that need HA and DRS on block storage. |
A VM is eligible for DRS balancing and compute-only (fast) live migration only when all of its disks are on shared datastores. VMs on local storage can still be migrated, but the disk must be copied too. See Creating Datastores for every option of the datastore wizard.
Reference Storage Layout
| Datastore | Type | Source | Purpose |
|---|---|---|---|
local on each host | Local directory | Host boot disk | Initial home of the Cockpit appliance; scratch. |
ds-nfs-01 | Shared NFS | 192.168.242.100:/exports/cockpit-ds01 via nfs0 | ISO library, templates, general VMs. |
ds-san-01 | Shared Clustered FS (OCFS2) | iSCSI LUN through iscsia0 and iscsib0, multipath | Production VMs, the Cockpit appliance after relocation. |
Addresses and names are example values from the network design.
NFS Requirements
- Export the directory read-write to the NFS subnet only, for example:textHypervisors need root-level access to create and own disk images, which is why
/exports/cockpit-ds01 192.168.242.0/24(rw,sync,no_root_squash)no_root_squashis required. Because of it, never export the directory to a wider network than the hosts' NFS subnet. - The NFS server should itself be redundant: bonded uplinks to both switches, redundant controllers or an HA pair.
- Cockpit mounts the export at the same path on every host, by default
/mnt/<cluster-name>/<datastore-name>.
iSCSI and Multipath Requirements
- The array presents one target portal on each fabric (for example
192.168.243.100and192.168.244.100). Do not route between the two iSCSI subnets. - Each host uses the Vapor iSCSI software adapter in multipath mode with two port bindings:
iscsia0andiscsib0. Each host has one initiator IQN, for exampleiqn.2026-10.example.corp:vapor-01. - Map the LUN to the IQNs of all hosts (one host group on the array). Every host must see the same LUN identity (WWID); device names such as
/dev/sddmay differ per host. - CHAP is recommended, and should be considered required when the iSCSI VLANs are shared with other systems.
OCFS2 and the Shared Group
When several hosts write to the same LUN at the same time, they must coordinate. Cockpit uses the OCFS2 clustered filesystem with its O2CB cluster stack. The shared group is that O2CB cluster; it is configured once per datacenter, and every host that mounts an OCFS2 datastore must be a member. Members talk to each other on TCP 7777 over the cluster network (VLAN 245, clus0 in the reference design).
The prerequisite order for an OCFS2 datastore is:
- iSCSI sessions with multipath on every host.
- The shared group, active on every host.
- The OCFS2 datastore.
Data or connectivity loss
A clustered datastore is only safe while its shared group is active and in sync on all participating hosts. Never mount or write to an OCFS2 LUN outside the shared group, and never take several members out of the group at the same time: survivors may fence (hard-reset) themselves to protect the data.
TIP
Keep the cluster network on the bond (two switches) so a single link failure never looks like a node failure. Heartbeat loss is what triggers fencing.