[Amazon FSx for NetApp ONTAP] Tamperproof SnapshotとSnapMirrorを組み合わせたときの挙動を確認してみた

[Amazon FSx for NetApp ONTAP] Tamperproof SnapshotとSnapMirrorを組み合わせたときの挙動を確認してみた

Tamperproof SnapshotとSnapLockの相性は抜群
Clock Icon2024.09.20

SnapMirrorの転送先でもSnapshotのロックが効くのか

こんにちは、のんピ(@non____97)です。

皆さんはSnapMirrorの転送先でもSnapshotのロックが効くのか気になったことはありますか? 私はあります。

以下記事でTamperproof Snapshotの紹介をしました。

https://dev.classmethod.jp/articles/amazon-fsx-for-netapp-ontap-tamperproof-snapshot/#tamperproof-snapshot

Tamperproof Snapshotを使用している = Snapshotのロックがかかっている場合にSnapMirrorを転送することはできるのでしょうか。

実際に確認してみました。

いきなりまとめ

  • 転送元ボリュームでSnapshotのロックがかかっている場合でもSnapMirrorで転送は可能
    • 転送されたSnapshotのロック期間は転送元のSnapshotのロック期間と同じ
    • 転送先ボリュームは自動でsnapshot-locking-enabledが有効になる
  • 転送元でSnapshotのロックがかかっていない場合でも、転送されたSnapshotにロックをかけることは可能
    • 転送されたSnapshotのロック開始基準はSnapMirrorの転送完了のタイミング
    • async-mirrorなSnapMirror Policyでは転送先でのみSnapshotにロックをかけることはできない
    • sm_createdのSnapMirror Policyルールは転送先でのみSnapshotにロックをかけることはできない
    • all_source_snapshotsのSnapMirror Policyルールはmirror-vaultなSnapMirror Policyで使用することはできない
    • 既存のSnapMirror Policyルールのロック期間は変更できない
      • 一度ルールを削除して再作成する必要がある
    • 転送先ボリュームは自動でsnapshot-locking-enabledが有効にはならない
  • ロック期間の切れたSnapshotは転送先ボリュームから削除できる

検証環境

検証環境は以下記事のものを再利用します。

https://dev.classmethod.jp/articles/amazon-fsx-for-netapp-ontap-tamperproof-snapshot/

Tamperproof Snapshotを転送するSnapMirror

初期転送

まず、Tamperproof Snapshotを転送するSnapMirrorから試します。

SVMピアリングは以下のとおり実施済みです。

::*> vserver peer show
            Peer        Peer                           Peering        Remote
Vserver     Vserver     State        Peer Cluster      Applications   Vserver
----------- ----------- ------------ ----------------- -------------- ---------
svm_apne1   svmPeer30372260664
                        peered       FsxId09b61052262da98b8
                                                       flexcache, snapmirror
                                                                      svm_use1

SnapMirrorの初期転送を行います。

::*> snapmirror protect -path-list svmPeer30372260664:vol_ss_lock_1 -destination-vserver svm_apne1 -policy MirrorAllSnapshots -auto-initialize true -support-tiering true -tiering-policy none
[Job 447] Job is queued: snapmirror protect for list of source endpoints beginning with "svmPeer30372260664:vol_ss_lock_1".

::*> job show 447
                            Owning
Job ID Name                 Vserver    Node           State
------ -------------------- ---------- -------------- ----------
447    SnapMirror protect   svm_apne1  FsxId02486ab43fc5902c8-02
                                                      Success
       Description: snapmirror protect for list of source endpoints beginning with "svmPeer30372260664:vol_ss_lock_1"

::*> snapmirror show
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svmPeer30372260664:vol_ss_lock_1
            XDP  svm_apne1:vol_ss_lock_1_dst
                              Snapmirrored
                                      Transferring   212.6MB   true    07/29 08:18:05

問題なく転送が開始されていそうですね。

SnapMirrorによる転送が行われている間のSnapshotの確認をします。

::*> snapshot show -volume vol_ss_lock_1* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                  create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ------------------------- ------------------------ ----- ---------------- ----- -------- ----------- -------------------------
svm_apne1 vol_ss_lock_1_dst ss_lock.2024-07-29_065040 Mon Jul 29 06:50:41 2024 252KB ss_lock          -     352KB    -           7/29/2024 06:54:15 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0745      Mon Jul 29 07:45:00 2024 276KB ss_lock          -     258.6MB  -           7/29/2024 08:14:49 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0750      Mon Jul 29 07:50:00 2024 240KB ss_lock          -     258.6MB  -           7/29/2024 08:19:49 +00:00
3 entries were displayed.

いくつかSnapshotが転送されていますね。いずれのSnapshotもsnaplock-expiry-timeが設定されています。

また、Last Updated07/29 08:18:05で、転送されたSnapshot5min.2024-07-29_0750snaplock-expiry-time7/29/2024 08:19:49 +00:00であることから、転送完了時点を基準にロック期間を再度転送先で設定し直すのではなく、転送元のSnapshotのロック期間をそのまま維持することが分かります。

