DaVieS007 / bhyve-webadmin

FreeBSD Bhyve Web Administration Software
Other
96 stars 13 forks source link

Snapshot, backup and import VMs #40

Open sysbpfeiffer opened 1 year ago

sysbpfeiffer commented 1 year ago

Hello,

What's the best way to snapshot, backup, and import VMs created with BVCP?

Best – Daniel

tatuzemdp commented 1 year ago

+1 here, how can we clone a VM?

DaVieS007 commented 1 year ago

Bhyve itself does not support snapshots yet, snapshot can be taken at filesystem level like if you are using ZFS. There are future-plans to integrate ZFS features into VM management, so snapshot, clone will be supported on future release.

tofazzz commented 8 months ago

What's the best practice for VMs backup/restore (even without ZFS) ?

DaVieS007 commented 8 months ago

Well, I suggest to use ZFS and snapshots.

BVCP does not implies any backup and restore strategy and there is no such a plan for the future.

In any other case the same rule should be followed just as like any regular backup and restore, except those files are heavy and copying while in use will lead to invalid backups that cannot be restored.

Copy and restore the whole images are heavy workload and completely unecessary while we have snapshots. FYI. UFS has snapshots too.

But sometimes we must handle those files, thats why the BVCP uses file-based disks to make it easier. If you want handle disks natively without using snapshot, take a look at my another project, it might help you.

https://github.com/DaVieS007/Partial-File-Recovery

tofazzz commented 8 months ago

Thank you for then info!

Beside the use of ZFS (let's assume I stop all the VMs to take a backup) what are the folders needed to be restored on a new server to have the same exact configuration after a loss?

DaVieS007 commented 8 months ago

I recommend you as a general rule, to test well the backup scheme on non-live systems. The BVCP uses it's configuration located in /var/lib/nPulse/BVCP folder. Every virtual machine's virtual disk located BY DEFAULT at /vms location.

To fully restore a configuration you should save both. To restore only a virtual machine, you should restore only it's image file (virtual disk).