Getting ready for Python3
In this Blog, I will share how you can use the python to manage and automate Pure Storage FlashBlade File System snapshots.
Before we can start we need to install the Pure Storage FlashBlade Python SDK, also as Python2 is now deprecated so let’s start using Python3.
Below are the steps I took to install python3.6, pip and the Pure Storage FlashArray and FlashBlade python SDK’s on my Oracle Linux Rel7 database server.
# yum list *release-el7 # yum install -y oracle-epel-release-el7 oracle-release-el7 # yum install -y python36 # yum install -y python36-pip # pip3.6 install --upgrade pip # pip3.6 install purestorage # pip3.6 install purity_fb
You can find the Pure Storage FlashBlade REST API Guide at the Pure Storage Support Site and Python documentation at https://purity-fb.readthedocs.io/en/latest/ this site includes installation and usage details, so definitely a good place to start.
Getting Example Code
If you want to try out the code examples shown below you can ‘pull’ the python code and others from the Pure Storage public GitHub repository.
Creating FlashBlade FileSystem Snapshots
Let’s start by setting up some variables that we can reuse during the examples.
We can check that our new file System snapshot has been created using our Linux shell or via FlashBlade WebUI.
Listing FlashBlade FileSystem Snapshots
Below you can see an example Python script I have developed to list FlashBlade FileSystem snapshots, this also available via GitHub.
In my next Blog I will show how file system snapshots can be registered in an Oracle Recovery Manager (RMAN) catalog.
[twitter-follow screen_name=’RonEkins’ show_count=’yes’]