cheat-sheets

Proxmox Storage

Storage definitions live in /etc/pve/storage.cfg and are managed with pvesm. Default install: local (directory /var/lib/vz, ISOs, templates, backups) and local-lvm (LVM-thin, VM and container disks). ZFS installs get local-zfs instead.

Documentation: Storage · pvesm(1)

Verification: pvesm add dir, add nfs, add pbs, scan nfs, set, remove and the default storage layout were checked against the docs. The zfspool, lvmthin, cifs and zfs/lvs examples, the ARC limit and the Ceph notes were not verified against the docs. The LVM, BTRFS, iSCSI, CephFS, RBD, ZFS over iSCSI and ESXi sections were read in the storage chapter (PVE 9.2 docs). Gaps are marked (unverified). No command was executed.

See also: Proxmox VE Overview and Install · Proxmox Backup and Restore · Proxmox qm and pct · Proxmox Disk Image Formats · NFS · TrueNAS Community Edition (ZFS and NFS server side)


pvesm #

COMMANDDESCRIPTION
pvesm statusAll storages, type, usage
pvesm list <STORAGE>Volumes in a storage
pvesm list <STORAGE> --content backupOnly backups
pvesm scan nfs <SERVER>List exports on an NFS server
pvesm set <STORAGE> --content images,rootdirChange allowed content types
pvesm remove <STORAGE>Remove the definition only (data is not deleted)
pvesm path <VOLID>Filesystem path of a volume
pvesm alloc <STORAGE> <VMID> <NAME> <SIZE>Allocate a volume
pvesm free <VOLID>Delete a volume

Content Types #

The Content drop-down in the Add Storage dialog maps to the content option (comma-separated).

GUI NAMEcontent VALUEUSED FOR
Disk imageimagesVM disks
ISO imageisoInstaller ISOs
Container templatevztmplLXC templates (pveam)
Backupbackupvzdump archives and PBS
ContainerrootdirContainer root disks and mount points
SnippetssnippetsCloud-init and hook files, see Proxmox Cloud-Init
ImportimportImport sources for the import wizard, such as VMs from ESXi (what else it accepts is unverified)

Not every storage type offers every content type. The drop-down only lists what the selected type supports, for example:

TYPECONTENT TYPES
LVM, RBDimages, rootdir
iSCSIimages, none
CephFSvztmpl, iso, backup, snippets
ZFS over iSCSIimages
ESXiimport

none is for storage you only use as a base for another, such as an iSCSI LUN under LVM. Change the list later with pvesm set <STORAGE> --content images,rootdir. Content types for the other storage types are in the storage chapter (not re-checked here).


Add Storage #

COMMANDDESCRIPTION
pvesm add dir <STORAGE> --path /mnt/<DIR> --content backup,iso,vztmplDirectory
pvesm add nfs <STORAGE> --server <SERVER> --export /<EXPORT> --content images,backupNFS share
pvesm add cifs <STORAGE> --server <SERVER> --share <SHARE> --username <USER> --password <PASS> --content backupSMB/CIFS share
pvesm add zfspool <STORAGE> --pool <POOL>/<DATASET> --content images,rootdir --sparse 1ZFS pool or dataset
pvesm add lvmthin <STORAGE> --vgname <VG> --thinpool <POOL> --content images,rootdirLVM-thin
pvesm add pbs <STORAGE> --server <PBS-HOST> --datastore <DATASTORE> --username <USER>@pbs --fingerprint <SHA256> --password <PASS>Proxmox Backup Server (Proxmox Backup and Restore)
pvesm add lvm <STORAGE> --vgname <VG> --content images,rootdirLVM volume group (LVM)
pvesm add iscsi <STORAGE> --portal <HOST[:PORT]> --target <TARGET> --content noneiSCSI target (iSCSI)
pvesm add cephfs <STORAGE> --monhost "<MON1> <MON2> <MON3>" --fs-name <FS> --content backup --username <USER> --keyring <FILE>CephFS (CephFS and RBD)
pvesm add rbd <STORAGE> --monhost "<MON1> <MON2> <MON3>" --pool <POOL> --content images --username <USER> --keyring <FILE>RBD pool, for an external Ceph cluster (CephFS and RBD)

For a directory on a separate disk: partition, mkfs.ext4, mount via /etc/fstab (use the UUID), then add as dir. Add is_mountpoint 1 on the storage to stop Proxmox writing into the empty mount point if the disk is missing.


Which Type #

