Proper method to backup a virtual machine storage repository (vhd) to cloud?

dbsoundman

Dabbler
Joined
Feb 20, 2021
Messages
26
Hi all, I have an XCP-ng virtual machine host with one VM (nextcloud) that has an NFS-connected storage repository on my TrueNAS machine. This means that the virtual machine has mounted this share as a disk, and so XCP-ng creates VHD files on that share instead of flat files.

I set up that share to backup to Backblaze B2 every so often, but it always failed. I recently looked at the logs and realized this is because one or more of the VHD files would be active and change while the backup operation was taking place. Given this, what is the correct way to backup these types of mounted volumes to a cloud backup service? Should I use the "Take Snapshot" option or something different?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Can you shut down the VM just before the Backblaze backup, and then start the VM up again afterwards?
 

dbsoundman

Dabbler
Joined
Feb 20, 2021
Messages
26
Can you shut down the VM just before the Backblaze backup, and then start the VM up again afterwards?
I had considered that, but the backup historically takes like 13 hours to complete, my internet connection is 6 Mbps up max. It might get to be faster if I can get one successful run though, it's set to SYNC so subsequent runs should be smaller...

obviously it would be less overhead for me if I could get the backup to work without having to synchronize the VM shutdown first.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You'll need another pool, as you'll need to separate the VHD backup from the B2 cloud sync:
  • Set up another pool to replicate with your pool which shares out NFS to your VM.
  • Shutdown the VM, kick off a replication cycle from pool1 to pool2. After the replication completes, restart the VM.
  • Cloud sync from pool2 to B2.
 

dbsoundman

Dabbler
Joined
Feb 20, 2021
Messages
26
You'll need another pool, as you'll need to separate the VHD backup from the B2 cloud sync:
  • Set up another pool to replicate with your pool which shares out NFS to your VM.
  • Shutdown the VM, kick off a replication cycle from pool1 to pool2. After the replication completes, restart the VM.
  • Cloud sync from pool2 to B2.
Hmm, so clearly I went about this all wrong. I have an iXSystems mini system, 4 disks, all one pool in a RAID10 style configuration, so I can’t add a pool. I migrated my Nextcloud data and database over to the NFS share as a VM disk because that seemed to be the most solid setup in terms of throughput, but that of course means I would have to follow the above procedure to do a proper backup.

Maybe I should set up the VM to backup to Backblaze directly instead?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Maybe I should set up the VM to backup to Backblaze directly instead?

That's a possibility. Another is to migrate to the built-in NextCloud plugin, and use a jail mount instead of an NFS mount. You can then replicate the jail mount dataset to a backup dataset, and backup the backup dataset to B2.
 
Top