As far as I know, there are a few methods we can use to backup a vm:
1. copy the vdi file manually
2. clonehd the vdi
3. use "export applicance"
The vdi file of my vm is 40GB. It takes a lot time to do a full backup.
I'm wondering, is there a way to backup a vm incrementally, i.e. only backup
the differences I made to a vm since the last backup?
any ideas?
How to backup a vm incrementally
-
- Posts: 59
- Joined: 29. Oct 2009, 18:34
- Primary OS: Ubuntu other
- VBox Version: PUEL
- Guest OSses: Various Linux Distros
- Location: Stuttgart, Germany
Re: How to backup a vm incrementally
What about this:
* For the first backup, create a snapshot and copy the baseline vdi file (probably roughly 40GB)
* Since you created a snapshot, the basline vdi file will not be modified any more, so it is constant
* For the next backup, create another snapshot and copy the differencing vdi file (size depends on the number of changes you made in the meantime)
* Since you created two snapshots, the baseline vdi file and the differencing vdi file will not be modified any more, so they are constant
* and so on...
You end up with lots of snapshots. You may delete/merge old snapshots.
Note: I didn't try to do backups like this. It is just an idea. Not sure if it will work.
Best regards, Uli
* For the first backup, create a snapshot and copy the baseline vdi file (probably roughly 40GB)
* Since you created a snapshot, the basline vdi file will not be modified any more, so it is constant
* For the next backup, create another snapshot and copy the differencing vdi file (size depends on the number of changes you made in the meantime)
* Since you created two snapshots, the baseline vdi file and the differencing vdi file will not be modified any more, so they are constant
* and so on...
You end up with lots of snapshots. You may delete/merge old snapshots.
Note: I didn't try to do backups like this. It is just an idea. Not sure if it will work.
Best regards, Uli
-
- Posts: 7
- Joined: 26. Dec 2010, 13:43
- Primary OS: MS Windows 7
- VBox Version: PUEL
- Guest OSses: linux
Re: How to backup a vm incrementally
Good idea. But how can I use the baseline vdi and the snapshots vdi to reconstruct a working vm?
uli100 wrote:What about this:
* For the first backup, create a snapshot and copy the baseline vdi file (probably roughly 40GB)
* Since you created a snapshot, the basline vdi file will not be modified any more, so it is constant
* For the next backup, create another snapshot and copy the differencing vdi file (size depends on the number of changes you made in the meantime)
* Since you created two snapshots, the baseline vdi file and the differencing vdi file will not be modified any more, so they are constant
* and so on...
You end up with lots of snapshots. You may delete/merge old snapshots.
Note: I didn't try to do backups like this. It is just an idea. Not sure if it will work.
Best regards, Uli
Re: How to backup a vm incrementally
Make the vdi immutable and backup the single snapshot, this does rely on some vbox versions which have a bug where this snapshot is not deleted but again this snapshot can grow beyond the main vdi.
Consider using rsync with the inplace sync option.
Consider using rsync with the inplace sync option.
[This space is intentionally left blank]
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
Re: How to backup a vm incrementally
I use bacula for backup with full backups every month, differential every week and daily incremental. Before the job a shell script is run that manages VM snapshots:
A full backup deletes all snapshots, so that a single base vdi is stored. For differential only daily snapshots are deleted, which consolidates the changes into a single weekly difference. Every day and week new snapshots are taken and labeled as such.
To get back an old version I restore the preceding full and differential backups and some incrementals. That gives me the base vdi and snapshots and the machine description belonging to the target state. Only the execution state gets lost if a machine was running during the backup. Or the script might shut down or save the machines. Anyway, after moving the restored files into place the machines should just work.
MfG, Ulrich
A full backup deletes all snapshots, so that a single base vdi is stored. For differential only daily snapshots are deleted, which consolidates the changes into a single weekly difference. Every day and week new snapshots are taken and labeled as such.
To get back an old version I restore the preceding full and differential backups and some incrementals. That gives me the base vdi and snapshots and the machine description belonging to the target state. Only the execution state gets lost if a machine was running during the backup. Or the script might shut down or save the machines. Anyway, after moving the restored files into place the machines should just work.
MfG, Ulrich
-
- Posts: 7
- Joined: 26. Dec 2010, 13:43
- Primary OS: MS Windows 7
- VBox Version: PUEL
- Guest OSses: linux
Re: How to backup a vm incrementally
Which files do I need to backup besides the snapshot files in order to reconstruct a vm with snapshots?
hustille wrote:I use bacula for backup with full backups every month, differential every week and daily incremental. Before the job a shell script is run that manages VM snapshots:
A full backup deletes all snapshots, so that a single base vdi is stored. For differential only daily snapshots are deleted, which consolidates the changes into a single weekly difference. Every day and week new snapshots are taken and labeled as such.
To get back an old version I restore the preceding full and differential backups and some incrementals. That gives me the base vdi and snapshots and the machine description belonging to the target state. Only the execution state gets lost if a machine was running during the backup. Or the script might shut down or save the machines. Anyway, after moving the restored files into place the machines should just work.
MfG, Ulrich
Re: How to backup a vm incrementally
AFAIK:
VirtualBox.xml, which contains a registry of all the parts
Machines/*/*.xml, which describe the machines
.vdi files for the base image and all snapshots
.sav files for snapshots of running (or saved) states
*.img for floppies, if any
I prefer to backup the whole VB directory; saves thinking and the bulk is in the VDIs anyway.
MfG, Ulrich
VirtualBox.xml, which contains a registry of all the parts
Machines/*/*.xml, which describe the machines
.vdi files for the base image and all snapshots
.sav files for snapshots of running (or saved) states
*.img for floppies, if any
I prefer to backup the whole VB directory; saves thinking and the bulk is in the VDIs anyway.
MfG, Ulrich