]> git.proxmox.com Git - pve-storage.git/commit - PVE/Storage.pm
add BTRFS storage plugin
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 22 Jun 2021 12:18:20 +0000 (14:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 18:20:31 +0000 (20:20 +0200)
commitaf50c2e67101c8242da5a9837387c6e6a13510b6
tree809d5fc678a037c9d2a2424f80663d29e6d865ab
parentbba10cf4afc10a1a376051c16e4e9a2a60b35aac
add BTRFS storage plugin

This is mostly the same as a directory storage, with 2 major
differences:

* 'subvol' volumes are actual btrfs subvolumes and therefore
  allow snapshots
* 'raw' files are placed *into* a subvolume and therefore
  also allow snapshots, the raw file for volume
  `btrstore:100/vm-100-disk-1.raw` can be found under
  `$path/images/100/vm-100-disk-1/disk.raw`
* in both cases, snapshots add an '@name' suffix to the
  subvolume's directory name, so snapshot 'foo' of the above
  would be found under
  `$path/images/100/vm-100-disk-1@foo/disk.raw`
  or for format "subvol":
  `$path/images/100/subvol-100-disk-1.subvol@foo`

Note that qgroups aren't included in btrfs-send streams,
therefore for now we will only be using *unsized* subvolumes
for containers and place a regular raw+ext4 file for sized
containers.
We could extend the import/export stream format to include
the information at the front (similar to how we do the
"tar+size" format, but we need to include the size of all
the contained snapshots as well, since they can technically
change). (But before enabling quotas we should do some
performance testing on bigger file systems with multiple
snapshots as there are quite a few reports of the fs slowing
down considerably in such scenarios).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/Storage.pm
PVE/Storage/BTRFSPlugin.pm [new file with mode: 0644]
PVE/Storage/Makefile