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!
Creating secure backups
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Creating secure backups
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)
I use rdiff for Linux and you can also use it for Windows but you need to learn how. (google rdiff)
-
tY Software
- Posts: 15
- Joined: 25. Aug 2013, 19:07
Re: Creating secure backups
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.
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.
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Creating secure backups
Snapshots as reliable backups? Big mistake!
-
tY Software
- Posts: 15
- Joined: 25. Aug 2013, 19:07
Re: Creating secure backups
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?
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?
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Creating secure backups
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.
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.
-
tY Software
- Posts: 15
- Joined: 25. Aug 2013, 19:07
Re: Creating secure backups
Ok, thanks for your help!