Skip to content

Storage Architecture & Pools

PiVirt provides a unified storage abstraction layer supporting multiple backends: local directory filesystems, LVM thin provisioning, network iSCSI block storage, NFS shares, and clustered OCFS2 volumes.

flowchart TB
    subgraph DiskLayer["VM Disk Layer"]
        LCL["Local (qcow2/raw)"]
        ISC["iSCSI (block)"]
        NFS_D["NFS (file)"]
    end

    subgraph PoolMgr["Storage Pool Manager"]
        LVM_P["LVM Pool"]
        ISC_P["iSCSI Pool"]
        NFS_P["NFS Pool"]
    end

    LCL --> LVM_P
    ISC --> ISC_P
    NFS_D --> NFS_P
storage:
pools:
- name: "default"
type: "dir"
path: "/var/lib/pivirtd/images"
storage:
pools:
- name: "lvm-pool"
type: "lvm"
volume_group: "pivirtd-vg"
thin_pool: "pivirtd-thin"
storage:
pools:
- name: "iscsi-pool"
type: "iscsi"
target_iqn: "iqn.2024-01.hu.pilab:storage"
portal: "10.0.1.10:3260"
storage:
pools:
- name: "nfs-pool"
type: "nfs"
server: "nas.pilab.hu"
export: "/exports/pivirtd"
version: "4.2"
  • Direct block device access
  • Best performance
  • No snapshots (unless backend supports)
  • Copy-on-write
  • Snapshots and cloning
  • Compression and encryption
  • Allocate on demand
  • Over-provisioning support
  • Space reclamation with discard
Terminal window
pvcli storage volume create \
--pool default \
--name data-01 \
--size 100Gi \
--format qcow2
Terminal window
pvcli storage volume clone \
--source data-01 \
--name data-01-clone
Terminal window
pvcli storage snapshot create \
--volume data-01 \
--name backup-01
Terminal window
pvcli storage volume resize \
--name data-01 \
--size 200Gi

For multi-node clusters, PiVirt uses OCFS2 for shared block storage:

cluster:
name: "pivirt-cluster"
o2cb:
stack: "o2cb"
nodes:
- name: "node-01"
ip: "10.0.1.10"
- name: "node-02"
ip: "10.0.1.11"
fencing:
enabled: true
agent: "ipmi"