Development guidelines

Here you can find definitions of the formats used for serializing and storing StorPool Proxmox VE data. This information is mainly intended for developers who work on improving the plugin.

Note

Boolean values are encoded as “0” or “1” when represented as strings.

Object names stored in the Proxmox VE database

The object name is stored as a string resembling a filename, but structured. The types of objects supported by the StorPool plugin are as follows:

Tag

Type

Description

vm-<vm_id>-disk-<disk_id>-sp-<global_id>.raw

volume

A disk attached to a VM

base-<vm_id>-disk-<disk_id>-sp-<global_id>.raw

snapshot

A disk attached to a VM template.

snap-<vm_id>-disk-<disk_id>-<snapshot_id>-p-<parent_id>-sp-<global_id>.raw

snapshot

A Proxmox snapshot of a VM disk.

snap-<vm_id>-state-<snapshot_id>-sp-<global_id>.raw

volume

A Proxmox snapshot of the current state (RAM, CPU, and so on) of a running VM.

img-<id>-sp-<global_id>.raw

snapshot

A ‘freestanding’ disk image, one not attached to any VM, but uploaded to the StorPool-backed storage in some other way. This may be ,for example, a cloud image to be imported as a VM’s root disk.

<id>-sp-<global_id>.iso

snapshot

An ISO image to attach to VMs as a CD/DVD drive.

Some field clarifications:

  • The vm_id portion must consist of digits only, and must represent a decimal non-negative integer number not less than 100.

  • The disk_id portion must consist of digits only, and must represent a decimal non-negative integer number.

  • The global_id portion must be a valid StorPool global ID; it identifies the volume or snapshot where the data is stored.

  • The snapshot_id portion must be in the Proxmox identifier format.

  • The parent_id portion must be a valid StorPool global ID.

  • The id portion must be in the Proxmox identifier format.

Volume and snapshot tags

Tag

Type

Description

virt

string

The constant string ‘pve’.

pve-loc

string

The short name (‘slug’) of the Proxmox VE cluster to distinguish volumes defined on it from ones defined for other Proxmox VE clusters sharing the same StorPool deployment.

pve

string

The storage-id of the Proxmox storage that this volume or snapshot belongs to.

pve-type

string

The content type of the Proxmox VE object stored in this volume or snapshot, e.g. ‘images’, ‘iso’, and so on.

pve-vm

integer

The ID of the Proxmox VE virtual machine that this object belongs to.

pve-disk

integer

A monotonically increasing ‘number’ of the disk within that VM.

pve-base

boolean

Is this a base image; for example, a disk belonging to a VM template as opposed to one belonging to an actual VM.

pve-comment

string

An optional comment describing e.g. an ISO image or a cloud root disk image.

pve-snap

string

The name of the VM snapshot that this disk is part of, if any.

pve-snap-v

string

The volume that this disk represents in the VM snapshot, if any.