ちなみに転送先ボリュームは自動でsnapshot-locking-enabledがtrueになっていました。

::*> volume show -volume vol_ss_lock_1_dst -fields snapshot-policy, snaplock-type, snapshot-locking-enabled
vserver   volume            snapshot-policy snaplock-type snapshot-locking-enabled
--------- ----------------- --------------- ------------- ------------------------
svm_apne1 vol_ss_lock_1_dst none            non-snaplock  true

もう少し様子を見ます。

::*> snapmirror show
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svmPeer30372260664:vol_ss_lock_1
            XDP  svm_apne1:vol_ss_lock_1_dst
                              Snapmirrored
                                      Transferring   386.4MB   true    07/29 08:18:36

# 転送元のSnapshot一覧
::*> snapshot show -vserver svm_use1 -volume vol_ss_lock_1 -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver  volume        snapshot                  create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
-------- ------------- ------------------------- ------------------------ ----- ---------------- ----- -------- ----------- -------------------------
svm_use1 vol_ss_lock_1 ss_lock.2024-07-29_065040 Mon Jul 29 06:50:41 2024 228KB ss_lock          -     320KB    -           7/29/2024 06:54:15 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_0745      Mon Jul 29 07:45:00 2024 1.21MB
                                                                                ss_lock          -     257.7MB  -           7/29/2024 08:14:49 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_0750      Mon Jul 29 07:50:00 2024 244KB ss_lock          -     260.4MB  -           7/29/2024 08:19:49 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_075410    Mon Jul 29 07:54:11 2024 164KB 5min             -     2.29GB   -           7/29/2024 07:57:00 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_0755      Mon Jul 29 07:55:00 2024 268KB ss_lock          -     2.29GB   -           7/29/2024 08:24:49 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_0800      Mon Jul 29 08:00:00 2024 152KB ss_lock          -     2.29GB   -           7/29/2024 08:29:49 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_0805      Mon Jul 29 08:05:00 2024 152KB ss_lock          -     2.29GB   -           7/29/2024 08:34:49 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_0810      Mon Jul 29 08:10:00 2024 152KB ss_lock          -     2.29GB   -           7/29/2024 08:39:49 +00:00
svm_use1 vol_ss_lock_1 5min.2024-07-29_0815      Mon Jul 29 08:15:00 2024 148KB ss_lock          -     2.29GB   -           7/29/2024 08:44:49 +00:00
svm_use1 vol_ss_lock_1 snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128486.2024-07-29_081732
                                                 Mon Jul 29 08:17:33 2024 140KB -                -     2.29GB   -           -
10 entries were displayed.

::*> snapmirror show
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svmPeer30372260664:vol_ss_lock_1
            XDP  svm_apne1:vol_ss_lock_1_dst
                              Snapmirrored
                                      Idle           -         true    -
# 転送先のSnapshot一覧
::*> snapshot show -volume vol_ss_lock_1* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                  create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ------------------------- ------------------------ ----- ---------------- ----- -------- ----------- -------------------------
svm_apne1 vol_ss_lock_1_dst ss_lock.2024-07-29_065040 Mon Jul 29 06:50:41 2024 252KB ss_lock          -     352KB    -           7/29/2024 06:54:15 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0750      Mon Jul 29 07:50:00 2024 300KB ss_lock          -     258.6MB  -           7/29/2024 08:19:49 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_075410    Mon Jul 29 07:54:11 2024 312KB 5min             -     2.27GB   -           7/29/2024 07:57:00 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0755      Mon Jul 29 07:55:00 2024 280KB ss_lock          -     2.27GB   -           7/29/2024 08:24:49 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0800      Mon Jul 29 08:00:00 2024 240KB ss_lock          -     2.27GB   -           7/29/2024 08:29:49 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0805      Mon Jul 29 08:05:00 2024 240KB ss_lock          -     2.27GB   -           7/29/2024 08:34:49 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0810      Mon Jul 29 08:10:00 2024 240KB ss_lock          -     2.27GB   -           7/29/2024 08:39:49 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0815      Mon Jul 29 08:15:00 2024 236KB ss_lock          -     2.27GB   -           7/29/2024 08:44:49 +00:00
svm_apne1 vol_ss_lock_1_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128486.2024-07-29_081732
                                                      Mon Jul 29 08:17:33 2024 172KB -                -     2.27GB   -           -
9 entries were displayed.

全てのSnapshotが転送されたことが分かります。

5min.2024-07-29_0745は転送元で確認した後、Snapshot Policyに基づいて転送元で削除されてしまったため、転送先にもそれが反映されたと考えます。

スケジュールの設定

次に、5分間隔で転送するようにします。

::*> snapmirror modify -source-path svmPeer30372260664:vol_ss_lock_1 -destination-path svm_apne1:vol_ss_lock_1_dst -schedule 5min
Operation succeeded: snapmirror modify for the relationship with destination "svm_apne1:vol_ss_lock_1_dst".

::*> snapmirror show -fields schedule
source-path                      destination-path            schedule
-------------------------------- --------------------------- --------
svmPeer30372260664:vol_ss_lock_1 svm_apne1:vol_ss_lock_1_dst 5min

