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 all the blocks for a volume are in
6- the "performance tier" as opposed to the "capacity tier." It does that
7- simply by reading every byte of every file in the volume. Doing that
8- causes any block that is currently in the capacity tier to be pulled
5+ volume. In other words, it ensures that all the blocks for a volume are in
6+ the "performance tier" as opposed to the "capacity tier." It does that by
7+ simply reading every byte of every file in the volume. Doing that
8+ causes 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
11- in the performance tier until the policy tiers it back out to the capacity tier.
10+ assuming, the tiering policy is not set to 'all', all the data should remain
11+ in the performance tier until ONTAP tiers it back based on the volume's
12+ tiering policy.
13+
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
18+ read files in "reverse" order. Meaning it will read the last block of
19+ the file first, then the second to last block, and so on.
1220
1321To speed up the process, the script will spawn multiple threads to process
1422the volume. It will spawn a separate thread for each directory
@@ -19,13 +27,12 @@ will spawn -x reader threads **per** directory thread. So for example, if you ha
1927directory threads and 10 reader threads, you could have up to 40 reader
2028threads running at one time.
2129
22- You can specify a FSx for ONTAP file system data endpoint and a volume
23- name to the script and it will attempt to mount the volume if it isn't already.
24- If it does mount it, it will mount it read-only and unmount
25- when it is done. The script assumes that the junction path is the same
26- as the volume name. If this isn't the case, then just mount the volume
27- before running the script and provide the path to the mount point
28- with the -d option.
30+ Since the goal of this script is to force all the data that is currently
31+ in the capacity tier to the performance tier you should ensure you have
32+ enough free space in your performance tier to hold all the data in the volume.
33+ You can use the ` volume show-footprint ` ONTAP command to see how much space
34+ is currently in the capacity tier. You can then use ` storage aggregate show `
35+ to see how much space is available in the performance tier.
2936
3037## Set Up
3138The script is meant to be run on a Linux based host that is able to NFS
@@ -34,21 +41,38 @@ any user that has read access to the files in the volume can run it.
3441Otherwise, the script needs to be run as 'root' so it can mount the
3542volume before reading the files.
3643
37- Once the volume has been mounted, then the script should be run by
38- a user that has read access to all the files in the volume.
44+ If the 'root' user can't read the files in the volume, then you should use 'root'
45+ to mount the volume first and then run the script from a user ID that can read the contents
46+ of all the files in the volume.
3947
40- Of course it only makes sense to have the tiering policy on the volume
41- set to something other than "all", otherwise the script will be ineffective.
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.
4250
4351# Running The Script
44- To run this script you just need to change the UNIX permissions on the file to be executable, then run it as a command:
52+ There are two main ways to run the script. The first is to just provide
53+ the script with a directory to start from. The script will then read
54+ every file in that directory and all subdirectories. The second way
55+ is to provide the script with the FSx for ONTAP file system data endpoint
56+ and the volume name. The script will then attempt to mount the volume
57+ if it isn't already mounted. If it does mount it, it will mount it read-only
58+ and unmount when it is done.
59+
60+ In order to mount the volume the script assumes that the junction path is the same
61+ as the volume name. If this isn't the case, then just mount the volume first
62+ before running the script and provide the path to the mount point
63+ with the -d option.
64+
65+ To run this script you just need to change the UNIX permissions on
66+ the file to be executable, then run it as a command:
4567```
4668chmod +x warm_performance_tier
4769 ./warm_performance_tier -d /path/to/mount/point
4870```
49- The above example will force the script to read every file in the /path/to/mount/point directory.
71+ The above example will force the script to read every file in the /path/to/mount/point
72+ directory and any directory under it.
5073
51- If you want to script to ensure the volume is mounted, you can specify the filesystem endpoint and volume name:
74+ If you want the script to ensure the volume is mounted, you can specify
75+ the file system data endpoint and volume name:
5276```
5377./warm_performance_tier -f fsxfileserver.us-west-2.amazonaws.com -v myvolume
5478```
0 commit comments