Generating a Pure1 REST JWT with Python

I’ve written about generating the JSON Web Token for Pure1 REST API authentication before. Mostly around PowerShell. Though of course many may not want to use PowerShell and prefer to opt for something like Python.

So here is the process.

We have a script posted on the support site here. But that actually doesn’t return the JWT, it creates a session. So it takes the next step after the JWT. But if you just want to generate the JWT so something else can authenticate it won’t do the trick. So I made some modifications and threw it on GitHub as a gist. You can get it here:

https://gist.github.com/codyhosterman/697ebfd72c4f7f7276afc3b74e3b5e40

First off let’s review how to actually authenticate:

  1. Create a private/public key pair
  2. Enter the public key into Pure1
  3. Take the provided application ID and generate a JSON web token
  4. Send the JSON web token to Pure1 for an access token

I will walk through step 1-3. Using Python on Linux to generate the JWT.

Continue reading “Generating a Pure1 REST JWT with Python”

Generating the default VVol Storage Container ID

A VVol datastore, is not a file system, so it is not a traditional datastore. It is just a capacity quota. So when you “mount” a VVol datastore, you aren’t really performing a traditional mounting operation as there is no underlying physical storage to address during the mount. So instead of mounting some storage device, you are mounting what is called a storage container. This is the meta data object that represents the certain amount of capacity that can be provisioned from a given array. An array can have more than one storage containers, for reasons of multi-tenancy or whatever.

In a VMFS world, when you go to create a new datastore, you pass it the serial number of the storage you want to format with VMFS. You know that serial, because, well, you created the storage device. When you “mount” a VVol datastore, instead of a device serial, you supply the storage container UUID. It comes in the form of vvol:e0ad83893ead3681-b1b7f56a45ff64f1. Of course the characters will vary a bit.

Continue reading “Generating the default VVol Storage Container ID”

Deeper detail on using parameters with the FlashArray Python toolkit

Last week I posted about getting started with the Python toolkit, now I wanted to go a little deeper today on using the toolkit beyond connecting/creating a volume. A question I have seen more than once is:

“okay, I understand connecting and getting basic information, but what if I want to pull statistics or more advanced information from the array besides what the default commands? The API glossary for the toolkit doesn’t say explicitly how I can get the information I want”

In short, just because the Python glossary doesn’t explicitly say how to do something or even if you can, it does not mean you can’t. It really depends on what the REST API can do.

Let me explain.

Continue reading “Deeper detail on using parameters with the FlashArray Python toolkit”

Pure Storage Python Toolkit Intro with Windows

Most of my scripting work here at Pure Storage has mostly been via PowerShell or at times Javascript (for like vRO). But I think it is time to get back into Python especially because of the VMware support for it now.

Pure Storage has an automation toolkit that helps get you started managing the FlashArray so you don’t have to deal with the direct REST work in your Python scripts. You can find information about that here:

http://pythonhosted.org/purestorage/index.html

Continue reading “Pure Storage Python Toolkit Intro with Windows”

Required network ports for Python ScaleIO install on Windows

I just posted about using the EMC-provided Python script to install and configure ScaleIO on Windows. Using this  script makes these steps much easier, especially in very large environments (you can find that post here). One of the next logical questions is concerning firewall requirements and this process. To achieve this automation, the script is going all over the place connecting to servers, copying files, starting services and issuing configuration commands. Therefore it is hitting a variety of network ports on the target hosts. So let’s talk about what exactly those ports are.

Continue reading “Required network ports for Python ScaleIO install on Windows”

Installing/config of EMC ScaleIO on Windows using the Python script

In previous posts I have discussed installing and configuring EMC ScaleIO on Windows using manual methods. In VMware or pure Linux environments I have used the provided Python script/wizard to help automate the installation and configuration of ScaleIO. Mostly due to the fact that using this script is much simpler and less-error prone than using the manual methods. And in my opinion, at least, should be the preferred method of installation when possible.

python_scio_header

Continue reading “Installing/config of EMC ScaleIO on Windows using the Python script”