10分ほど放置すると、5分間隔でSnapshotを転送していることが分かります。

::*> snapshot show -volume vol_ss_lock_1* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                  create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ------------------------- ------------------------ ----- ---------------- ----- -------- ----------- -------------------------
svm_apne1 vol_ss_lock_1_dst ss_lock.2024-07-29_065040 Mon Jul 29 06:50:41 2024 256KB ss_lock          -     352KB    -           7/29/2024 06:54:15 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_075410    Mon Jul 29 07:54:11 2024 312KB 5min             -     2.27GB   -           7/29/2024 07:57:00 +00:00
.
.
(中略)
.
.
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0815      Mon Jul 29 08:15:00 2024 236KB ss_lock          -     2.27GB   -           7/29/2024 08:44:49 +00:00
svm_apne1 vol_ss_lock_1_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128486.2024-07-29_081732
                                                      Mon Jul 29 08:17:33 2024 256KB -                -     2.27GB   -           -
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0820      Mon Jul 29 08:20:00 2024 248KB ss_lock          -     2.27GB   -           7/29/2024 08:49:49 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0825      Mon Jul 29 08:25:00 2024 236KB ss_lock          -     2.27GB   -           7/29/2024 08:54:49 +00:00
svm_apne1 vol_ss_lock_1_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128486.2024-07-29_082500
                                                      Mon Jul 29 08:25:02 2024 160KB -                -     2.27GB   -           -
11 entries were displayed.

転送されたSnapshotの削除

次に、転送先でSnapshotを削除しようとしてみます。

::*> snapshot delete -volume vol_ss_lock_1_dst -snapshot 5min.2024-07-29_0815

Error: Either specify all keys, or set at least one key to "*".

::*> snapshot delete -vserver svm_apne1 -volume vol_ss_lock_1_dst -snapshot 5min.2024-07-29_0815

Warning: Deleting a Snapshot copy permanently removes data that is stored only in that Snapshot copy. Are you sure you want to delete Snapshot copy "5min.2024-07-29_0815" for volume "vol_ss_lock_1_dst" in Vserver
         "svm_apne1" ? {y|n}: y

Error: command failed: Failed to delete snapshot "5min.2024-07-29_0815" of volume "vol_ss_lock_1_dst" on Vserver "svm_apne1". Reason: Illegal operation on Snapshot locked by SnapLock.

はい、ロックされているため削除できないと怒られました。

期限が切れたものは削除できるか確認します。

::*> snapshot delete -vserver svm_apne1 -volume vol_ss_lock_1_dst -snapshot ss_lock.2024-07-29_065040

Warning: Deleting a Snapshot copy permanently removes data that is stored only in that Snapshot copy. Are you sure you want to delete Snapshot copy "ss_lock.2024-07-29_065040" for volume "vol_ss_lock_1_dst" in
         Vserver "svm_apne1" ? {y|n}: y

::*> snapshot show -volume vol_ss_lock_1* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot               create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ---------------------- ------------------------ ----- ---------------- ----- -------- ----------- -------------------------
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_075410 Mon Jul 29 07:54:11 2024 312KB 5min             -     2.27GB   -           7/29/2024 07:57:00 +00:00
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0755   Mon Jul 29 07:55:00 2024 280KB ss_lock          -     2.27GB   -           7/29/2024 08:24:49 +00:00
.
.
(中略)
.
.
svm_apne1 vol_ss_lock_1_dst 5min.2024-07-29_0825   Mon Jul 29 08:25:00 2024 236KB ss_lock          -     2.27GB   -           7/29/2024 08:54:49 +00:00
svm_apne1 vol_ss_lock_1_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128486.2024-07-29_082500
                                                   Mon Jul 29 08:25:02 2024 176KB -                -     2.27GB   -           -
10 entries were displayed.

こちらは問題なく削除できました。

SnapMirrorの転送先でSnapshotのロックを設定

async-mirrorなSnapMirror Policyの作成

次にSnapMirrorの転送先でSnapshotのロックを設定します。

async-mirrorのSnapMirror Policyを作成します。

::*> snapmirror policy create -vserver svm_apne1 -policy ss_lock_sm_policy -type async-mirror

::*> snapmirror policy show -policy ss_lock_sm_policy -instance

                      Vserver: svm_apne1
       SnapMirror Policy Name: ss_lock_sm_policy
       SnapMirror Policy Type: async-mirror
                 Policy Owner: vserver-admin
                  Tries Limit: 8
            Transfer Priority: normal
    Ignore accesstime Enabled: false
      Transfer Restartability: always
  Network Compression Enabled: false
              Create Snapshot: true
                      Comment: -
        Total Number of Rules: 1
                   Total Keep: 1
       Transfer Schedule Name: -
                     Throttle: unlimited
           Snapshot Lock Mode: -
       Enable ACS Replication: true
 Enable SM Created Replication:true

 Rules:
 SnapMirror Label       Keep Preserve Warn Schedule Prefix     Retention Period
 ---------------------- ---- -------- ---- -------- ---------- ----------------
 sm_created                1 false       0 -        -                         -

