In this blog post I am going to build upon the example shown in my blog post Everpure Flash Array NFS: Making a read/writeable snapshot clone using the Purity GUI and show how to automate the process by leveraging the Purity REST API, and the pypureclient Python package.
The referenced post showed how to use the Purity GUI to clone one or more file systems that were part of a Pod in Purity. The cloned file systems could then be exported with new export names, and revised policies and rules. The approach allowed for the rapid cloning of the entire file system, which can be very useful for database administrators wishing to rapidly clone an NFS based database.
Furthermore, the cloned file systems consume very little capaciy. Since they are exact copies of the Pod that was cloned, the newly created file systems require only the delta that between the source and target. This can be very helpful when cloning larger databases when storage capacities are limited.
Whereas the GUI approach is simple enough that everyone should feel comfortable doing it, users may also require a scripted version that allows for execution under a job schedule, or if the DBA team does not have credentials to log into Purity.
NOTE: This example has no database awareness. This blog post covers an automated process for rapidly cloning one or more file systems contained with a Pod in Purity, and then optionally re-exporting the cloned file systems under new NFS export names. Database steps such as quiescing, renaming of databases, recovery and restarting are beyond the scope of this blog post.
The Purity operating system takes a code-first approach to storage management. Almost every operation possible in the Purity operating system can be called through a REST API. There is no need for external interface boxes or gateways. This means that we can leverage that REST API to automate all of the steps shown in the GUI.
The REST API documentation is available publically at: REST API document link
The REST call that clones the pod is post_pods. The following is an example of calling it interactively using Python to clone a pod called gct-pod-ora-swingdb to a new pod named gct-pod-clone-xxx:
mypod={ 'name': 'gct-pod-clone-xxx', 'quota_limit': 0, 'requested_promotion_state': 'promoted', 'source': {'name': 'gct-pod-ora-swingdb'},}>>> print (mypod){'name': 'gct-pod-clone-xxx', 'quota_limit': 0, 'requested_promotion_state': 'promoted', 'source': {'name': 'gct-pod-ora-swingdb'}}>>> myArray.post_pods( names=['gct-pod-clone-xxx'], pod=mypod ){'continuation_token': None, 'headers': {'x_ratelimit_limit_minute': None, 'x_ratelimit_limit_second': None, 'x_ratelimit_remaining_minute': None, 'x_ratelimit_remaining_second': None, 'x_request_id': '3336b18c-01cd-4577-8462-abb62b16755c'}, 'items': , 'status_code': 200, 'total_item_count': None}
Our sample script then checks to ensure that the specified source pod does in fact exist, and that the new pod to be created does not. This check extends to the file systems themselves which will have a suffix appended to their names. The script needs to check that there are not already file systems with the names that will be generated.
Furthermore, each NFS exported directory on an Everpure Flash Array has a policy which holds rules for that export. One policy may cover multiple exported directories. The policy rules well define the version of NFS supported (NFSv3 and/or NFSv4.1), the security model used and the user ID mapping options.
When cloning a Pod with NFS exported file systems, the user might want to replicate these policy settings, exporting the clone to the same clients as have access to the source, or the user might want to change the rules to make them more or less restrictive.
A user might also simply want to clone the Pod and all of the file systems contained therein, but not export it. The cloned Pod would remain ready to be exported at a later time.
The script is designed to be simple and easy to read. It is not intended to be production grade, and should therefore be considered the basis for a more robust script. The code takes five arguments:
$ python fa_pod_cp.py -h============fa_pod_cp.py 1.3.0 started at 2026-11-18 18:54:27.552400usage: fa_pod_cp [ options ]clone a pod of NFS file system(s) on an Everpure Flash Arrayoptional arguments: -h, --help show this help message and exit -s SOURCE_POD, --source_pod SOURCE_POD name of the source pod -t TARGET_POD, --target_pod TARGET_POD name of target pod to be created -a APPEND_SUFFIX, --append_suffix APPEND_SUFFIX suffix to append to cloned file system exports -j CONFIG_FILE, --config_file CONFIG_FILE json document of config options -x, --execute_lock specify -x to actually clone the pod (default is safety lock on)
The SOURCE POD, TARGET POD and APPEND_SUFFIX arguments should be self-explanatory.
The optional -j switch allows a JSON document to be provided that can include the FQDN of the Flash Array and an API token for authorization, as well as the policy rules that will be applied to the cloned file systems.
The -x switch must be provided if the users wishes the script to actually clone the source pod and, if a suffix is provided, export the cloned file systems. Omitting this switch allows for a dry-run. The script will perform the same sanity checks ensuring that the FQDN and API token are valid, that the source pod does exist and the target pod does not, but it will not actually clone anything. This allows the user to verify they have all the settings correct before trying to clone a pod.
As stated, the JSON document may include the FQDN and API token for the Flash Array. If these are not included in the JSON document, they may be read from the OS variables PUREFA_URL and PUREFA_API.
$ export PUREFA_URL=myflasharray.mydomain.com$ export PUREFA_API=itsasecret$ python fa_pod_cp.py -s gct-oradb-swingdb-pod -t gct-pod-tmp -x============fa_pod_cp.py 1.3.0 started at 2026-11-18 18:56:21.390555============connecting to Flash Array:myflasharray.mydomain.com API Version:Noneconnected============cloning pod gct-oradb-swingdb-pod to gct-pod-tmp============checking for existence of source-pod and non-existence of target-pod============determining relevant policies for gct-oradb-swingdb-podpolicy gct-oradb-swingdb-pod::gct-oradb-nfs-polnumber of policies found:1============determining client rules for NFS policies for gct-oradb-swingdb-podrules for policy:gct-oradb-swingdb-pod::gct-oradb-nfs-pol4 rule(s) found============determining file systems for gct-oradb-swingdb-podfile system gct-oradb-swingdb-pod::gct-fs-ora-swingdb-datafile system gct-oradb-swingdb-pod::gct-fs-ora-swingdb-franumber of source pod file systems found:2============cloning pod gct-oradb-swingdb-pod to gct-pod-tmp============cloning policies for gct-pod-tmpcloning policy gct-oradb-swingdb-pod::gct-oradb-nfs-pol as gct-pod-tmp::gct-oradb-nfs-pol============no export rules were defined, rules were copied from the source policy============no export suffix specified so cloned file systems will not be exported============pod cloning complete
Since no suffix was specified in the above example, the cloned file systems are not exported.
In the next example I have prepared a JSON document file with a revised set of policy rules for the cloned file systems. The JSON document file also allows me to specify the Flash Array FQDN and the API token, so they do not have to be set at the OS level.
$ cat json/fa.json{ "flash_array_host": "myflasharray.mydomain.com", "flash_array_api_token": "itsasecret", "flash_array_api_version": "2.44", "rules": [ { "access": "no-root-squash", "client": "10.21.229.189", "permission": "rw", "nfs_version": "NFSv4.1" } ]}
At the command line the source and target pods names are specified, along with the suffix -tmp, meaning that the cloned file systems will be exported as NFS shares as follows.
gct-fs-ora-swingdb-data will be cloned and exported as gct-fs-ora-swingdb-data-tmp.
gct-fs-ora-swingdb-fra will be cloned and exported as gct-fs-ora-swingdb-fra-tmp.
$ python fa_pod_cp.py -j json/fa06_33.nfs.json -s gct-oradb-swingdb-pod -t gct-pod-tmp -a=-tmp -x============fa_pod_cp.py 1.3.0 started at 2026-11-18 19:01:02.530607============connecting to Flash Array:myflasharray.mydomain.com API Version:2.44connected============cloning pod gct-oradb-swingdb-pod to gct-pod-tmp============checking for existence of source-pod and non-existence of target-pod============determining relevant policies for gct-oradb-swingdb-podpolicy gct-oradb-swingdb-pod::gct-oradb-nfs-polnumber of policies found:1============determining client rules for NFS policies for gct-oradb-swingdb-podrules for policy:gct-oradb-swingdb-pod::gct-oradb-nfs-pol4 rule(s) found============checking that target export directories can be created============determining file systems for gct-oradb-swingdb-podfile system gct-oradb-swingdb-pod::gct-fs-ora-swingdb-datafile system gct-oradb-swingdb-pod::gct-fs-ora-swingdb-franumber of source pod file systems found:2============cloning pod gct-oradb-swingdb-pod to gct-pod-tmp============cloning policies for gct-pod-tmpcloning policy gct-oradb-swingdb-pod::gct-oradb-nfs-pol as gct-pod-tmp::gct-oradb-nfs-pol============deleting rule r_43776deleting rule r_43777deleting rule r_43778deleting rule r_43779replaced client rules on gct-pod-tmp::gct-oradb-nfs-pol============getting directory exports for gct-oradb-swingdb-podclone of gct-nfs-ora-swingdb-fra exported as gct-nfs-ora-swingdb-fra-tmpclone of gct-nfs-ora-swingdb-data exported as gct-nfs-ora-swingdb-data-tmp============pod cloning complete
Since the policy rules were specified in the JSON file, the newly exported cloned NFS file shares will only be mountable by client 10.21.229.189 using NFS4.1 protocol.
NOTE: The script uses a pod cloning approach. In Purity 6.10.2 a new feature called Managed Directory Copy was introduced that allows file systems in a managed directory to be cloned and the clones exported under new names. Purity 6.10 was a feature release. The functionalty was included the LLR Purity 6.11 released in October 2026.
NOTE: This example assumes Purity version 6.0 or above and Python 3.8 or later.
The code can be found in the Everpure Github repository for Oracle scripts, located here: Github link