TYPESNAPSHOTSSHAREDNOTES
Directory (qcow2)yesnoSimple, any filesystem
LVMyes (volume chains, tech preview)no (can be shared over iSCSI or FC)Thick provisioned block storage, see LVM
LVM-thinyesnoDefault local-lvm, fast, thin provisioned
BTRFSyesnoFile storage, technology preview, see BTRFS
ZFSyesnoChecksums, compression, replication (Proxmox Clustering and HA)
NFSyes (qcow2)yesEasy shared storage, see NFS
CIFSyes (qcow2)yesMainly for backups and ISOs
iSCSInoyesRaw LUNs, normally with LVM on top, see iSCSI
CephFSyes (not guaranteed stable)yesFile storage for ISOs, templates, backups and snippets, see CephFS and RBD
Ceph RBDyes (and clones)yesHyper-converged, needs 3+ nodes. Also usable against an external cluster
ZFS over iSCSIyes (no clones)yesA remote ZFS box serving zvols over iSCSI, see ZFS over iSCSI
ESXin/an/aImport source for migrating VMs, not a place to run guests, see ESXi Import
Lightbits (plugin)yes (crash-consistent)yesNVMe/TCP block storage, third-party plugin, PVE 9.x, see Lightbits SDS
PBSn/ayesBackups only

Snapshot support depends on disk format: raw disks on plain directory storage cannot snapshot, qcow2 can. See Proxmox Disk Image Formats for raw, qcow2 and VMDK.


LVM (Thick) #

Block storage on a volume group, with each VM disk a full-size logical volume. Content types are images and rootdir.

OPTIONDESCRIPTION
vgnameVolume group to use
baseVolume activated first. The docs mention it only for remote iSCSI volumes
saferemoveZero data when a volume is deleted
snapshot-as-volume-chainSnapshots as volume chains (technology preview), see Snapshots as Volume Chain
COMMANDDESCRIPTION
pvesm add lvm <STORAGE> --vgname <VG>Add an existing volume group
pvesm add lvm <STORAGE> --vgname <VG> --snapshot-as-volume-chain 1Same, with volume-chain snapshots
vgs / lvsGroups and volumes

The docs mark LVM as not shared by itself. To share it, put it on an LUN every node can see (iSCSI), but no full walkthrough was found (unverified).


Snapshots as Volume Chain #

The Snapshots as Volume-Chain checkbox (storage option snapshot-as-volume-chain) gives thick LVM storage real VM snapshots. Each snapshot is a thick logical volume holding only the differences from the volume behind it, and taking a snapshot starts a new volume backed by the last. It uses qcow2 only to layer the chain, and the PVE storage layer does the snapshot work, not qcow2’s internal snapshots.

The docs say this avoids the I/O penalty and the dangerous out-of-space behaviour of native LVM snapshots, and that it works on block storage such as iSCSI and FC SANs, with cluster-wide locking when the storage is shared.

TOPICDETAIL
StatusTechnology preview. Introduced in PVE 9.0 and still a preview in 9.1 and 9.2. The roadmap plans to take it out of preview for LVM (thick), Directory, NFS and CIFS
Option--snapshot-as-volume-chain <boolean>, default 0, on pvesm add and pvesm set
ScopeOnly affects newly created disks, and cannot be turned off while a qcow2 image exists on the storage (9.1 notes)
TPM9.1: offline snapshots of VMs with TPM state (machine version 10 or later). 9.2: live snapshots with TPM state, but the top-most snapshot cannot be removed while the VM runs
COMMANDDESCRIPTION
pvesm set <STORAGE> --snapshot-as-volume-chain 1Turn it on for new disks
pvesm config <STORAGE>Check the stored option

Caveats:

  • Each snapshot uses its full size unless the backing storage is thin provisioned and passes through discard.
  • LVM still has no linked clones.
  • The roadmap says migrating VMs that have snapshots on local volume-chain storage is blocked.
  • The docs do not say how existing raw disks, backup, clone or move-disk behave, or how much overhead qcow2 adds. The idea that only new disks become qcow2 is inferred (unverified).
  • The Preallocation setting shown in the same dialog is documented (off, metadata, falloc, full) only for raw and qcow2 images on file-based storage, so how it applies here is (unverified).

BTRFS #

File-based storage on a BTRFS filesystem. The docs mark it as a technology preview and show only a storage.cfg example, not a pvesm add command.

text
btrfs: <STORAGE>
        path /mnt/<BTRFS_MOUNT>
        content rootdir,images
        is_mountpoint 1

Snapshots are supported, and storage is not shared. Treat it as unsuitable for anything you cannot rebuild.


iSCSI #

Raw LUNs from an iSCSI target. The LUNs are not managed per guest, so the usual pattern is content none on the iSCSI storage with LVM on top. Content types are images and none. Table 10 of the docs says no snapshots, though the summary table says “volume chains”, so the per-backend table is trusted here.