転送元の全てのSnapshotall_source_snapshotsに対して、ロック期間20分のルールを設定しようとします。

::*> snapmirror policy add-rule -vserver svm_apne1 -policy ss_lock_sm_policy -snapmirror-label all_source_snapshots -keep 1 -retention-period 20minutes

Error: command failed: Parameter "-retention-period" is not supported for "async-mirror" policy type.

async-mirrorなSnapMirror PolicyにはSnapshotのロック期間を設定できないようです。

mirror-vaultなSnapMirror Policyの作成

mirror-vaultのSnapMirror Policyでリベンジします。

::*> snapmirror policy create -vserver svm_apne1 -policy ss_lock_sm_policy2 -type mirror-vault

::*> snapmirror policy show -policy ss_lock_sm_policy2 -instance

                      Vserver: svm_apne1
       SnapMirror Policy Name: ss_lock_sm_policy2
       SnapMirror Policy Type: mirror-vault
                 Policy Owner: vserver-admin
                  Tries Limit: 8
            Transfer Priority: normal
    Ignore accesstime Enabled: false
      Transfer Restartability: always
  Network Compression Enabled: false
              Create Snapshot: true
                      Comment: -
        Total Number of Rules: 1
                   Total Keep: 1
       Transfer Schedule Name: -
                     Throttle: unlimited
           Snapshot Lock Mode: -
       Enable ACS Replication: true
 Enable SM Created Replication:true

 Rules:
 SnapMirror Label       Keep Preserve Warn Schedule Prefix     Retention Period
 ---------------------- ---- -------- ---- -------- ---------- ----------------
 sm_created                1 false       0 -        -                         -

::*> snapmirror policy add-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label all_source_snapshots -keep 1 -retention-period 20minutes

Error: command failed: Rule for "-snapmirror-label all_source_snapshots" is suppported only for Snapmirror policy of type "async-mirror".

どうやらall_source_snapshotsasync-mirrorしかサポートしていないようですね。そのため、all_source_snapshotsでSnapshotのロックを転送先のみに効かせることができないことが分かります。

SnapMirror Labelをdailyにした場合はどうでしょうか。

::*> snapmirror policy add-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label daily -keep 5 -retention-period 20minutes

::*> snapmirror policy show -policy ss_lock_sm_policy2 -instance

                      Vserver: svm_apne1
       SnapMirror Policy Name: ss_lock_sm_policy2
       SnapMirror Policy Type: mirror-vault
.
.
(中略)
.
.
                     Throttle: unlimited
           Snapshot Lock Mode: -
       Enable ACS Replication: true
 Enable SM Created Replication:true

 Rules:
 SnapMirror Label       Keep Preserve Warn Schedule Prefix     Retention Period
 ---------------------- ---- -------- ---- -------- ---------- ----------------
 sm_created                1 false       0 -        -                         -
 daily                     5 false       0 -        -                 20minutes

次は設定できました。

すでに存在するsm_createdのルールに対して、Snapshotのロック期間を指定するように変更します。

::*> snapmirror policy modify-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label sm_created -retention-period 10minutes

Error: command failed: Cannot set retention period for rule "sm_created" for policy of type "mirror-vault".

sm_createdではSnapshotのロック期間は設定できないようですね。

転送元ボリュームでSnapshotを作成

転送元ボリュームでSnapshotを作成します。

下準備として、SnapMirrorの転送元ボリュームでsnapshot-locking-enabledを無効にしておきます。

::*> volume modify -volume vol_ss_lock_2 -snapshot-locking-enabled false
Volume modify successful on volume vol_ss_lock_2 of Vserver svm_use1.

::*> volume show -volume vol_ss_lock_2 -fields snapshot-locking-enabled
vserver  volume        snapshot-locking-enabled
-------- ------------- ------------------------
svm_use1 vol_ss_lock_2 false

適当にSnapMirror LabelがdailyのSnapshotをいくつか作成します。

::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot daily.2024-07-29_075800 -snapmirror-label daily
::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot daily.2024-07-29_075810 -snapmirror-label daily
::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot daily.2024-07-29_075815 -snapmirror-label daily

::*> snapshot show -vserver svm_use1 -volume vol_ss_lock_2 -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver  volume        snapshot               create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
-------- ------------- ---------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
.
.
(中略)
.
.
svm_use1 vol_ss_lock_2 daily.2024-07-29_075800
                                              Mon Jul 29 08:58:01 2024 140KB daily            -     420KB    -           -
svm_use1 vol_ss_lock_2 daily.2024-07-29_075810
                                              Mon Jul 29 08:58:10 2024 140KB daily            -     440KB    -           -
svm_use1 vol_ss_lock_2 daily.2024-07-29_075815
                                              Mon Jul 29 08:58:16 2024 136KB daily            -     460KB    -           -
5 entries were displayed.

取得されたSnapshotはsnaplock-expiry-timeが設定されていない = ロックされていないですね。

SnapMirrorの転送

SnapMirrorの初期転送を行います。

