In my previous post I discussed how to achieve data mobility between on-premises and the cloud which focused on a Microsoft SQL Server production and dev/test use case. In that data mobility demonstration you most likely noticed that all of the interactions between the on-premises FlashArray and Cloud Block Store were accomplished using Windows PowerShell. In this post I will expand on the different automation techniques that can be used across on-premises and the cloud.
The Purity operating environment was designed with API first in mind. That focus applies to all of our different platform offerings; Pure1®, FlashBlade™, FlashArray™ and our recently announced Cloud Block Store. Having a consistent API experience allows DevOps and IT teams to focus on implementing automation solutions without having to reinvent the wheel. As I always say, “if you perform the task more than 2x, then it should be automated.” With that philosophy in mind, DevOps and IT teams can focus on solving business problems vs manually repeating tasks.
There are several different automation techniques that can be used with the FlashArray and Cloud Block Store endpoints.
All of the REST documentation for FlashArray and Cloud Block Store can be accessed directly from our web management interface. The API documentation reflects the latest Purity release and matching REST API. In the example screenshot below, Purity 5.1.5 uses the REST API 1.15.
By clicking on the REST API Guide menu item, you can access our full API documentation.
Different tools can be used to access the REST API directly. The first part of the demonstration video below shows using Postman to execute REST requests & responses. Any REST API compliant tool can be used to perform the same actions.
Anything that can be accomplished using the REST API directly can also be done using the Pure Storage PowerShell SDK. The SDK is a binary module wrapper for our REST API. The Pure Storage PowerShell Toolkit provides some additional cmdlets that combine some of the SDK cmdlets into a single cmdlet. A good example of this is the New-FlashArrayCapacityReport which leverages 10 different SDK cmdlets to produce the report.
Both the SDK and Toolkit can be installed from the PowerShell Gallery (PSGallery) using the below. The Toolkit is open source can be accessed on Github at https://github.com/PureStorage-OpenConnect/powershell-toolkit.
Install-Module -Name PureStoragePowerShellSDK
Install-Module -Name PureStoragePowerShellToolkit
The demonstration video shows several different cmdlets being used to work with Cloud Block Store. You can see some of the tasks I performed in the screenshot below. They include connecting to a Cloud Block Store instance and showing different hosts that have been configured in Cloud Block Store.
In the screenshot below, we can see how to retrieve a specific volume, create a new volume and take a snapshot of that new volume.
If you’d like to get more information about the PowerShell SDK and Toolkit, I suggest you take a look at the Getting Started Guide available in the Microsoft Platform Guide which goes into all of the details of connecting, creating volumes, hosts and more.
Python Toolkit (aka REST Client)
The Pure Storage FlashArray REST Client is a python module that simplifies integration with the Pure Storage FlashArray REST interface. It wraps REST calls with simple APIs and abstracts the HTTP request and response handling. For specifics on API arguments, consult the REST API guide for the Purity release currently running on the target array.
This library is designed to provide a simple interface for issuing commands to a Pure Storage Flash Array using a REST API. It communicates with the array using the python requests HTTP library.
Additionally, this library can only be used to communicate with Pure FlashArrays that support one or more REST API versions between 1.0 and 1.16; currently, this includes any FlashArray running Purity 3.4.0 or later.
The below screenshot shows several different tasks being performed, (1) importing the module, (2) connecting to Cloud Block Store, and (3) retrieving hosts and a specific volume named “CloudBlockStorageVol4”.
All of the details for the Python Toolkit (aka rest-client) can be accessed on GitHub at https://github.com/PureStorage-OpenConnect/rest-client.
To wrap it up, I suggest you watch the video below where you’ll be able to see a live demo of all the topics I touched upon in this blog post:
As always, feel free to share your comments and feedback on this post and video below, and be sure to check out https://code.purestorage.com for all of our GitHub projects. We are also always open to feedback, feature requests and issues using all of the features within the respective GitHub repositories.
If you have any questions about our REST API, PowerShell, Python, Ansible and more, join our slack team by signing up at https://codeinvite.purestorage.com.