StoragePool Resource Kind
Kind: StoragePoolapiVersion: pivirt.hu/v1Aliases: pool, pools, storage
The StoragePool resource defines a local or network storage target on the hypervisor host. Storage pools provide the volume backing for virtual machine disks (VirtualDisk), ISO installation images, and template caches across multiple filesystem backends.
Accepted Kind Aliases
Section titled “Accepted Kind Aliases”In pivirtctl commands, any of the following aliases are recognized:
StoragePool, storagepool, storagepools, storage-pool, storage-pools, pool, pools, storage.
Example Manifests
Section titled “Example Manifests”apiVersion: pivirt.hu/v1kind: StoragePoolmetadata: name: default labels: tier: standardspec: type: dir path: /var/lib/pivirt/storage/default active: true options: preallocation: falloc discard: unmapapiVersion: pivirt.hu/v1kind: StoragePoolmetadata: name: ceph-nvme labels: tier: high-iops storage-class: distributedspec: type: ceph active: true options: monitors: "10.10.0.1:6789,10.10.0.2:6789" pool: vms user: admin keyring: /etc/ceph/ceph.client.admin.keyringapiVersion: pivirt.hu/v1kind: StoragePoolmetadata: name: iscsi-san labels: tier: sanspec: type: iscsi path: /mnt/pivirt-iscsi active: true options: portal: "10.10.0.20:3260" target: "iqn.2024-01.hu.pilab:storage.target01" lun: "0" fsType: "ext4" mkfs: "true"apiVersion: pivirt.hu/v1kind: StoragePoolmetadata: name: nfs-shared labels: tier: sharedspec: type: nfs path: /mnt/pivirt-nfs active: true options: server: "10.10.0.10" export: "/exports/vms" version: "4.2" mountOptions: "hard,intr"Specification Reference (spec)
Section titled “Specification Reference (spec)”| Field | Type | Required | Default | Description |
|---|---|---|---|---|
type |
string |
No | dir |
Storage backend type: dir, nfs, iscsi, ceph |
path |
string |
No | /var/lib/pivirt/storage/<name> |
Local directory path or mount point |
active |
bool |
No | true |
Whether the pool is active and available for allocations |
options |
map[string]string |
No | {} |
Backend-specific tuning options |
Supported Storage Backend Types
Section titled “Supported Storage Backend Types”dir(Default Filesystem Directory):- Stores disk images as sparse
.qcow2or.rawfiles in a local POSIX filesystem. - Key options:
mode(directory octal permissions, e.g.0755).
- Stores disk images as sparse
nfs(Network File System):- Mounts an external NFS export onto the hypervisor node.
- Key options:
server(NFS server hostname or IP),export(remote exported path),version(3,4,4.0,4.1,4.2),mountOptions,softMount,readOnly.
iscsi(iSCSI Block LUN):- Connects to an iSCSI portal and targets a LUN, mounting it formatted as
ext4orxfs, or exposing it as a raw device. - Key options:
portal,target,lun,fsType(ext4,xfs,none),mkfs,chapUser,chapPassword.
- Connects to an iSCSI portal and targets a LUN, mounting it formatted as
ceph(Ceph / RADOS Block Device Pool):- Directly backs VirtualDisks on Ceph distributed block storage (
rbd). - Key options:
monitors(ormonHost),pool(RBD pool name),user,keyring,secret,conf.
- Directly backs VirtualDisks on Ceph distributed block storage (
CLI Management Examples
Section titled “CLI Management Examples”# Apply a new storage pool manifestpivirtctl apply -f pool-fast.yaml
# List all storage pools (using plural alias)pivirtctl get pools
# List using multi-word aliaspivirtctl get storage pools
# Query details as YAMLpivirtctl get pool/fast-nvme -o yaml
# Inspect pool status and capacitypivirtctl describe pool fast-nvme
# Delete a storage poolpivirtctl delete pool fast-nvme