Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ usage () {
cat 1>&2 <<EOF
Usage $(basename $0) [-r region] [-a] [-X excludeRegions] [-n] [-c] [-s] [-b] [-i fileSystemId] [-f fileSystemName] [-x] [-t seconds] [-e endpoint_url] [pattern]
Where: pattern - means to only show file systems whos name match the pattern.
-r region allows you to specify the region you want the list from.
-r means to only search the specified region(s) (comma separated list).
-a means all regions.
-X excludeRegions allows you to specify a comma separated list of regions to exclude from the -a option.
-c means to display a hierarchical view of each filesystem including svms and volumes.
Expand All @@ -71,8 +71,16 @@ start_watchdog () {
maxTime=$2
region=$3

sleep $maxTime
if ps -p $pid > /dev/null; then
i=1
while [ $i -le $((maxTime * 2)) ]; do
if ! ps -p $pid > /dev/null 2>&1; then
return 0
fi
sleep .5
let i+=1
done

if ps -p $pid > /dev/null 2>&1; then
printf "\nWarning, timed out while getting the list of FSxNs from the $region region.\nConsider excluding it with the -X option or raising the timeout with the -t option.\n" 1>&2
pkill -P $pid
kill $pid
Expand Down Expand Up @@ -265,7 +273,7 @@ maxTime=20
# Process command line arguments.
while getopts "bhcxsaX:nr:i:f:e:t:" option; do
case "$option" in
r) region="$OPTARG"
r) region="$(echo $OPTARG | sed -e 's/,/ /g')"
;;
a) allRegions=true
;;
Expand Down Expand Up @@ -322,7 +330,6 @@ if [ "$allRegions" == "true" ]; then
# support FSxN
allEndabledRegions=$(aws ec2 describe-regions --query "Regions[].RegionName" --output=json | jq -r '.[]')
allFsxnRegions=$(curl -s https://api.regional-table.region-services.aws.a2z.com/index.json | jq -r '.prices[] | select(.attributes."aws:serviceName" == "Amazon FSx for NetApp ONTAP") .attributes."aws:region"' | egrep -v "$excludeRegions")
# allFsxnRegions=$(curl -s https://api.regional-table.region-services.aws.a2z.com/index.json | jq -r '.prices[] | select(.attributes."aws:serviceName" == "Amazon FSx for NetApp ONTAP") .attributes."aws:region"')
for reg in $allEndabledRegions; do
for fsxnReg in $allFsxnRegions; do
if [ $reg == $fsxnReg ]; then
Expand Down
22 changes: 16 additions & 6 deletions Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_svms
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# o Region
# o File system ID
# o File System Name - optional
# o The managment and NAS IP address of the SVM - optional
# o The management and NAS IP address of the SVM - optional
# o SVM ID
# o SVM Name
################################################################################
Expand All @@ -30,6 +30,7 @@ usage () {
cat 1>&2 <<EOF
Usage $(basename $0) [-r region] [-a] [-X excludeRegiosn] [-n] [-p] [-i fileSystemID] [-f fileSystemName] [-t seonds] [-e endpoint_url]
Where: -a means all regions.
-r means to only search the specified region(s) (comma separated list).
-X means to exclude the specified regions (comma separated list) from the -a option.
-n means to include file systems name.
-p means to include the management and NAS IP address.
Expand All @@ -43,16 +44,25 @@ EOF

################################################################################
# This function is used to kill a process, who's ID is passed as the first
# argument, that is running longger than the time specified as the second
# argurment.
# argument, that is running longer than the time specified as the second
# argument.
################################################################################
start_watchdog () {

pid=$1
maxTime=$2
region=$3
sleep $maxTime
if ps -p $pid > /dev/null; then

i=1
while [ $i -le $((maxTime*2)) ]; do
if ! ps -p $pid > /dev/null 2>&1; then
return
fi
sleep .5
let i+=1
done

if ps -p $pid > /dev/null 2>&1; then
printf "\nWarning, timed out while getting the list of SVMs from the $region region.\nConsider excluding it with the -X option or raising the timeout with the -t option.\n" 1>&2
pkill -P $pid
kill $pid
Expand Down Expand Up @@ -129,7 +139,7 @@ excludeRegions="none"
maxTime=20
while getopts "haX:nr:i:f:pe:t:" option; do
case "$option" in
r) region="$OPTARG"
r) region="$(echo "$OPTARG" | sed -e 's/,/ /g')"
;;
a) allRegions=true
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ usage () {
Usage $(basename $0) [-r region] [-a] [-X excludeRegions] [-o] [-f fileSystemName] [-i fileSystemId] [-n] [-s svmID] [-x] [-t seconds] [-e endpoint_url] [volume_pattern]
Where: volume_pattern - Only volumes that match the egrep pattern will be included.
An assumed '^' and '$' is added to the beginning and end of the pattern respectively.
-r region allows you to specify the region you want the list from.
-r means to only include the specified region(s) (comma separated list).
-a means all regions.
-X excludeRegions - Comma separated list of regions to exclude from the search. Only valid when -a is specified.
-n means include the file system and SVM names. Not compatible with the -x option.
Expand All @@ -53,16 +53,25 @@ EOF

################################################################################
# This function is used to kill a process, who's ID is passed as the first
# argument, that is running longger than the time specified as the second
# argurment.
# argument, that is running longer than the time specified as the second
# argument.
################################################################################
start_watchdog () {

pid=$1
maxTime=$2
region=$3
sleep $maxTime
if ps -p $pid > /dev/null; then

i=1
while [ $i -le $((maxTime * 2)) ]; do
if ! ps -p $pid > /dev/null 2>&1; then
return
fi
sleep .5
let i+=1
done

if ps -p $pid > /dev/null 2>&1; then
printf "\nWarning, timed out while getting the list of SVMs from the $region region.\nConsider excluding it with the -X option or raising the timeout with the -t option.\n" 1>&2
pkill -P $pid
kill $pid
Expand Down Expand Up @@ -214,7 +223,7 @@ volumePattern="*"
maxTime=30
while getopts "hr:aX:f:i:nos:xe:t:" option; do
case "$option" in
r) region="$OPTARG"
r) region="$(echo $OPTARG | sed -e 's/,/ /g')"
;;
a) allRegions=true
;;
Expand Down
40 changes: 33 additions & 7 deletions Management-Utilities/warm_performance_tier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,25 @@ script twice does, typically, get more data into the performance tier so
if you are trying to get as much data as possible into the performance tier,
it is recommended to run the script twice.

