Hi all,
I’m trying to understand how Proxmox Backup Server (PBS) works with QEMU dirty bitmaps (.qcow2).
I created a virtual machine and run it like this:
Then I use QMP (JSON) to create snapshots:
As a result, I have two files:
Then I use PBS client to back them up:
When I restore the latest snapshot, hoping to get a “ready-to-use” qcow2 image:
The restored file has exactly the same size as debian-incr.qcow2. I was expecting a full, ready-to-use image.
I assume I’m missing something here. Could someone clarify:
- Does PBS automatically know which file is the “backing file” when backing up incremental qcow2 images?
- Is the way I create snapshots using QMP the correct approach for PBS incremental backups?
Any insights would be much appreciated!
I’m trying to understand how Proxmox Backup Server (PBS) works with QEMU dirty bitmaps (.qcow2).
I created a virtual machine and run it like this:
Code:
qemu-system-x86_64 \
-m 2048 \
-smp 2 \
-blockdev driver=qcow2,file.driver=file,file.filename=/root/vm/debian.qcow2,node-name=drive0 \
-device virtio-blk-pci,drive=drive0 \
-net nic \
-net user,hostfwd=tcp::2222-:22 \
-name test-vm \
-nographic \
-serial tcp:127.0.0.1:4444,server,nowait \
-monitor none \
-qmp unix:/tmp/qmp-sock,server,nowait
Then I use QMP (JSON) to create snapshots:
Code:
# enable QMP capabilities
{ "execute": "qmp_capabilities" }
# create a new dirty bitmap
{
"execute": "block-dirty-bitmap-add",
"arguments": { "node": "drive0", "name": "pbs", "persistent": true }
}
# if bitmap exists but is not recording, remove and re-add:
{ "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0", "name": "pbs" } }
{ "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0", "name": "pbs", "persistent": true } }
# full backup
{
"execute": "drive-backup",
"arguments": {
"device": "drive0",
"target": "file:/root/vm/backups/debian-full.qcow2",
"sync": "full",
"job-id": "fullbackup1"
}
}
# clear bitmap
{
"execute": "block-dirty-bitmap-clear",
"arguments": { "node": "drive0", "name": "pbs" }
}
# make some changes inside VM
# dd if=/dev/urandom of=/root/1gb-random.img bs=1M count=1024 status=progress
# incremental backup
{
"execute": "drive-backup",
"arguments": {
"device": "drive0",
"target": "file:/root/vm/backups/debian-incr.qcow2",
"sync": "incremental",
"bitmap": "pbs",
"job-id": "backup1"
}
}
# reset bitmap after backup
{
"execute": "block-dirty-bitmap-clear",
"arguments": { "node": "drive0", "name": "pbs" }
}
As a result, I have two files:
Code:
root@localhost:~/vm/backups# ll
-rw-r--r-- 1 root root 3523280896 Nov 28 16:24 debian-full.qcow2
-rw-r--r-- 1 root root 5373952 Nov 28 16:25 debian-incr.qcow2
Then I use PBS client to back them up:
Code:
proxmox-backup-client backup debian.img:/root/vm/backups/debian-full.qcow2 --repository pasiu@pbs!token@127.0.0.1:bkup_pbs
proxmox-backup-client backup debian.img:/root/vm/backups/debian-incr.qcow2 --repository pasiu@pbs!token@127.0.0.1:bkup_pbs
When I restore the latest snapshot, hoping to get a “ready-to-use” qcow2 image:
Code:
proxmox-backup-client snapshots --repository pasiu@pbs!token@127.0.0.1:bkup_pbs
proxmox-backup-client restore host/localhost/2025-11-28T16:27:02Z debian.img /root/vm/backups/restore.qcow2 --repository pasiu@pbs!token@127.0.0.1:bkup_pbs
The restored file has exactly the same size as debian-incr.qcow2. I was expecting a full, ready-to-use image.
I assume I’m missing something here. Could someone clarify:
- Does PBS automatically know which file is the “backing file” when backing up incremental qcow2 images?
- Is the way I create snapshots using QMP the correct approach for PBS incremental backups?
Any insights would be much appreciated!