Ensure you have Python 3.12+ installed by running the following command:
python3 --version
If you get an error indicating that you do not have Python installed, visit https://www.python.org/downloads/ and download the latest version. Follow the instructions on the installation wizard to ensure the latest version of Python is installed.
If the version is less than 3.12, update your local Python installation by visiting the above link.
Once Python is installed and updated to the latest version, navigate to the project folder and run python3 main.py
.
This will load the tool and run the necessary checks on your ONTAP cluster to ensure a snapshot policy can be created. Then, a menu of snapshot policy fields will be presented for you to fill out. Your current policy properties will be displayed in a in-terminal menu at the top of the terminal.
The APIs used in this tool are all public-facing endpoints in ONTAP.
The following endpoints are called during the policy creation process.
Retrieves the most up-to-date list of SVMs on the cluster.
Retrieves the most up-to-date list of created schedules.
The following endpoints are called during the cluster validation process.
Retrieves all cluster licenses to check whether a valid snaplock license is installed.
Retrieves a list of compliance clocks to check whether there exists a initialized compliance clock on the cluster
Used to validate ONTAP version being 9.14+
Used to map consistency groups to their constituent volumes
Used to retrieve all type 'rw' volumes
Used to check which of the rw volumes are already in a snapmirror relationship
When creating a policy, the user is prompted to define five properties of the new policy:
- Policy name
- SVM
- Schedule
- Keep Count
- Retention Period
When checking to see if a snaplock policy can be created for the given cluster, the following checks are run:
- ONTAP version is 9.14+
- Valid snaplock license is installed
- Compliance clock is initialized
- There exists rw volumes not currently in a snapmirror relationship
- TODO: Check that the FabricPool policy is set to None