COMMANDDESCRIPTION
pvesm scan iscsi <HOST[:PORT]>List targets on a portal
pvesm add iscsi <STORAGE> --portal <HOST[:PORT]> --target <TARGET> --content noneAdd the target
pvesm list <STORAGE>List LUNs

iscsiadm is only mentioned in the docs, without commands, so low-level session commands are not covered here (unverified).


CephFS and RBD #

Both talk to a Ceph cluster, either one built with pveceph (Ceph (overview)) or an external one.

TYPECONTENTKEY OPTIONS
cephfsvztmpl, iso, backup, snippetsmonhost, fs-name, username, subdir, path, fuse
rbdimages, rootdirmonhost, pool, username, krbd, keyring
COMMANDDESCRIPTION
pveceph fs create --pg_num 128 --add-storageCreate a CephFS and add it as storage
pvesm add cephfs <STORAGE> --monhost "<MON1> <MON2> <MON3>" --fs-name <FS> --content backup --username <USER> --keyring <FILE>External CephFS
pvesm add rbd <STORAGE> --monhost "<MON1> <MON2> <MON3>" --pool <POOL> --content images --username <USER> --keyring <FILE>External RBD pool

The keyring file is copied to /etc/pve/priv/ceph/<STORAGE>.keyring for RBD, and the CephFS secret lives at /etc/pve/priv/ceph/<STORAGE>.secret. Set krbd 1 to use the kernel RBD client instead of librbd. CephFS snapshots exist, but the docs do not guarantee they are stable.


ZFS over iSCSI #

Proxmox creates a zvol per disk on a remote ZFS server and attaches it over iSCSI. It is the zfs storage type, and not to be confused with zfspool for local ZFS. The remote host needs an iSCSI target provider and SSH access from every PVE node. Content is images. Snapshots work, clones do not.

OPTIONDESCRIPTION
poolPool or dataset on the remote host
portal / targetiSCSI portal and target name
iscsiprovidercomstar, istgt, iet or LIO
comstar_tg / comstar_hgCOMSTAR target group and host group
lio_tpgLIO target portal group
blocksizezvol block size
sparseThin provision zvols
nowritecacheDisable the write cache

Set up passwordless SSH from each node first:

bash
mkdir /etc/pve/priv/zfs
ssh-keygen -f /etc/pve/priv/zfs/192.0.2.1_id_rsa
ssh-copy-id -i /etc/pve/priv/zfs/192.0.2.1_id_rsa.pub root@192.0.2.1

The key file name starts with the portal address. The docs give storage.cfg examples for each provider but no pvesm add zfs command (unverified). blocksize and sparse are also documented for the local zfspool type.


ESXi Import #

The esxi type connects Proxmox to an ESXi host or vCenter so you can import its VMs. It is for migration, not for running guests. The import wizard is GUI-only, tech preview, added during the 8.2 cycle, and was tested with ESXi 6.5 to 8.0.

OPTIONDESCRIPTION
serverESXi host
username / passwordCredentials
skip-cert-verificationAccept a self-signed certificate
content importImport content type

The docs have no pvesm add esxi example, so add it from Datacenter > Storage > Add > ESXi (unverified from the CLI). Whether qm importdisk applies is not addressed there. Migration context is in Hypervisor Comparison.


LVM-thin #

COMMANDDESCRIPTION
lvsLogical volumes and thin pool usage (watch Data% and Meta%)
vgs / pvsVolume groups / physical volumes
lvdisplay pve/dataThin pool detail
lvextend -L +10G pve/dataGrow the thin pool (free space in the VG needed)

A full thin pool freezes guests. Monitor Data% and do not over-commit heavily.


ZFS #

COMMANDDESCRIPTION
zpool statusPool health
zpool list / zfs listCapacity, datasets and zvols
zpool scrub <POOL>Start a scrub
zfs list -t snapshotSnapshots
zpool import <POOL>Import after a disk move or reinstall
zpool create -o ashift=12 <POOL> mirror /dev/disk/by-id/<DISK1> /dev/disk/by-id/<DISK2>New mirrored pool (use stable by-id paths)
cat /sys/module/zfs/parameters/zfs_arc_maxCurrent ARC limit in bytes (0 = default)

Limit ARC (default can use up to about half of RAM) in /etc/modprobe.d/zfs.conf:

options zfs zfs_arc_max=8589934592

Then run update-initramfs -u -k all and reboot. More ZFS commands in TrueNAS Community Edition.


Ceph (overview) #