::*> snapmirror protect -path-list svmPeer30372260664:vol_ss_lock_2 -destination-vserver svm_apne1 -policy ss_lock_sm_policy2 -auto-initialize true -support-tiering true -tiering-policy none
[Job 450] Job is queued: snapmirror protect for list of source endpoints beginning with "svmPeer30372260664:vol_ss_lock_2".

::*> snapmirror show -source-path svmPeer30372260664:vol_ss_lock_2
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svmPeer30372260664:vol_ss_lock_2
            XDP  svm_apne1:vol_ss_lock_2_dst
                              Snapmirrored
                                      Idle           -         true    -

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                                                                     create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ---------------------------------------------------------------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_090301 Mon Jul 29 09:03:01 2024 148KB -                -     304KB    -           -

差分転送を行います。

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2

::*> snapmirror show -source-path svmPeer30372260664:vol_ss_lock_2
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svmPeer30372260664:vol_ss_lock_2
            XDP  svm_apne1:vol_ss_lock_2_dst
                              Snapmirrored
                                      Idle           -         true    -

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                                                                     create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ---------------------------------------------------------------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_090301 Mon Jul 29 09:03:01 2024 196KB -                -     304KB    -           -
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_090439 Mon Jul 29 09:04:39 2024 124KB -                -     312KB    -           -
2 entries were displayed.

おや、dailyのSnapshotが転送されませんね。

もう一度差分転送します。

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2 -destination-path svm_apne1:vol_ss_lock_2_dst
Operation is queued: snapmirror update of destination "svm_apne1:vol_ss_lock_2_dst".

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                                                                     create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ---------------------------------------------------------------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_090439 Mon Jul 29 09:04:39 2024 204KB -                -     312KB    -           -

やはり結果は変わりません。

SnapMirror PolicyのルールでSnapshotのロック期間を指定しない場合

SnapMirror PolicyのルールでSnapshotのロック期間を指定しているのが良くないのでしょうか。ルールを変更してロック期間を解除しようとします。

::*> snapmirror policy modify-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label daily -retention-period -

Error: The specified retention period "-" is not valid. For relationships with FlexVol volume or FlexGroup volume destinations, specify the duration in the format "<num> seconds|minutes|hours|days|months|years"
       or use the value "infinite". For relationships with object store destinations, specify the duration in the format "<num> days|months|years" and the duration is restricted to the range "30days" to
       "100years".

::*> snapmirror policy modify-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label daily -retention-period ""

Error: The specified retention period "" is not valid. For relationships with FlexVol volume or FlexGroup volume destinations, specify the duration in the format "<num> seconds|minutes|hours|days|months|years" or
       use the value "infinite". For relationships with object store destinations, specify the duration in the format "<num> days|months|years" and the duration is restricted to the range "30days" to "100years".

既存のルールでロック期間を変更できないようですね。

ルール消して再作成します。

:*> snapmirror policy remove-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label daily

Warning: This command will remove the rule "daily" in policy "ss_lock_sm_policy2". Snapshot copies with "-snapmirror-label" of "daily" on the destination will no longer be processed by SnapMirror and might need
         to be manually deleted.
Do you want to continue? {y|n}: y

::*> snapmirror policy add-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label daily -keep 5

::*> snapmirror policy show -vserver svm_apne1 -policy ss_lock_sm_policy2

                      Vserver: svm_apne1
       SnapMirror Policy Name: ss_lock_sm_policy2
       SnapMirror Policy Type: mirror-vault
                 Policy Owner: vserver-admin
                  Tries Limit: 8
            Transfer Priority: normal
    Ignore accesstime Enabled: false
      Transfer Restartability: always
  Network Compression Enabled: false
              Create Snapshot: true
                      Comment: -
        Total Number of Rules: 2
                   Total Keep: 6
       Transfer Schedule Name: -
                     Throttle: unlimited
           Snapshot Lock Mode: -
       Enable ACS Replication: true
 Enable SM Created Replication:true

 Rules:
 SnapMirror Label       Keep Preserve Warn Schedule Prefix     Retention Period
 ---------------------- ---- -------- ---- -------- ---------- ----------------
 sm_created                1 false       0 -        -                         -
 daily                     5 false       0 -        -                         -

この状態で差分転送を行います。

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2 -destination-path svm_apne1:vol_ss_lock_2_dst
Operation is queued: snapmirror update of destination "svm_apne1:vol_ss_lock_2_dst".

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                                                                     create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ---------------------------------------------------------------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_090943 Mon Jul 29 09:09:43 2024 200KB -                -     316KB    -           -
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_091443 Mon Jul 29 09:14:43 2024 140KB -                -     340KB    -           -
2 entries were displayed.

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2 -destination-path svm_apne1:vol_ss_lock_2_dst
Operation is queued: snapmirror update of destination "svm_apne1:vol_ss_lock_2_dst".

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                                                                     create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ---------------------------------------------------------------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_091443 Mon Jul 29 09:14:43 2024 180KB -                -     340KB    -           -

2回差分転送しましたが、結果は変わりありませんね。

