We use VMs with snapshots as part of our support and release testing processes, which makes testing patches to client systems convenient (take snapshot, apply changes, test, revert, lather, rinse, repeat (and re-apply the updates & commit the snapshot's changes when the updates go live)), a setup that I am trying to improve.
One of the issues we have is database performance, which I am aware is always going to be bad on a snapshotted VM because of how much extra work is done for every write compared to the same write on a physical machine but I would like to improve this as much as is possible.
On physical machine we tend to split things over three separate drives (or three separate arrays as RAID1 or 10 is standard on our production boxes) when running SQL Server, as a rule-of-thumb keeping data files on one, main database log files on another, and tempdb (& the OS) on a third.
This doesn't seem to be possible with VirtualBox with snapshots as I can not find any way to split the snapshots for each drive over different locations. I can keep three vdisks on separate drives on the physical host which would make the same sort of difference were snapshots not being used, but with a snapshot all write activity (and subsequent read activity for the affected areas) is going to be concentrated on one drive as all the differencing files go to the same place. I can keep the differencing files an a separate drive to the drives holding the base vdisks containing committed activity which will no doubt help, but not as much as being able to completely separate the IO for each vdisk to different physical drives.
tl;dr: Is there a way to ask VirtualBox (or another virtualisation solution, as I may be able to consider alternatives at this point) to keep the differencing files for snapshots with the base vdisk files to which they relate, rather than them all going into one common directory? The snapshot location option is only available at the VM level, not vdisk level, doesn't seem to accept relative paths. Or are we going to be better off just keeping the VM on a 4-drive RAID0 physical volume (with backups on a much safer array, of course!)?
You don`t say what your server OS for VBox is. But if you used Linux, you could put your virtual disks onto LVMs and snapshot these.
Alternatives for VirtualBox (I use VBox only on PCs, not on servers): - XEN (very good for using para-virtual linux with linux vserver os) - KVM (if you want linux as vserver) - Hyper-V (Microsoft/Microsoft)
Another alternative: Do a complete backup before testing and a complete restore after testing - no snapshotting at all.
Or: Use the snapshot to create a full clone, then remove the snapshot...
I took a look at a .vbox-file of a DOS VM after snapshotting it:
The HardDisk-Section of that XML-file looks promising:
My guess is that you can modify the path given in "location" for the snapshot at your will (with a paused or shutdown vm). Try it...