Page 1 of 1
Live backups / VM syncing
Posted: 6. Mar 2018, 20:44
by omega1
Hi all,
I'm a very happy Virtualbox user for a number of years now and use it in a production environment, very stable and no issues. Can't fault it.
The killer feature for me would be some kind of live backup or VM sync from host to host so that I do not have to power down VM's in a production environment to take a copy of my VM's in the case of a host failure.
I'm wondering what solutions people have in terms of creating backups without powering down, which, to my knowledge is still the only way to create a VM backup?
Does anyone 'in the know' know if this is something that could be implemented at any stage in the near/mid term?
Thanks in advance!
Re: Live backups / VM syncing
Posted: 6. Mar 2018, 23:20
by socratis
I've deleted your duplicate post from the "Suggestions" section. According to the forum rules,
duplicate posts are not allowed.
Let me address the biggest question here first. It is NOT VirtualBox's job to provide you with a backup functionality. It is not within the scope of what the program does. In fact, I don't think that a backup is within the scope of
any program, unless it's a backup program.
Second, live backups are not an easy thing to do. Too many variables, file locks, modifications in files/RAM contents while the backup is going on. That's why there's not only backup programs, like before, but there are specialized backup programs for live backups.
Having said that, and I may be called a heretic for this, here's a scenario that
could work.
This is for educational purposes only.
Follow the instructions at your own risk.
Assuming that your VM is called "TEST":
- Take a snapshot, snapshot A, while your VM is up and running. This will create a new "{A}.vdi" and a "A.sav" file. The first contains the modifications to the disk sectors and the latter contains the RAM contents.
- Copy the "TEST.vbox" and "TEST.vdi" to your backup location. The "TEST.vbox" contains now the information about snapshot A, including filename references to the .vdi and the .sav files.
- Take a second snapshot, snapshot B. That will ensure that the "{A}.vdi" and "A.sav" contents will not be changing in real-time as you are copying the file's contents. You will get as a bonus a "{B}.vdi" and a "B.sav" additional files.
- Copy the "{A}.vdi" and "A.sav" files to the Snapshots sub-directory of your backup. Actually if you have previous snapshots in there it would be best if you copy the whole Snapshots sub-directory, except the "{B}.vdi" and a "B.sav" files.
- Delete snapshots A and B.
- Profit...?
Notes:
- There are no "{A}.vdi", "A.sav", "{B}.vdi" and a "B.sav" files. These are examples.
- Your "backup" is going to be a VM that's live.
- It would be best if you performed all the above while the VM was not in the middle of a big database update, a huge file copy, or that 40-day differential equation solution run.
- Do NOT modify your real hardware or your VirtualBox version. This includes network connections and conditions. The restore will most probably fail.
- Do NOT rely on this backup, that's for convenience only.
- Always perform a proper VM folder copy with the VM completely shutdown.
- Experiment and get the procedure right, before you attempt anything on a valuable VM.
Re: Live backups / VM syncing
Posted: 7. Mar 2018, 12:49
by omega1
Hi @socratis,
Sorry for the double post, I was looking for ideas and also wanted it to be in the suggestions part at the same time.
Thanks for taking the time to answer my post, I appreciate you taking the time to respond. I completely agree with you, backups are entirely up to the individual BUT.. it would be great to have such a feature in Virtualbox. I guess the word I should have used in my original post was
replication rather than backups.
I guess I'm looking at functionality such as Hyper-V's replication feature. I wondered if this was something that could be introduced into Virtualbox at any time in the future...
I'll give your scenario a try, thank you.