もしかすると、SnapMirrorの初期転送後に取得されたSnapshotのみしか転送対象にならないのでしょうか。

以下対応をしてみます。

  • SnapMirror LabelがdailyのSnapshotを取得
  • 差分同期
  • SnapMirror LabelがtestのSnapshotを取得
  • SnapMirror PolicyにSnapMirror Labeltestに対するルールを追加
  • 差分転送
::*> snapmirror policy add-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label test -keep 5

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2 -destination-path svm_apne1:vol_ss_lock_2_dst
Operation is queued: snapmirror update of destination "svm_apne1:vol_ss_lock_2_dst".

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ----------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst daily.2024-07-29_091710 Mon Jul 29 09:17:09 2024 200KB daily            -     320KB    -           -
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_091717
                                                    Mon Jul 29 09:17:17 2024 212KB -                -     328KB    -           -
svm_apne1 vol_ss_lock_2_dst test.2024-07-29_092830  Mon Jul 29 09:28:31 2024 220KB test             -     340KB    -           -
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_092856
                                                    Mon Jul 29 09:28:56 2024 128KB -                -     328KB    -           -
4 entries were displayed.

どちらのSnapshotも転送されていますね。mirror-vaultの場合は初期転送前に転送元で取得したSnapshotは転送されないことが分かりました。

よくよく過去の自身の記事を見ていると同じことを説明していました。

転送先ボリュームが作成され、ベースラインとなるSnapshotsnapmirror.49892dec-8ccc-11ed-946a-5191ab1a5297_2156877971.2023-04-23_205328が転送されました。

SnapMirrorと異なり、以前に取得されたSnapshotは転送されません。

[Amazon FSx for NetApp ONTAP] SnapVaultを使ってSnapshotのバックアップをしてみた | DevelopersIO

SnapMirror PolicyのルールでSnapshotのロック期間を指定する場合

気を改めてSnapMirror PolicyのルールでSnapshotのロック期間を指定する場合を確認します。

SnapMirror Policyのルールを追加します。

::*> snapmirror policy add-rule -vserver svm_apne1 -policy ss_lock_sm_policy2 -snapmirror-label test2 -keep 5 -retention-period 10minutes

::*> snapmirror policy show -vserver svm_apne1 -policy ss_lock_sm_policy2

                      Vserver: svm_apne1
       SnapMirror Policy Name: ss_lock_sm_policy2
       SnapMirror Policy Type: mirror-vault
.
.
(中略)
.
.
           Snapshot Lock Mode: -
       Enable ACS Replication: true
 Enable SM Created Replication:true

 Rules:
 SnapMirror Label       Keep Preserve Warn Schedule Prefix     Retention Period
 ---------------------- ---- -------- ---- -------- ---------- ----------------
 sm_created                1 false       0 -        -                         -
 daily                     5 false       0 -        -                         -
 test                      5 false       0 -        -                         -
 test2                     5 false       0 -        -                 10minutes

SnapMirror Labeltest2のSnapshotの取得をします。

::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot test2.2024-07-29_093350 -snapmirror-label test2
::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot test2.2024-07-29_093400 -snapmirror-label test2
::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot test2.2024-07-29_093410 -snapmirror-label test2

::*> snapshot show -vserver svm_use1 -volume vol_ss_lock_2 -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver  volume        snapshot               create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
-------- ------------- ---------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
.
.
(中略)
.
.
svm_use1 vol_ss_lock_2 daily.2024-07-29_075800
                                              Mon Jul 29 08:58:01 2024 140KB daily            -     420KB    -           -
.
.
(中略)
.
.
svm_use1 vol_ss_lock_2 test2.2024-07-29_093350
                                              Mon Jul 29 09:33:50 2024 144KB test2            -     996KB    -           -
svm_use1 vol_ss_lock_2 test2.2024-07-29_093400
                                              Mon Jul 29 09:34:00 2024 144KB test2            -     1016KB   -           -
svm_use1 vol_ss_lock_2 test2.2024-07-29_093410
                                              Mon Jul 29 09:34:10 2024 140KB test2            -     1.01MB   -           -
13 entries were displayed.

差分転送を行います。

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2 -destination-path svm_apne1:vol_ss_lock_2_dst
Operation is queued: snapmirror update of destination "svm_apne1:vol_ss_lock_2_dst".

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ----------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst daily.2024-07-29_091710 Mon Jul 29 09:17:09 2024 204KB daily            -     320KB    -           -
.
.
(中略)
.
.
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_093350 Mon Jul 29 09:33:50 2024 204KB test2            -     324KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_093400 Mon Jul 29 09:34:00 2024 204KB test2            -     324KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_093410 Mon Jul 29 09:34:10 2024 212KB test2            -     332KB    -           -
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_093430
                                                    Mon Jul 29 09:34:30 2024 148KB -                -     332KB    -           -
8 entries were displayed.

転送が行われましたが、転送されたSnapshotはロックされていないですね。

転送先ボリュームでsnapshot-locking-enabledを有効かどうか確認したところ、無効のままでした。

