Amazon FSx for NetApp ONTAPのキャパシティプールストレージのデータをプライマリストレージに移動させてみた

高性能なアクセスが必要になったときに
2022.09.30

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

キャパシティプールストレージのデータをプライマリストレージに移動させたい

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

皆さんはキャパシティプールストレージのデータをプライマリストレージに移動させたいなと思ったことはありますか? 私はあります。

今までプライマリストレージからキャパシティプールストレージへのデータの移行は何回かやりました。

ただ、その逆はやっていないので、どのような挙動をするのか非常に気になります。

階層化ポリシーをNONEにすることで即座にプライマリデータにデータを移行することができるのでしょうか。

検証した方が早いですね。やってみます。

いきなりまとめ

  • 階層化ポリシーをNONEにしても、即座に全てのデータがプライマリストレージに移動される訳ではない
  • デフォルトではランダムな読み込みをしなければプライマリストレージに移動されない
  • cloud-retrieval-policypromoteにすることで、読み込みを行わなくてもキャパシティプールストレージからプライマリストレージにデータの移動が行われる
    • データの移動は全てのデータが一気に移動するのではなく、じわじわと移動する
  • 階層化ポリシーをNONEにする場合はFSx for ONTAPファイルシステム全体でどの程度プライマリストレージに余裕があるのか確認してから行おう

検証環境

検証環境は以下の通りです。

構成図

階層化ポリシーをALLにしてデータをキャパシティプールストレージに移動させて、その後階層化ポリシーをNONEにするとどのような挙動をするのか確認します。

リソースは全てAWS CDKでデプロイします。リポジトリはこちらです。

検証をするにあたって、階層化ポリシーをAUTOからALLに変更しています。

./lib/fsx-for-ontap-stack.ts

// FSX for ONTAP volume
const volumeName = "fsx_for_ontap_volume";
const junctionPath = "/volume";
new fsx.CfnVolume(this, "Volume", {
  name: volumeName,
  ontapConfiguration: {
    junctionPath,
    sizeInMegabytes: "102400",
    storageEfficiencyEnabled: "true",
    storageVirtualMachineId: svm.ref,
    securityStyle: "UNIX",
    tieringPolicy: {
      name: "ALL",
    },
  },
  tags: [
    {
      key: "Name",
      value: volumeName,
    },
  ],
  volumeType: "ONTAP",
});

キャパシティプールストレージにデータを書き込む

それでは、試しに10GB程度のファイルを書き込んでみます。

$ sudo dd if=/dev/urandom of=/mnt/fsx/testfile_1 bs=1M count=10240
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB) copied, 81.7812 s, 131 MB/s

$ df -ht nfs4
Filesystem                                                                      Size  Used Avail Use% Mounted on
svm-047846da1d484718f.fs-0e1ec5462b9025d7b.fsx.us-east-1.amazonaws.com:/volume   95G   11G   85G  11% /mnt/fsx

$ ls -la /mnt/fsx
total 10527056
drwxr-xr-x 2 nobody nobody        4096 Sep 30 08:13 .
drwxr-xr-x 3 root   root            17 Sep 30 08:09 ..
-rw-r--r-- 1 nobody nobody 10737418240 Sep 30 08:14 testfile_1

FSx for ONTAPファイルシステムにSSHで接続して、ONTAP CLIからも確認してみます。

$ ssh fsxadmin@management.fs-0e1ec5462b9025d7b.fsx.us-east-1.amazonaws.com
The authenticity of host 'management.fs-0e1ec5462b9025d7b.fsx.us-east-1.amazonaws.com (10.0.1.40)' can't be established.
ECDSA key fingerprint is SHA256:y4Y6AJPikc6+DLQd+xUoRMSuRVClBTDpTJr8lkkvzLI.
ECDSA key fingerprint is MD5:de:84:8c:e8:0e:8d:d7:96:5c:f5:31:84:e5:49:58:70.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'management.fs-0e1ec5462b9025d7b.fsx.us-east-1.amazonaws.com,10.0.1.40' (ECDSA) to the list of known hosts.
Password:

This is your first recorded login.
FsxId0e1ec5462b9025d7b::> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                    156.3MB       2%
             Footprint in FSxFabricpoolObjectStore
                                                       10GB      98%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 11.69MB       0%

      Total Footprint                               10.26GB       1%

ほとんどのデータがキャパシティプールストレージに書き込まれているようですね。

階層化ポリシーをNONEに変えてみる

それでは階層化ポリシーをNONEに変えてみて、どのような挙動をするのか確認してみましょう。

