Technically, the only difference in the policy creation is the -type
parameter used to create the policy, but in reality, once you create the policy
a "vault" policy will also need one or more rules to replicate any desired source
snapshots. The number you keep on the destination doesn't really matter...you can keep the same number of snapshots on the destination as is kept on the source, or keep more more snapshots on the destination as is kept on the source. It is still a vault policy.
For a VAULT policy:
1) create the base policy
Vs0.example.com::> snapmirror policy create -vserver vs0.example.com -policy MyVaultPolicy -type vault
vs0.example.com::> snapmirror policy add-rule -vserver vs0.example.com -policy MyVaultPolicy -snapmirror-label nightly -keep 5
Vs0.example.com::> snapmirror policy show -policy MyVaultPolicy
Vserver Policy Policy Number Transfer Name Name Type Of Rules Tries Priority Comment ------- ------------------ ------ -------- ----- -------- ----------
MyVaultPolicy vault 2 8 normal Vault policy SnapMirror Label: nightly Keep: 5
For a MIRROR policy:
A snapmirror policy will use -type async-mirror, which will have one rule by default...the "sm_created" rule:
Vs0.example.com::> snapmirror policy create -vserver vs0.example.com -policy MyAsyncMirrorPolicy -type async-mirror
Vs0.example.com::> snapmirror policy show -policy MyAsyncMirrorPolicy
Vserver Policy Policy Number Transfer Name Name Type Of Rules Tries Priority Comment ------- ------------------ ------ -------- ----- -------- ----------
MyAsyncMirrorPolicy async-mirror 1 8 normal Asynchronous SnapMirror policy for mirroring the latest active file system. SnapMirror Label: sm_created Keep: 1 Total Keep: 1
This tells snapmirror to only replicate the snapshot of the active file system it creates as part of the scheduled snapmirror replication.
Notice that the Vault policy does not have a rule for "sm_created" and the AsyncMirror policy does not have any rules EXCEPT the "sm_created"
A couple of notes:
- you can only keep one "sm_created"...you cannot change the keep value
- you can add ONE additional rule to an async-mirror policy. That rule must be -snapmirror-label all_source_snapshots. This will replicate all snapshots that are on the source regardless of label and still keep only one copy on the destination.
A policy of -type mirror-vault allows both of the above in same policy.
The bottom line is that all three policies use the exact same replication engine to perform the replication...what changes is what the policy allows...vault has one or more custom rules, async-mirror has no custom rules, and mirror-vault has both.
All of this is explained in TR-4015. Also, the online MAN pages for snapmirror policy create and snapmirror policy add-rule commands are available.