VM backup without downtime?

KoenDG

New Member
May 31, 2022
10
0
1
Coming from this thread: https://forum.proxmox.com/threads/understanding-storage-requirements-for-snapshots.128444/

I'm looking for a way to do backups of running VMs without downtime. The idea is to have a full backup, that can be moved to other parts of a cluster, or different proxmox machines, and restored, fully functionally identical.

This would be exclusively for VMs, not containers.

This would be towards NFS storage that's added specifically for backups.

I'm reading here: https://pve.proxmox.com/wiki/Backup_and_Restore#_backup_modes

That only snapshot mode can avoid downtime, at the risk of inconsistency. I'm assuming this does mean all data, though I would expect going over NFS might make things slower.

Also, I ran into this: https://git.proxmox.com/?p=pve-qemu.git;a=blob_plain;f=backup.txt

Describing this process:
Another approach to backup VM images is to create a new qcow2 image
which use the old image as base. During backup, writes are redirected
to the new image, so the old image represents a 'snapshot'. After
backup, data need to be copied back from new image into the old
one (commit). So a simple write during backup triggers the following
steps:
Is this possible, or is the document a proposal?

I was told something about merging backups and snapshots, though I'm finding nothing that says this is possible.

To summarize:

* Backups without downtime
* VMs, not containers
* Towards NFS storage intended for backups(by which I mean that's what I click in the proxmox gui)
* Full restore of the VM, on the same proxmox install or equivalent on different machine


Am I right in reading that snapshot mode supports this, with the risk of some inconsistency?

I'm running 7.4, just to mention it.
 
I backup a VM that I use as a desktop (USB and GPU passthrough) and other VMs on ZFS and backup fully to PBS every hour (in snapshot mode) and I don't even notice it. As long as the VM storage type supports it and you have the QEMU Guest Agent installed and running it works fine. It also works without PBS but it takes longer (still without me noticing anything inside the VM). In some cases you need to setup something to flush data in memory to disk for some software, like databases, otherwise you can get inconsistencies but it depends on your case.
Note that if you restore and start on the same network, you might have issues with duplicate IP address when they are fixed inside the VM.
 
Last edited:
  • Like
Reactions: LnxBil
Guess you are right. Only some storage types can do snapshots internally and some others will use other ways to make a snapshot. Thank you for correcting this.
The backup snapshot is always done without any interaction with the underlying back storage. It is always done in memory. This is often missunderstood because they both are named snapshot (and they are snaphots) but of different kinds and on different levels.
 
  • Like
Reactions: leesteken
The backup snapshot is always done without any interaction with the underlying back storage. It is always done in memory. This is often missunderstood because they both are named snapshot (and they are snaphots) but of different kinds and on different levels.
So, it's written to RAM? What happens is there's not enough free RAM? And is this a case of first going to RAM and then to whatever is used as backup storage?

I backup a VM that I use as a desktop (USB and GPU passthrough) and other VMs on ZFS and backup fully to PBS every hour (in snapshot mode) and I don't even notice it. As long as the VM storage type supports it and you have the QEMU Guest Agent installed and running it works fine. It also works without PBS but it takes longer (still without me noticing anything inside the VM). In some cases you need to setup something to flush data in memory to disk for some software, like databases, otherwise you can get inconsistencies but it depends on your case.
Note that if you restore and start on the same network, you might have issues with duplicate IP address when they are fixed inside the VM.

Also, thanks leesteken for that experience. I had not considered the situation where inside the VM software keeps things in RAM.

I recall snapshots can take RAM into account, but backup snapshots are different.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!