Page 1 of 1
Creating secure backups
Posted: 25. Aug 2013, 20:24
by tY Software
Hi,
some time ago I set up a debian server guest in VirtualBox. This server needs to be backed up every day, so I have to write a backup tool.
Until now I couldn't find a secure way to get a backup. When I copy the whole directory of shutdown guest to an other machine, I will not be able to start the guest there. Beside this it would be important to have no long downtime, so it would be great if there would be a way to backup a running VM.
I found many threads discussing this topic, but I couldn't find any good answer.
Is there any secure and working way to create a backup of a vm which can be started on other machines and don't have to fear that the VM breaks while taking a backup?
Thanks in advance!
Re: Creating secure backups
Posted: 25. Aug 2013, 21:10
by Perryg
Nothing beats a complete backup, and the best way has always been to store the data in a separate partition from the OS which is really the hard part to backup while running. Then you can clone the OS and be able to switch very fast . Then add the data source back to the clone. The data part can be backed up using your favorite hot backup software.
I use rdiff for Linux and you can also use it for Windows but you need to learn how. (google rdiff)
Re: Creating secure backups
Posted: 27. Aug 2013, 17:34
by tY Software
Hi,
thanks for your response!
I found out that the reason for my problems when trying to start a copied vm on a test host were some misconfigurations in this host. Now I can start a copied vm, but i will have to find out how to manage the snapshots.
Is there any way to start snapshots when the whole vm was moved to another host?
If this was possible I think I could just take a snapshot, then copy the whole vm directory and when I need to restore just start the backup from the last snapshot (which should not be corrupted). If this would work there wouldn't be a need for a long downtime.
Re: Creating secure backups
Posted: 27. Aug 2013, 17:43
by Perryg
Snapshots as reliable backups? Big mistake!
Re: Creating secure backups
Posted: 28. Aug 2013, 14:03
by tY Software
OK, i see.
The problem is that i need to keep at least old (already existing) snapshots.
What about following idea:
I keep a copy of actual cm including all snapshots. Then i remove all snapshots from the active vm. Then I write a script which does the following (with vboxmanage) every day: turn off with acpi -> copy vhd to temp location -> start vm -> pack copy of vhd and move to external drive.
Is this a good solution where i don't have to fear any problems when restarting vm or restoring the data from backup?
Re: Creating secure backups
Posted: 28. Aug 2013, 14:19
by Perryg
That would be better, but you still have one part that is delicate. VHD. This type has a header and a footer in the image file and is more likely to become corrupt, especially if the power fails and you have a power pull episode. VDI is the default with VirtualBox and I find it more stable.
Then in your spare time you can figure out how to build a replacement that has the data stored separately and you can use a true backup.
Re: Creating secure backups
Posted: 28. Aug 2013, 22:57
by tY Software
Ok, thanks for your help!