How to Compress Old SnapVault Data in Clustered Data ONTAP

The following post shows - by example - a couple of methods by which this can be done.

We have a compressible but not very de-duplicable dataset:

Image: Uncompressed
Image: Compressed (to zip with 7-Zip)
On the Production SVM

Create a volume with Snapshot Policy none on the Production SVM, and a CIFS share ::>

vol create -vserver PRSVM -volume DATAGEN -aggregate aggr01 -size 2.5g -language en -junction-path /DATAGEN -type rw -space-guarantee none -snapshot-policy none

cifs share create -vserver PRSVM -share-name DATAGEN -path /DATAGEN

Add the dataset to the volume, enable dedupe (no compression), scan-old-data, and wait for the volume efficiency process to finish ::>

vol efficiency on -vserver PRSVM -volume DATAGEN

vol efficiency start -vserver PRSVM -volume DATAGEN -scan-old-data true

vol efficiency show -vserver PRSVM -volume DATAGEN

vol show -vserver PRSVM -volume DATAGEN -fields used,dedupe-space-saved,compression-space-saved

volume  used    dedupe-space-saved compression-space-saved
------- ------- ------------------ -----------------------
DATAGEN 555.5MB 436KB              0B

For testing, create a 5minutely snapshot policy and apply to the volume DATAGEN ::>

snapshot policy create -policy 5minutely -enabled true -schedule1 5min -count1 12 -snapmirror-label1 5min

volume modify -vserver PRSVM -volume DATAGEN -snapshot-policy 5minutely

On the SnapVault SVM

Method 1: Using -snapshot-blocks true

Create a SnapVault (DP) volume, SnapVault policy, and create and initialize the SnapVault with a schedule of none ::>

vol create -vserver SVSVM -volume DATAGEN -aggregate aggr01 -size 2.5g -language en -type DP -space-guarantee none

snapmirror policy create -vserver SVSVM -policy 5minutely

snapmirror policy add-rule -vserver SVSVM -policy 5minutely -snapmirror-label 5min -keep 60

snapmirror create -source-path PRSVM:DATAGEN -destination-path SVSVM:DATAGEN -type XDP -policy 5minutely

snapmirror initialize -destination-path SVSVM:DATAGEN

Then we enable compression on the vault, scan-old-data and snapshot-blocks, wait for the volume efficiency task to finish, and get the volume stats ::>

vol efficiency on -vserver SVSVM -volume DATAGEN

vol efficiency modify -vserver SVSVM -volume DATAGEN -compression true

set advanced

vol efficiency start -vserver SVSVM -volume DATAGEN -scan-old-data true -snapshot-blocks true

vol efficiency show -vserver SVSVM -volume DATAGEN

vol show -vserver SVSVM -volume DATAGEN -fields used,dedupe-space-saved,compression-space-saved

volume  used    dedupe-space-saved compression-space-saved
------- ------- ------------------ -----------------------
DATAGEN 652.0MB 508KB              442.5MB

NB: To use -snapshot-blocks true you must specify -scan-old-data true also (the command will error otherwise.)

Method 2: Enable Compression before Creating the SnapVault

The second method is even simpler:

Create a SnapVault (DP) volume and turn on volume efficiency before creating the SnapVault relationship and initializing it ::>

vol create -vserver SVSVM -volume DATAGEN2 -aggregate aggr01 -size 2.5g -language en -type DP -space-guarantee none

vol efficiency on -vserver SVSVM -volume DATAGEN2

vol efficiency modify -vserver SVSVM -volume DATAGEN2 -compression true

snapmirror create -source-path PRSVM:DATAGEN -destination-path SVSVM:DATAGEN2 -type XDP -policy 5minutely

snapmirror initialize -destination-path SVSVM:DATAGEN2

Then wait for volume efficiency to complete (kicks in after the SnapMirror has finished initializing), and get the volume stats ::>

vol efficiency show -vserver SVSVM -volume DATAGEN2

vol show -vserver SVSVM -volume DATAGEN2 -fields used,dedupe-space-saved,compression-space-saved

volume   used    dedupe-space-saved compression-space-saved
-------- ------- ------------------ -----------------------
DATAGEN2 108.0MB 64KB               445.3MB

Further Information

With Method 1 you will need to make sure that the Snapshot holding all the block changes is deleted (perhaps by the SnapMirror update itself), otherwise the volume won’t realize the savings from compression.

Volume used after the post initialization compression (volume efficiency) operation:

volume  used    dedupe-space-saved compression-space-saved
------- ------- ------------------ -----------------------
DATAGEN 652.0MB 516KB              442.7MB
DATAGEN2
        108.0MB 64KB               445.3MB

Since the SnapMirror had been created with no schedule, we have just these baseline snapshots, so an update will be enough to clear the baseline Snapshot down.

Volume  Snapshot                        State        Size
------- ------------------------------- -------- --------
DATAGEN
        snapmirror.09ea0123-8862-11e4-a8db-123478563412_2
                                        valid     541.7MB
DATAGEN2
        snapmirror.09ea0123-8862-11e4-a8db-123478563412_2
                                        valid       140KB

After the SnapMirror update for DATAGEN:

volume  used    dedupe-space-saved compression-space-saved
------- ------- ------------------ -----------------------
DATAGEN 111.7MB 516KB              442.7MB
DATAGEN2
        108.0MB 64KB               445.3MB

Comments