22
33## Introduction
44This sample provides a script that can be used to warm a FSx for ONTAP
5- volume. In other words, it ensures that all the blocks for a volume are in
5+ volume. In other words, it tries to ensure that all the blocks for a volume are in
66the "performance tier" as opposed to the "capacity tier." It does that by
77simply reading every byte of every file in the volume. Doing that
88causes all blocks that are currently in the capacity tier to be pulled
99into the performance tier before being returned to the reader. At that point,
10- assuming the tiering policy is not set to 'all', all the data should remain
10+ assuming the tiering policy is not set to 'all' or 'snapshot' , all the data should remain
1111in the performance tier until ONTAP tiers it back based on the volume's
1212tiering policy.
1313
14- Note that Data ONTAP will not store data in the performance
15- tier from the capacity tier if it detects that the data is being read
16- sequentially. This is to keep things like backups and virus scans from
17- filling up the performance tier. Because of that, this script will
14+ Note that by default Data ONTAP will not store data in the performance
15+ tier from the capacity tier if it detects that the data is being read sequentially.
16+ This is to keep things like backups and virus scans from filling up the performance tier.
17+ You can, and should, override this behavior by setting
18+ the cloud-retrieval-policy to "on-read" for the volume. Examples on
19+ how to do that are shown below.
20+
21+ To further try and keep ONTAP from now keeping data in the performance tier
22+ after reading it in, this script will
1823read files in "reverse" order. Meaning it will read the last block of
1924the file first, then the second to last block, and so on.
2025
@@ -34,20 +39,41 @@ You can use the `volume show-footprint` ONTAP command to see how much space
3439is currently in the capacity tier. You can then use ` storage aggregate show `
3540to see how much space is available in the performance tier.
3641
42+ Note that it will not be uncommon for there to still be data in the
43+ capacity tier after running this script. There can be several reasons
44+ for that. For example:
45+
46+ * Space is from snapshots that aren't part of the live volume anymore.
47+ * Space from blocks that are part of a object in the object store, but aren't
48+ part of the volume. This space will get consolidated eventaully.
49+ * Some is from metadata that is always kept in the capacity tier.
50+
51+ Even with the reasons mentioned above, we have found that running the
52+ script twice does, typically, get more data into the performance tier so
53+ if you are trying to get as much data as possible into the performance tier,
54+ it is recommended to run the script twice.
55+
3756## Set Up
38- The script is meant to be run on a Linux based host that is able to NFS
57+ The first step is ensure the volume's tiering policy is set
58+ to something other than "all" or "snapshot-only". You should also ensure
59+ that the cloud-retreival-policy to set to "on-read". You can make
60+ both of these changes with the following commands:
61+ ```
62+ set advanced -c off
63+ volume modify -vserver <vserver> -volume <volume> -tiering-policy auto -cloud-retrieval-policy on-read
64+ ```
65+ Where ` <vserver> ` is the name of the SVM and ` <volume> ` is the name of the volume.
66+
67+ The next perperational step is to copy the scrip to a Linux based host that is able to NFS
3968mount the volume to be warmed. If the volume is already mounted, then
40- any user that has read access to the files in the volume can run it.
69+ any user that has read access to all the files in the volume can run it.
4170Otherwise, the script needs to be run as 'root' so it can mount the
4271volume before reading the files.
4372
44- If the 'root' user can't read the files in the volume, then you should use 'root' user just
73+ If the 'root' user can't read the all files in the volume, then you should use 'root' user just
4574to mount the volume and then run the script from a user ID that can read the contents
4675of all the files in the volume.
4776
48- Make sure you have set the tiering policy on the volume set to something
49- other than "all" or "snapshot-only", otherwise the script will be ineffective.
50-
5177# Running The Script
5278There are two main ways to run the script. The first is to just provide
5379the script with a directory to start from using the -d option. The script will then read
@@ -66,7 +92,7 @@ To run this script you just need to change the UNIX permissions on
6692the file to be executable, then run it as a command:
6793```
6894chmod +x warm_performance_tier
69- ./warm_performance_tier -d /path/to/mount/point
95+ ./warm_performance_tier -d /path/to/mount/point
7096```
7197The above example will force the script to read every file in the /path/to/mount/point
7298directory and any directory under it.
@@ -88,8 +114,8 @@ Where:
88114 -v volume_name - Is the name of the volume.
89115 -n nfs_type - Is the NFS version to use. Default is nfs4.
90116 -d directory - Is the root directory to start the process from.
91- -t max_directory_threads - Is the maximum number of threads to use to process directories. The default is 10.
92- -x max_read_threads - Is the maximum number of threads to use to read files. The default is 4 .
117+ -t max_directory_threads - Is the maximum number of threads to use to process directories. The default is 5
118+ -x max_read_threads - Is the maximum number of threads to use to read files. The default is 2 .
93119 -V - Enable verbose output. Displays the thread ID, date (in epoch seconds), then the directory or file being processed.
94120 -h - Prints this help information.
95121
@@ -101,6 +127,15 @@ Notes:
101127 reading files.
102128```
103129
130+ ## Finishing Step
131+ After running the script, you should set the cloud-retrieval-policy back to "default" by running
132+ the following commands:
133+ ```
134+ set advanced -c off
135+ volume modify -vserver <vserver> -volume <volume> -cloud-retrieval-policy default
136+ ```
137+ Where ` <vserver> ` is the name of the SVM and ` <volume> ` is the name of the volume.
138+
104139## Author Information
105140
106141This repository is maintained by the contributors listed on [ GitHub] ( https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors ) .
0 commit comments