Improving RAW Snapshots Performance

One of the most used features of our public cloud is Miniserver Snapshots, which allow our customers to save a copy of their server's disk at a particular point in time. That disk image is stored in Memstore, our cloud storage solution, and can be used to create a new server or to re-image an existing one.

We currently support three different formats for the snapshots: tar (only available for Linux servers), ntfsclone images (only available for Windows servers) and raw images.

Raw images are a compressed exact copy of the server disk and are not affected by the file system being in a transient (and perhaps inconsistent) state as result of the server operation. This makes raw images the perfect option when taking a snapshot of a very busy server (especially on Windows, because ntfsclone requires the file system on disk to be consistent).

Unfortunately the raw images are quite space inefficient, specially for large disks. Nevertheless, if you want to use the raw image format, there's a simple trick that can drastically reduce the space required to store the raw image: fill the unused disk space with zeros before taking the snapshot.

Linux

The easiest way of filling with all the unused space with zeros is with:

dd if=/dev/zero of=/zerofill bs=20M ; rm /zerofill

That's it! You fill all the free space with zeros creating a zerofill file, and immediately after the disk is full you remove the file. At this point, if you take a raw snapshot, it could use even less space than a tar snapshot (because of compression).

Windows

By default Microsoft Windows doesn't provide a tool to fill the unused disk space with zeros, but you can use an open source (and free) tool called  Eraser.

With version 6.0.10.2620 you can use "British HMG IS5 (Baseline) (1 pass)" as "Default unused space erasure method", and it will fill the unused space with zeros in a single pass.

The steps to do it are:

  1. Click on "Erase Schedule" drop down and select "New Task".
  2. In the "Task Properties" dialog window select "Run Immediately".
  3. Click on "Add Data". In the "Select Data to Erase" dialog window select "Unused disk space". For "Erasure method" select "British HMG IS5 (Baseline) (1 pass)". Click "OK".
  4. Click "OK" to start the process.

Now wait for the tool to finish the task (it may need some time) and then you can take a new snapshot.

Posted December 2012 by Juan J. Martínez , in Dev

blog comments powered by Disqus