Page 1 of 1
Backup/restore .vdi volume?
Posted: 14. Aug 2011, 13:55
by pacpac
Hi, I am running the latest version of VirtualBox on a Windows 7 PC (64-bit). Windows 7 and other programs are running from a SSD RAID (C drive) and data is stored on a separate SSD drive (D drive) installed on the same PC. Using VirtualBox I have installed Windows Server 2008 R2 with Exchange Server 2010. This set-up is only to serve 10-12 e-mail accounts (no web site hosting). I have created a 40GB .vdi file, which resides on the D drive. I have tested, and I can copy to .vdi file to another location whilst VirtualBox is running with that volume, i.e. the .vdi file.
I need to have in place a backup strategy for the Exchange data. So, can I just regularly back up the .vdi file (with Windows and Exchange server installed) to an external drive and should either Windows 7 crash, VirtualBox or any of the programs installed on the .vdi drive crash, I can just reinstall VirtualBox and pick up the .vdi file to use in the new VirtualBox installation and I have my Windows and Exchange server with all data intact up and running?
Thanks.
Re: Backup/restore .vdi volume?
Posted: 14. Aug 2011, 14:24
by Sasquatch
If you are going to make a backup of a VM, it's best to shut it down. That way, all changes are kept in the VDI and the VM will start properly. If you were to make a backup of the VM whilst it's running, you can have issues with file locking, caching of old files and other issues you rather avoid. Restoring such a backup can also give you some problems, because it can appear that you simply pulled the plug and you will get an unclean shutdown message.
Something you also have to consider, is that since you have Exchange, you also have an AD set up. If this system synchronises with any other server, restoring a backup is the worst thing you can do, because the sync will not work any more. Also consider the email messages that you will loose between the backup and current date. Due to this, it's out of the question to use snapshots.
What's best to do, is have a regular backup schedule or make a single backup and do the rest from within the VM. You can make a backup of your AD and Exchange databases which you can restore to a new installation. Consult the Microsoft website and best practise information to learn how to back up your Exchange server properly, especially when it's a VM.
Re: Backup/restore .vdi volume?
Posted: 14. Aug 2011, 14:55
by vbox4me2
pacpac wrote:I have tested, and I can copy to .vdi file to another location whilst VirtualBox is running with that volume, i.e. the .vdi file.
This is where sas is right, "a copy" can be done easily but often misses changes properly while the VM is running, a better and (by me) properly tested way is to use VSS with a tool like shadowcopy, I've been using it for over a year and have had the pleasure to restore several VM's without loosing data. The only chevat is to check that all services have started after restore.
Re: Backup/restore .vdi volume?
Posted: 14. Aug 2011, 16:09
by pacpac
Thanks.
Would this be 2 viable alternatives:
1) Do a "proper" copy of the .vdi file using a backup software capable of shadowcopy, then restore the image?
2) Do a clone of the .vdi file, then use Windows Server inbuilt backup service to backup the server data, then restore the cloned .vdi and restore data from Windows server backup version?
If both are viable, which one is most reliable?
Thanks.
Re: Backup/restore .vdi volume?
Posted: 14. Aug 2011, 16:26
by vbox4me2
Windows build in backup already uses VSS so you could use this as well, personally I prefer shadowcopy because it can be used fully by commandline where you can restrict it to using only 1 cpu and adjust it to below normal cpu use and send the backup anywhere without using much resources.
Restoring is a simple matter of deleting or renaming the vdi and copying the backup back. In case the crashed VM still holds data that is not in the backup you can easily mount the crashed VDI(VM) as additional disk inside the restored VM to pull of data.
Re: Backup/restore .vdi volume?
Posted: 14. Aug 2011, 20:35
by scp
Using the built-in backup of Windows Server 2008 R2 by calling "wbadmin" might be a good solution because the resulting backup files are .vhd files which can be directly used by VirtualBox.
There is only one point to consider: Each partition goes into a separate .vhd, so the original drive layout will not be kept.
I already tried to boot from a backup .vhd of Windows 7, which worked perfect without modifications.
Re: Backup/restore .vdi volume?
Posted: 14. Aug 2011, 21:56
by vbox4me2
From inside a Guest yes, not from a Host as the VHD contains a VDI, an image inside an image won't boot for VBox.
Re: Backup/restore .vdi volume?
Posted: 14. Aug 2011, 23:50
by scp
Yes, I would run backup inside the Guest VM to a network share.
Additionally the monthly backup can be done by creating snapshots or shutting down the VM to get a full copy.