I have read a lot about virtualbox backups and every single one of them says that you need to pause or shutdown the VM in order to backup.
I come from a long history of VMs, using virtualbox for years (but not in last 5-10 years or so), vmware, xenserver and more, but these were always sidelines for me, i learnt them because i needed to run software on them.
anyway, to my question, if i created a script that did the following, would the backups prove consistent?
- Get list of VMs
Check status of VM
If not running, get list of VDI's and snapshots, backup config, VDI's and snapshots (could also check backup files hash compared to currect or similar)
If Running, Check if VM has live-backup config (not sure how to do this, maybe a file in the VM directory with the config file or something), if live backup:- backup config
get a list of VDI and snapshot file locations into memory (for later backup)
create new "backup" snapshot (so this is the only file being updated)
copy VDI's collected from previous list to backup location
once copy complete remove "backup" snaphost
- backup config
get a list of VDI and snapshot file locations into memory (for later backup)
Pause the VM
create new "backup" snapshot (so this is the only file being updated)
Resume the VM
copy VDI's collected from previous list to backup location, plus the new ".sav" file
once copy complete remove "backup" snaphost
- backup config
I am looking for constructive feedback as to why this will or not work ... not just "it wont work" ... tell me why ... whats not going to work with it, how can i work around that?
I want to be able to backup VMs like firewalls that really need to remain running 24/7, but backups would make faster restore sooooo much easier ... things like windows DB servers would still need to be paused to allow allow memory to be saved.