Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

VMware Images - at 20+ GB a pop, they start to add up very quickly.

This. I tend to make many snapshots, especially of Windows VMs, since they cannot be reconstructed as quickly as a Linux VM. Virtual machines plus snapshot get big quickly.



Sounds like you want bup which was made for snapshotting vm's without an all new copy being made each time: https://github.com/apenwarr/bup

Disclaimer: Saw the guys presentation at a Git hacking session the other year and was very blown away by the tech involved, very cool stuff.


bup looks like a great tool; thanks for mentioning it.

But ghshephard and danieldk are using VMware, which already creates snapshots using deltas, not entire copies. So their snapshots should already be very efficient.

VMware virtual disks are copy-on-write disks. When you open a VM and start writing to the virtual disk, it creates a new .vmdk (virtual disk) file and writes the changes to that file. (Persistent disks are an exception; changes are written directly to the original .vmdk file.)

When you take a snapshot, it simply freezes the current .vmdk file(s) and starts writing to a new one. It's very quick and efficient. Restoring a snapshot is equally quick and efficient: VMware simply goes back to the .vmdk(s) that make up that snapshot, opens a new scratch .vmdk for further disk writes, and you're ready to go.

You can go back to an old snapshot, make some changes, and save this as a new snapshot. Then you end up with a tree of snapshots, each one using only the disk space needed for the changes that went into that virtual disk.

Of course, even though these delta disks are fairly space-efficient, it still adds up when you use a lot of snapshots!

One trick I use when I create a Linux VM is to create three separate virtual disks for it: a normal .vmdk with snapshot capability for most of the filesystem, plus two smaller nonpersistent .vmdk's for swap and /tmp. I start those two .vmdk's as persistent disks (no snapshot, changes are written directly into the original .vmdk) and then switch them to nonpersistent mode immediately after creating the disks. Nonpersistent disks write their changes to a temporary delta .vmdk when is discarded when the VM is powered down, so writes to /tmp and swap do not go into the snapshots.

I should do this with my Windows VMs too - putting the temp directory and swapfile on nonpersistent disks would help cut down the size of the Windows snapshots.


Why did you decide to prefix the last sentence with "Disclaimer: "?


Because I haven't used it myself, only saw it in action at the presentation.


I want to make snapshots right in VMWare, because it gives the additional advantage that I can quickly switch between them.

E.g. I have snapshots for a clean Windows installs with a different set of development tools.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: