Skip to content

Commit 079bc07

Browse files
committed
Made minor tweaks to the documentation; Added the volume name to the fsx_inventor_report.
1 parent 11fff08 commit 079bc07

File tree

4 files changed

+45
-39
lines changed

4 files changed

+45
-39
lines changed

Ansible/fsx_inventory_report/README.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
# Ansible Inventory Report
22
This Ansible playbook generates a report of all the FSx for ONTAP file systems within an AWS account.
3-
In includes all the SVMs and Volumes.
3+
In includes all the SVMs and Volumes. The format of the report is as follows:
4+
```
5+
Region: <region_name>
6+
File System ID: <file-system-id-1>
7+
SVM ID: <svm-id-1-1>
8+
Volumes:
9+
<volume-id-1-1-1> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
10+
<volume-id-1-1-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
11+
SVM ID: <svm-id-1-2>
12+
Volumes:
13+
<volume-id-1-2-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
14+
<volume-id-1-2-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
15+
File System ID: <file-system-id-2>
16+
SVM ID: <svm-id-2-1>
17+
Volumes:
18+
<volume-id-2-1-1> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
19+
<volume-id-2-1-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
20+
SVM ID: <svm-id-2-2>
21+
Volumes:
22+
<volume-id-2-2-1> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
23+
<volume-id-2-2-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name>
24+
```
25+
Where:
26+
- \<volume-size-in-megabytes> is the provisioned size of the volume in megabytes.
27+
- \<security-style> is the security style of the volume (e.g. UNIX, NTFS).
28+
- \<volume-type> is the type of the volume (e.g. RW, DP).
429

530
## Requirements
6-
- Ansible 2.9 or later
7-
- AWS Ansible collection
31+
- jq - A lightweight and flexible command-line JSON processor. Installation instructions can be found [here](https://jqlang.github.io/jq/download/)
32+
- Ansible 2.9 or later. Installation instructions can be found [here](https://docs.ansible.com/ansible/latest/installation_guide/index.html)
33+
- AWS Ansible collection. This should be included with the base installation of Ansible.
834

935
## Installation
1036
There are three files used to create the report:
@@ -25,35 +51,6 @@ To generate the report copy the three files mentioned above and run the followin
2551
ansible-playbook generate_report.yaml
2652
```
2753

28-
## Output
29-
After a successful run, the report will be saved to the file path specified in the `report_name` variable.
30-
The format of the report is as follows:
31-
```
32-
Region: <region_name>
33-
File System ID: <file-system-id-1>
34-
SVM ID: <svm-id-1-1>
35-
Volumes:
36-
<volume-id-1-1-1> <volume-size-in-megabytes> <security-style> <volume-type>
37-
<volume-id-1-1-2> <volume-size-in-megabytes> <security-style> <volume-type>
38-
SVM ID: <svm-id-1-2>
39-
Volumes:
40-
<volume-id-1-1-1> <volume-size-in-megabytes> <security-style> <volume-type>
41-
<volume-id-1-1-2> <volume-size-in-megabytes> <security-style> <volume-type>
42-
File System ID: <file-system-id-2>
43-
SVM ID: <svm-id-2-1>
44-
Volumes:
45-
<volume-id-2-1-1> <volume-size-in-megabytes> <security-style> <volume-type>
46-
<volume-id-2-1-2> <volume-size-in-megabytes> <security-style> <volume-type>
47-
SVM ID: <svm-id-2-2>
48-
Volumes:
49-
<volume-id-2-2-1> <volume-size-in-megabytes> <security-style> <volume-type>
50-
<volume-id-2-2-2> <volume-size-in-megabytes> <security-style> <volume-type>
51-
```
52-
Where:
53-
- \<volume-size-in-megabytes> is the provisioned size of the volume in megabytes.
54-
- \<security-style> is the security style of the volume (e.g. UNIX, NTFS).
55-
- \<volume-type> is the type of the volume (e.g. RW, DP).
56-
5754
## Author Information
5855

5956
This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors).

Ansible/fsx_inventory_report/process_region.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
---
77
- name: Get all the FSxNs for the specified region.
88
ansible.builtin.shell:
9-
cmd: aws fsx describe-file-systems --region {{ region }} --query 'FileSystems[*].{FileSystemId:FileSystemId}' --output text | sed -e '/^$/d'
9+
cmd: aws fsx describe-file-systems --region {{ region }} --query 'FileSystems[*].{FileSystemId:FileSystemId}' --output text | sed -e '/^$/d'
1010
register: fsxn_ids_per_region
1111

1212
- name: Get all the SVMs and volumes for each FSxN.
@@ -19,6 +19,6 @@
1919
for svm in $svms; do
2020
echo " SVM ID: ${svm}" >> {{ report_name }};
2121
echo " Volume IDs:" >> {{ report_name }};
22-
aws fsx describe-volumes --filters Name=storage-virtual-machine-id,Values=${svm} --region {{ region }} --output=text --query 'Volumes[*].{Size: OntapConfiguration.SizeInMegabytes, ID: VolumeId, Type: OntapConfiguration.OntapVolumeType, Style: OntapConfiguration.SecurityStyle}' | sed -e 's/^/ /' >> {{ report_name }};
22+
aws fsx describe-volumes --filters Name=storage-virtual-machine-id,Values=${svm} --region {{ region }} --output=json --query 'Volumes[*].{Size: OntapConfiguration.SizeInMegabytes, ID: VolumeId, Name: Name, Type: OntapConfiguration.OntapVolumeType, Style: OntapConfiguration.SecurityStyle}' | jq -r '.[] | " \(.ID) \(.Type) \(.Style) \(.Size) \(.Name)"' >> {{ report_name }};
2323
done
2424
loop: "{{ fsxn_ids_per_region.stdout_lines }}"

Ansible/snapmirror_report/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ The output of the report is a CSV file with the following columns:
66
- Destination Path (svm:volume)
77
- State (e.g. snapmirrored, broken-off)
88
- Healthy (true or false)
9-
- lag\_time (in "P#DT#H#M#S" format, where 'P' and 'T' are fixed characters, and the number before the other letters specify how many Days, Hours, Minutes and Seconds have transpired)
9+
- lag\_time (in "P#DT#H#M#S" format. See below for an explanation)
10+
11+
The lag\_time format always starts with the letter 'P' and if the lag time is more than 24 hours it is followed by
12+
a number and the letter 'D'. The number is the number of days. The next character is always a 'T' and is followed by
13+
a number, letter pairs, where the letter is either an 'H', 'M', or 'S'. If the letter is 'H' then number before it is
14+
the number of hours. If the letter is 'M' then number before it is the number of minutes. If the letter is 'S' then
15+
number before it is the number of seconds. For example, 'P1DT2H3M4S' represents 1 day, 2 hours, 3 minutes, and 4 seconds.
1016

1117
## Requirements
12-
- Ansible 2.9 or later
13-
- AWS Ansible collection
14-
- AWS secret(s) with the credentials neccesary to run SnapMirror ONTAP APIs against the FSx for ONTAP file systems.
18+
- jq - A lightweight and flexible command-line JSON processor. Installation instructions can be found [here](https://jqlang.github.io/jq/download/)
19+
- Ansible 2.9 or later. Installation instructions can be found [here](https://docs.ansible.com/ansible/latest/installation_guide/index.html)
20+
- AWS Ansible collection. This should be included with the base installation of Ansible.
21+
- AWS secret(s) with the credentials necessary to run SnapMirror ONTAP APIs against the FSx for ONTAP file systems. The required format of the secret is described below.
1522

1623
## Installation
1724
There are three files used to create the report:
@@ -24,6 +31,8 @@ The format of the file should be:
2431
```
2532
file_system_id,secret_name
2633
```
34+
NOTE: Do not add any spaces before or after the file\_system\_id or secret\_name.
35+
2736
Each secret should have two `keys`:
2837
| Key | Value |
2938
| --- | --- |

Ansible/snapmirror_report/generate_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
---
66
- vars:
77
report_name: output.csv
8-
secrets_list_file: secrets.csv
8+
secrets_list_file: secrets_list.csv
99
secrets_region: us-west-2
1010
#################################################################################
1111
#

0 commit comments

Comments
 (0)