Hyper-converged shared storage built into PVE: each node runs MON, MGR and OSD daemons, VMs use RBD pools. Needs at least 3 nodes, a dedicated fast network (10 GbE or more is the usual advice) and one OSD per disk.

COMMANDDESCRIPTION
pveceph installInstall Ceph packages on a node
pveceph init --network <CIDR>Initialise Ceph config (once per cluster)
pveceph mon create / pveceph mgr createCreate monitor and manager on a node
pveceph osd create /dev/<DISK>Create an OSD from a disk
pveceph pool create <POOL> --add_storagesCreate a pool and add it as storage
ceph -sCluster health
ceph osd treeOSDs and hosts

Not verified against the docs. Read the Ceph chapter before building a cluster.


Lightbits SDS (NVMe/TCP) #

Lightbits (LightOS) is software-defined block storage served over NVMe/TCP. It is not built into PVE: the community-supported pve-lightbits plugin adds a lightbits storage type, and each VM disk becomes one Lightbits volume (vm-<VMID>-<VMGENID>-disk-<N>). It is shared storage, so live migration moves no disk data.

Plugin: LightBitsLabs/pve-lightbits · Lightbits docs

Requirements (per the plugin README): PVE 9.x, LightOS 3.x, Perl 5.36 or newer, kernel 5.0 or newer with nvme_tcp, and the nvme-cli and discovery-client packages. Network ports to the Lightbits cluster: 443 (REST API), 4420 (NVMe/TCP I/O) and 8009 (discovery). Only NVMe/TCP is supported.

Install on every node: clone the repository and run its installer (scripts/install.sh). It installs the module, pulls in nvme-cli and discovery-client if missing and restarts the PVE daemons. Re-run it to upgrade. The uninstaller refuses to run while lightbits storage entries exist, so remove them first with pvesm remove.

OPTIONDESCRIPTION
lb_api_hostRequired. Comma-separated <HOST>:443 list of Lightbits API endpoints
lb_jwtRequired. API token, kept in /etc/pve/priv/storage/<STORAGE>.pw
lb_nvme_host<HOST>:4420 list used to seed discovery-client
lb_projectLightbits project (default default)
lb_replica_countReplicas per volume (default 1; the README suggests 3 on three or more nodes)
lb_owner_idOwnership label (default: node hostname). Set one value cluster-wide
lb_subsys_nqnSubsystem NQN. Fetched from the API unless pinned here
lb_fingerprintSHA-256 certificate pin (a list is accepted for rotation)
lb_ssl_verify / lb_ca_fileTLS verification (default off) and the CA file used when it is on
content imagesVM disks (the only content type in the README examples)
shared 1Needed on a multi-node cluster

Add the storage from the CLI with pvesm add lightbits <STORAGE> plus the options above. The GUI “Add Storage” dialog does not list this type. Change settings later with pvesm set <STORAGE> <OPTION> <VALUE>.

COMMANDDESCRIPTION
pvesm statusStorage state and capacity
pvesm list <STORAGE>Lightbits volumes the plugin manages
pvesm config <STORAGE>Stored options for the storage
nvme listNVMe devices the node sees
cat /etc/nvme/hostnqnHost NQN (must be allowed on the Lightbits side)
systemctl status discovery-clientDiscovery service state
lsmod | grep nvme_tcpKernel module loaded
nc -zv <HOST> 4420 / nc -zv <HOST> 8009Check I/O and discovery ports are reachable
journalctl -u pvestatd -n 50Plugin errors reported by the status daemon
lbcli create jwtCreate a new token when lb_jwt has expired (run against the Lightbits cluster)

Behaviour to know about:

  • Snapshots and native rollback work but are crash-consistent. A snapshot cannot be attached, and backup or clone from a snapshot is not supported. Deleting a disk deletes its snapshots.
  • Only full clones work, not linked clones. Resize is grow-only.
  • Live migration (qm migrate <VMID> <NODE> --online) and HA restart on another node work.
  • The plugin writes /etc/discovery-client/discovery.d/lightbits-<STORAGE>.conf and symlinks volumes under /dev/lightbits/<STORAGE>/. It only manages volumes it labelled itself.

Not verified. Facts come from a read of the plugin README and Lightbits docs, not from running it. The installer path was taken from a search snippet, and the literal pvesm add example was not captured, so check the README for the exact syntax. The Lightbits product page mentions PVE 8.x, the README says 9.x. Check the README for current versions.


Check Free Space and Clean Up #

COMMANDDESCRIPTION
df -h /var/lib/vzSpace on local
du -sh /var/lib/vz/dump/*Backup sizes
journalctl --vacuum-size=500MTrim the journal
apt cleanClear the package cache
Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.