Separate backups for virtual disks within the same VM

WillGFC

Member
Oct 4, 2020
14
2
8
44
I'm running Nextcloud and a few other things within an Ubuntu VM

For a long time, I had 3 hdd passed through to the vm and used them in a raidz1 to store the nextcloud data, with the vm itself having its os installed on a zfs managed by pve

I've been uncomfortable about the fact that the data storage had no backups, so yesterday I bit the bullet and rsynced the data zpool to a new virtual hard disk on a temporary hdd, installed pbs and carried out a full backup, made a new zfs pool on pve from the existing hdds and moved the storage.


Today I've been backing up everything else end of course I managed to break the ubuntu vm so I thought now was a great time to put pbs to the test. I wasn't too concerned because I have the data itself backed up on the pcs/phones that sync to it, and pbs, and the virtual hard drive on the new zfs pool and the virtual hard drive on the temporary disk so it was probably the best time for it to happen.


But now I've discovered a flaw in my plan. Restoring the vm now means I have to restore not only the 40GB os storage, but also the 3.5TB data storage.
That 3.5TB will also be expanded in future to 6TB or 8TB when I get some larger disks for the new backup server.


I'm currently trying out the live restore function which seems like some kind of witchcraft given I seem to already have mostly full functionality with only a fraction of the restore complete, but I'd prefer to not have to stress the disks by having to do a full restore when I only need to restore the os storage drive and not the data drive.


The vm originally started out as a bare metal server and the only times I've ever needed to restore the data drive is when I'm moving it, but the OS has broken a few times, particularly during version upgrades and I usually create a second vm I can work on while I'm home to get things up and going again, while leaving the working version intact and ready to spin up if I'm going out, while migrating the data storage between them.



Is there any way to exclude the data storage from the actual vm backup (by unchecking the backup box within the storage configuration) but push that hard disk image to pbs on its own so it's still getting backed up every day but doesn't have to be restored with the vm?
 
I've noticed in the documentation that you can restore single archives from the backups but I'm not sure it matches specifically what I want to do.

The main storage containing the OS on the VM in question is scsi0. scsi1 is a separate swap disk that I'm also not concerned about restoring, scsi 2 is a 3.5TB image. There's currently just under 1TB of data contained on the image, but yesterday's restore still took 10 full hours.

proxmox-backup-client restore vm/162/2024-07-28T22:35:44Z drive-scsi0-.img.fidx /target/path/


I'm not even sure if that would work, but I'm also not sure what the target should actually be.

I can't find where to "see" the hard disk images from the terminal. The storage is found at /dev/zvol/vms/ but it doesn't list the files in the same way the UI shows them (ie a single file for scsi0 that I could then restore the backed up data to.)
Code:
13:56:31 [root@sazed ~]# ls -la /dev/zvol/vms/
...
lrwxrwxrwx 1 root root  10 Jul 30 12:30 vm-162-disk-0 -> ../../zd96
lrwxrwxrwx 1 root root  12 Jul 30 12:30 vm-162-disk-0-part2 -> ../../zd96p2
...


Code:
14:13:56 [root@sazed ~]# ls -la /dev/

...
brw-rw----  1 root disk    230,  96 Jul 30 14:13 zd96
brw-rw----  1 root disk    230,  98 Jul 30 12:30 zd96p2
...

Similarly, without a single file on the PVE terminal for the 3.5TB data image, I'm not sure how I would send this directly to PBS.


I have 3 thoughts of how I could manage backups/restores in a way where I don't have to restore the entire data image (remember, this took 10 hours)


1 - as per the thread title, I need a way to have the data disk not being backed up with the VM itself but given my inability to find the actual image on the PVE terminal, I can't even begin to try to find out how to back it up separately.

2 - a method to restore only the OS image during a restore, leaving the data image intact. I don't mind if this can't be a live restore and if I have to manually reassign the data image to the VM afterwards - this is what I've been doing up to now anyway with the 3 passed through hard disks

3 - move the data disk to a separate, standalone VM or container and share the storage over smb/nfs. This method isn't very desirable. The data itself has a lot of different samba and nfs shares with different ownerships, not to mention the nextcloud data dir which I know from experience can be very prickly about ownership and permissions.



The one advantage of option 3 would be that a dedicated storage vm/ct would not be shut down very often, probably only when the hose needs rebooted, and in my initial experiences with PBS, the first backups after a reboot of the guest takes a little longer because it has to rescan the entire disk even if it isn't syncing very much.
That also leads me to believe I'd have to have a dedicated storage machine as a full VM though since the lxc containers firstly don't appear to freeze and thaw in the same was a a VM does, and they also seem to ALWAYS have to do a full check of the data
 

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!