::*> volume show -volume vol_ss_lock_2_dst -fields snapshot-locking-enabled
vserver   volume            snapshot-locking-enabled
--------- ----------------- ------------------------
svm_apne1 vol_ss_lock_2_dst false

転送元が元々Snapshotのロックが有効であれば自動で転送先も有効になりますが、そうでない場合は自動で有効にならないようです。

有効にしてあげます。

::*> volume modify -volume vol_ss_lock_2_dst -snapshot-locking-enabled true

Warning: Snapshot copy locking is being enabled on volume "vol_ss_lock_2_dst" in Vserver "svm_apne1". It cannot be disabled until all locked Snapshot copies are past their expiry time. A volume with unexpired
         locked Snapshot copies cannot be deleted.
Do you want to continue? {y|n}: y
Volume modify successful on volume vol_ss_lock_2_dst of Vserver svm_apne1.

::*> volume show -volume vol_ss_lock_2_dst -fields snapshot-locking-enabled
vserver   volume            snapshot-locking-enabled
--------- ----------------- ------------------------
svm_apne1 vol_ss_lock_2_dst true

Snapshotを取得します。

::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot test2.2024-07-29_094020 -snapmirror-label test2

::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot test2.2024-07-29_094030 -snapmirror-label test2

::*> snapshot show -vserver svm_use1 -volume vol_ss_lock_2 -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver  volume        snapshot               create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
-------- ------------- ---------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
.
.
(中略)
.
.
svm_use1 vol_ss_lock_2 daily.2024-07-29_075800
                                              Mon Jul 29 08:58:01 2024 140KB daily            -     420KB    -           -
.
.
(中略)
.
.
svm_use1 vol_ss_lock_2 test2.2024-07-29_093410
                                              Mon Jul 29 09:34:10 2024 144KB test2            -     1.01MB   -           -
svm_use1 vol_ss_lock_2 snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_093430
                                              Mon Jul 29 09:34:30 2024 148KB -                -     1.03MB   -           -
svm_use1 vol_ss_lock_2 test2.2024-07-29_094020
                                              Mon Jul 29 09:40:21 2024 140KB test2            -     1.09MB   -           -
svm_use1 vol_ss_lock_2 test2.2024-07-29_094030
                                              Mon Jul 29 09:40:31 2024 136KB test2            -     1.11MB   -           -
15 entries were displayed.

差分転送をします。

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2 -destination-path svm_apne1:vol_ss_lock_2_dst
Operation is queued: snapmirror update of destination "svm_apne1:vol_ss_lock_2_dst".

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ----------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst daily.2024-07-29_091710 Mon Jul 29 09:17:09 2024 204KB daily            -     320KB    -           -
.
.
(中略)
.
.
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_093410 Mon Jul 29 09:34:10 2024 212KB test2            -     332KB    -           -
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_093430
                                                    Mon Jul 29 09:34:30 2024 216KB -                -     332KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094020 Mon Jul 29 09:40:21 2024 204KB test2            -     340KB    -           7/29/2024 09:51:05 +00:00
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094030 Mon Jul 29 09:40:31 2024 124KB test2            -     340KB    -           7/29/2024 09:51:10 +00:00
9 entries were displayed.

先ほど取得したSnapshotが差分転送され、Snapshotがロックされましたね。過去に転送されたものはロックされないようです。

ロック開始期間の基準を確認してみる

ふとロック開始期間の基準が気になりました。

ロック開始基準は転送元のSnapshotが取得されたタイミングなのか、それともSnapMirrorの転送完了のタイミングなのでしょうか。

確認してみましょう。

Snapshotを2分半ほど時間を空けて取得します。

::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot test2.2024-07-29_094230 -snapmirror-label test2
::*> snapshot create -vserver svm_use1 -volume vol_ss_lock_2 -snapshot test2.2024-07-29_094500 -snapmirror-label test2

::*> snapshot show -vserver svm_use1 -volume vol_ss_lock_2 -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver  volume        snapshot               create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
-------- ------------- ---------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
.
.
(中略)
.
.
svm_use1 vol_ss_lock_2 daily.2024-07-29_075800
                                              Mon Jul 29 08:58:01 2024 140KB daily            -     420KB    -           -
.
.
(中略)
.
.
svm_use1 vol_ss_lock_2 test2.2024-07-29_094030
                                              Mon Jul 29 09:40:31 2024 140KB test2            -     1.11MB   -           -
svm_use1 vol_ss_lock_2 snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_094100
                                              Mon Jul 29 09:41:00 2024 144KB -                -     1.12MB   -           -
svm_use1 vol_ss_lock_2 test2.2024-07-29_094230
                                              Mon Jul 29 09:42:30 2024 140KB test2            -     1.18MB   -           -
svm_use1 vol_ss_lock_2 test2.2024-07-29_094500
                                              Mon Jul 29 09:45:00 2024 136KB test2            -     1.20MB   -           -
17 entries were displayed.

差分転送をします。

::*> date show
  (cluster date show)
Node      Date                      Time zone
--------- ------------------------- -------------------------
FsxId02486ab43fc5902c8-01
          7/29/2024 09:45:32 +00:00 Etc/UTC