AWS CDKで階層化ポリシーを変更します。

./lib/fsx-for-ontap-stack.ts

// FSX for ONTAP volume
const volumeName = "fsx_for_ontap_volume";
const junctionPath = "/volume";
new fsx.CfnVolume(this, "Volume", {
  name: volumeName,
  ontapConfiguration: {
    junctionPath,
    sizeInMegabytes: "102400",
    storageEfficiencyEnabled: "true",
    storageVirtualMachineId: svm.ref,
    securityStyle: "UNIX",
    tieringPolicy: {
      name: "NONE",
    },
  },
  tags: [
    {
      key: "Name",
      value: volumeName,
    },
  ],
  volumeType: "ONTAP",
});

AWS CDKで階層化ポリシー変更後、ONTAP CLIでボリュームのポリシーがNONEになっていることを確認します。

FsxId0e1ec5462b9025d7b::> volume show -volume fsx_for_ontap_volume -fields tiering-policy
vserver           volume               tiering-policy
----------------- -------------------- --------------
fsx-for-ontap-svm fsx_for_ontap_volume none

それでは、各ストレージの使用状況を確認します。

FsxId0e1ec5462b9025d7b::> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                    156.7MB       2%
             Footprint in FSxFabricpoolObjectStore
                                                       10GB      98%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 12.13MB       0%

      Total Footprint                               10.26GB       1%

20分ほど放置しましたが、ストレージ間でのデータの移動は発生していませんでした。

もしかしたら、階層化ポリシーAUTOと同じように、一度アクセスしないとプライマリストレージには移動しないかもしれません。

catでファイルにアクセスしてみます。

$ cat /mnt/fsx/testfile_1 > /dev/null

実行後、各ストレージの使用状況を確認します。

FsxId0e1ec5462b9025d7b::> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                    157.6MB       2%
             Footprint in FSxFabricpoolObjectStore
                                                       10GB      98%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 12.91MB       0%

      Total Footprint                               10.26GB       1%

特に変わりませんね。

階層化ポリシーAUTOはシーケンシャルな読み込みの時はプライマリストレージに移動しないので、今回も同じ理由かもしれません。

自動

  • ボリューム内のすべてのコールドブロックがクラウド階層に移動されます。アグリゲートの使用率が 50% を超えている場合、非アクティブなブロックがコールドになるまでに約 31 日かかります。自動クーリング期間は、「 tiering-minimum-cooling-days 」設定を使用して、 2 日から 63 日の間で調整できます。
  • 階層化ポリシーが「自動」に設定されているボリューム内のコールドブロックがランダムに読み取られると、ブロックがホットになり、パフォーマンス階層に書き込まれます。
  • 階層化ポリシーが「自動」に設定されているボリューム内のコールドブロックが順番に読み取られると、コールドブロックのままクラウド階層に残ります。パフォーマンス階層には書き込まれません。

ボリューム階層化ポリシーを設定します

強制的にプライマリストレージにデータを移動させる

強制的にプライマリストレージにデータを移動させる方法はないのでしょうか?

あります。

Beginning with ONTAP 9.8, if you are a cluster administrator at the advanced privilege level, you can proactively promote data to the performance tier from the cloud tier using a combination of the tiering-policy and the cloud-retrieval-policy setting.

Promote data to the performance tier overview

cloud-retrieval-policyで設定するようですね。

実際の操作方法もNetApp公式ドキュメントに記載あります。

-cloud-retrieval-policyのパラメーターを確認します。

  • default - This policy retrieves tiered data based on the underlying tiering policy. If the tiering policy is 'auto', tiered data is retrieved only for random client driven data reads. If the tiering policy is 'none' or 'snapshot-only', tiered data is retrieved for random and sequential client driven data reads. If the tiering policy is 'all', tiered data is not retrieved.

  • on-read - This policy retrieves tiered data for all client driven data reads.

  • never - This policy never retrieves tiered data.

  • promote - This policy retrieves all eligible tiered data automatically during the next scheduled scan. It is only supported when the tiering policy is 'none' or 'snapshot-only'. If the tiering policy is 'snapshot-only', the only data brought back is the data in the AFS. Data that is only in a snapshot copy stays in the cloud.

シーケンシャルな読み込み時もプライマリストレージに移動させたい場合はon-readで、とにかくプライマリストレージに移動させたい場合はpromoteを指定するようです。

早速やってみます。

# 特権モードに変更
FsxId0e1ec5462b9025d7b::> set advanced