There are two versions of the script:
o `warm_performance_tier` - Disigned for Linux.
o `WarmPerformanceTier.ps1` - Designed for Windows.

## Set Up
The first step is to ensure the volume's tiering policy is set
to something other than "all" or "snapshot-only". You should also ensure
that the cloud-retrieval-policy is set to "on-read". You can make
both of these changes with the following commands:
```
set advanced -c off
set advanced
volume modify -vserver <vserver> -volume <volume> -tiering-policy auto -cloud-retrieval-policy on-read
```
Where `<vserver>` is the name of the SVM and `<volume>` is the name of the volume.

The next step is to copy the script to a Linux based host that is able to NFS
mount the volume to be warmed. If the volume is already mounted, then
The next step is to copy the appropriate script, either the Linux based one or the Windows
based one, to the system that has access to the volume to be warmed.

On a Linux based system, if the volume is already mounted, then
any user that has read access to all the files in the volume can run it.
Otherwise, the script needs to be run as 'root' so it can mount the
volume before reading the files.
Expand All @@ -73,7 +79,9 @@ If the 'root' user can't read the all files in the volume, then you should use t
to mount the volume and then run the script from a user ID that can read the contents
of all the files in the volume.

# Running The Script
## Running The Script

### Running the script on a Linux-based operating system
There are two main ways to run the script. The first is to just provide
the script with a directory to start from using the -d option. The script will then read
every file in that directory and all its subdirectories. The second way
Expand Down Expand Up @@ -115,7 +123,7 @@ Where:
-d directory - Is the root directory to start the process from.
-t max_directory_threads - Is the maximum number of threads to use to process directories. The default is 2.
-x max_read_threads - Is the maximum number of threads to use to read files. The default is 5.
-V - Enable verbose output. Displays the thread ID, date (in epoch seconds), then the directory or file being processed.
-V - Enable verbose output. Displays progress information on the files being read.
-h - Prints this help information.

Notes:
Expand All @@ -126,11 +134,29 @@ Notes:
reading files.
```

### Runing the script on a Windows based operating system

To run on a Windows based operating system, you will need to run the script from a
PowerShell prompt. You can run the script with the following command:
```
.\WarmPerformanceTier.ps1 -Path \\fsx-server\myshare
```
Where `\\fsx-server\myshare` is the UNC path or mapped drive letter to the share/volume root.

The script supports the following options:

* Path - UNC path or mapped drive letter to the share/volume root, e.g. \\fsx-server\myshare
* ThreadCount - Number of files to read in parallel. Default 8.
* BlockSizeMB - Block size in MB used for the out-of-order reads. Default 2
* ReadMethod - 'Reverse' (read blocks back-to-front) or 'Random' (shuffle block order). Default is 'Reverse'.
* BatchSize - How many files to queue at once before waiting for that batch to finish.
Bounds memory usage on volumes with very large file counts. Default is ThreadCount * 4.

## Finishing Step
After running the script, you should set the cloud-retrieval-policy back to "default" by running
the following commands:
```
set advanced -c off
set advanced
volume modify -vserver <vserver> -volume <volume> -cloud-retrieval-policy default
```
Where `<vserver>` is the name of the SVM and `<volume>` is the name of the volume.
Expand All @@ -149,4 +175,4 @@ Unless required by applicable law or agreed to in writing, software distributed

See the License for the specific language governing permissions and limitations under the License.

© 2024 NetApp, Inc. All Rights Reserved.
© 2026 NetApp, Inc. All Rights Reserved.
Loading
Loading