FsxId02486ab43fc5902c8-02
          7/29/2024 09:45:32 +00:00 Etc/UTC
2 entries were displayed.

::*> snapmirror update -source-path svmPeer30372260664:vol_ss_lock_2 -destination-path svm_apne1:vol_ss_lock_2_dst
Operation is queued: snapmirror update of destination "svm_apne1:vol_ss_lock_2_dst".

::*> date show
  (cluster date show)
Node      Date                      Time zone
--------- ------------------------- -------------------------
FsxId02486ab43fc5902c8-01
          7/29/2024 09:45:36 +00:00 Etc/UTC
FsxId02486ab43fc5902c8-02
          7/29/2024 09:45:36 +00:00 Etc/UTC
2 entries were displayed.

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ----------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst daily.2024-07-29_091710 Mon Jul 29 09:17:09 2024 204KB daily            -     320KB    -           -
.
.
(中略)
.
.
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_093410 Mon Jul 29 09:34:10 2024 220KB test2            -     332KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094020 Mon Jul 29 09:40:21 2024 204KB test2            -     340KB    -           7/29/2024 09:51:05 +00:00
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094030 Mon Jul 29 09:40:31 2024 200KB test2            -     340KB    -           7/29/2024 09:51:10 +00:00
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_094100
                                                    Mon Jul 29 09:41:00 2024 208KB -                -     340KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094230 Mon Jul 29 09:42:30 2024 164KB test2            -     352KB    -           7/29/2024 09:55:38 +00:00
9 entries were displayed.

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ----------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst daily.2024-07-29_091710 Mon Jul 29 09:17:09 2024 204KB daily            -     320KB    -           -
.
.
(中略)
.
.
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_093410 Mon Jul 29 09:34:10 2024 220KB test2            -     332KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094020 Mon Jul 29 09:40:21 2024 204KB test2            -     340KB    -           7/29/2024 09:51:05 +00:00
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094030 Mon Jul 29 09:40:31 2024 200KB test2            -     340KB    -           7/29/2024 09:51:10 +00:00
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_094100
                                                    Mon Jul 29 09:41:00 2024 208KB -                -     340KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094230 Mon Jul 29 09:42:30 2024 220KB test2            -     352KB    -           7/29/2024 09:55:38 +00:00
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094500 Mon Jul 29 09:45:00 2024 152KB test2            -     352KB    -           7/29/2024 09:55:43 +00:00
9 entries were displayed.

::*> snapshot show -volume vol_ss_lock_2* -fields snaplock-expiry-time, expiry-time, afs-used, size, create-time, snapmirror-label, state
vserver   volume            snapshot                create-time              size  snapmirror-label state afs-used expiry-time snaplock-expiry-time
--------- ----------------- ----------------------- ------------------------ ----- ---------------- ----- -------- ----------- --------------------
svm_apne1 vol_ss_lock_2_dst daily.2024-07-29_091710 Mon Jul 29 09:17:09 2024 204KB daily            -     320KB    -           -
.
.
(中略)
.
.
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_093410 Mon Jul 29 09:34:10 2024 220KB test2            -     332KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094020 Mon Jul 29 09:40:21 2024 204KB test2            -     340KB    -           7/29/2024 09:51:05 +00:00
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094030 Mon Jul 29 09:40:31 2024 200KB test2            -     340KB    -           7/29/2024 09:51:10 +00:00
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_094100
                                                    Mon Jul 29 09:41:00 2024 208KB -                -     340KB    -           -
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094230 Mon Jul 29 09:42:30 2024 220KB test2            -     352KB    -           7/29/2024 09:55:38 +00:00
svm_apne1 vol_ss_lock_2_dst test2.2024-07-29_094500 Mon Jul 29 09:45:00 2024 212KB test2            -     352KB    -           7/29/2024 09:55:43 +00:00
svm_apne1 vol_ss_lock_2_dst snapmirror.842f7a12-343e-11ef-b6f2-8596ce6d45bc_2150128487.2024-07-29_094533
                                                    Mon Jul 29 09:45:33 2024 124KB -                -     340KB    -           -
10 entries were displayed.

転送されたtest2の2つのSnapshotのsnaplock-expiry-timeを見比べると5秒差と、Snapshot取得間隔よりも短いですね。

このことからロック開始基準はSnapMirrorの転送完了のタイミングであることが分かります。

Tamperproof SnapshotとSnapLockの相性は抜群

Tamperproof SnapshotとSnapMirrorを組み合わせたときの挙動を確認してみました。

結論、Tamperproof SnapshotとSnapLockの相性は抜群ですね。転送先をSnapLockボリュームにするとSnapLockライセンス分の課金が発生しますが、Snapshotのロックであれば課金は発生しません。

SnapMirror Policyもvaultだけでなく、mirror-vaultでsm_createdのSnapshotを転送できるのもありがたいポイントですね。

この記事が誰かの助けになれば幸いです。

以上、AWS事業本部 コンサルティング部の のんピ(@non____97)でした!

この記事をシェアする

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.