Warning: These advanced commands are potentially dangerous; use them only when directed to do so by NetApp personnel.
Do you want to continue? {y|n}: y

# 現在の cloud-retrieval-policy を確認
FsxId0e1ec5462b9025d7b::*> volume show -volume fsx_for_ontap_volume -fields cloud-retrieval-policy
vserver           volume               cloud-retrieval-policy
----------------- -------------------- ----------------------
fsx-for-ontap-svm fsx_for_ontap_volume default

# 全てのデータをプライマリストレージに移動するようポリシーを変更
FsxId0e1ec5462b9025d7b::*> volume modify -volume fsx_for_ontap_volume -cloud-retrieval-policy promote

Warning: The "promote" cloud retrieve policy retrieves all of the cloud data for the specified volume. If the tiering policy is "snapshot-only" then only AFS data is
         retrieved. If the tiering policy is "none" then all data is retrieved. Volume "fsx_for_ontap_volume" in Vserver "fsx-for-ontap-svm" is on a FabricPool, and there
         are approximately 10737418240 bytes tiered to the cloud that will be retrieved. Cloud retrieval may take a significant amount of time, and may degrade performance
         during that time. The cloud retrieve operation may also result in data charges by your object store provider.
Do you want to continue? {y|n}: y
Volume modify successful on volume fsx_for_ontap_volume of Vserver fsx-for-ontap-svm.

# 設定したポリシーを確認
FsxId0e1ec5462b9025d7b::*> volume show -volume fsx_for_ontap_volume -fields tiering-policy, cloud-retrieval-policy
vserver           volume               tiering-policy cloud-retrieval-policy
----------------- -------------------- -------------- ----------------------
fsx-for-ontap-svm fsx_for_ontap_volume none           promote

この状態で各ストレージの使用状況を確認してみます。

# 1回目
FsxId0e1ec5462b9025d7b::*> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                     2.35GB      23%
             Footprint in FSxFabricpoolObjectStore
                                                     7.80GB      77%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 14.07MB       0%

      Total Footprint                               10.26GB       1%

# 2回目
FsxId0e1ec5462b9025d7b::*> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                     2.51GB      25%
             Footprint in FSxFabricpoolObjectStore
                                                     7.65GB      75%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 14.93MB       0%

      Total Footprint                               10.26GB       1%

# 3回目
FsxId0e1ec5462b9025d7b::*> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                     2.80GB      28%
             Footprint in FSxFabricpoolObjectStore
                                                     7.36GB      72%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 17.10MB       0%

      Total Footprint                               10.26GB       1%

# 4回目
FsxId0e1ec5462b9025d7b::*> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                     3.75GB      37%
             Footprint in FSxFabricpoolObjectStore
                                                     6.41GB      63%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 18.98MB       0%

      Total Footprint                               10.26GB       1%

# 5回目
FsxId0e1ec5462b9025d7b::*> volume show-footprint -volume fsx_for_ontap_volume

      Vserver : fsx-for-ontap-svm
      Volume  : fsx_for_ontap_volume

      Feature                                          Used    Used%
      --------------------------------           ----------    -----
      Volume Data Footprint                         10.14GB       1%
             Footprint in Performance Tier
                                                     4.97GB      49%
             Footprint in FSxFabricpoolObjectStore
                                                     5.20GB      51%
      Volume Guarantee                                   0B       0%
      Flexible Volume Metadata                      107.5MB       0%
      Delayed Frees                                 22.89MB       0%

      Total Footprint                               10.27GB       1%

すぐに全てのデータが移動するのではなく、じわじわとプライマリストレージに移動されて行ってますね。

CloudWatch メトリクスからもプライマリストレージとキャパシティプールストレージの使用量の推移を確認しましょう。

CloudWatch メトリクスからもプライマリストレージとキャパシティプールストレージの使用量の推移を確認

本当にじわじわと移動していますね。

高性能なアクセスが必要になったときに

Amazon FSx for NetApp ONTAPのキャパシティプールストレージのデータをプライマリストレージに移動させてみました。

階層化ポリシーをNONEにするだけでは移動されず、実際に読み込んだり、cloud-retrieval-policypromoteに変更したりと何かしらの追加のアクションが必要なことが分かりました。

翌日に実験を控えていて、普段アクセスしないデータに大量・高速にアクセスさせたい場面などで使えそうですね。

また、大量のデータがキャパシティプール内にある階層化ポリシーをNONEにする場合はFSx for ONTAPファイルシステム全体でどの程度プライマリストレージに余裕があるのか確認してから行いましょう。

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

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