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”

FlashArray UNMAP Script with the Pure Storage PowerShell SDK and PowerActions

I have officially decided to “retire” my UNMAP script that uses direct REST calls to find before and after capacity changes for given volumes. I am only updating the one that uses the Pure Storage PowerShell SDK from this point on–using this is much more robust, not tied to direct API versions and greatly simplifies managing the data in the script.clip_image006

I have also created a second version for use in the VMware Fling called PowerActions. This allows the script to be executed from the vSphere Web Client.

Continue reading “FlashArray UNMAP Script with the Pure Storage PowerShell SDK and PowerActions”

Site Recovery Manager with PowerCLI Automation Gotcha

Quick post here. So I have been reviewing some great posts from @vmKen and @BenMeadowcroft about automating Site Recovery Manager operations with PowerCLI and wanted to give it a try myself. They outlined the process rather clearly in their blogs so it was a breeze to get most of the stuff up and running. But when I went to actually execute a test recovery or a recovery etc. it kept failing! The PowerCLI command to start the recovery  was $VMrp.Start($RPmode)–the $VMrp being my recovery plan and the $RPMode being the recovery plan mode of a recovery. The command was accepted but the recovery plan never started.

I got the following error in vCenter:

Unable to start the requested operation. Another operation may be in progress. Please wait for it to finish and try again.

Hmm…weird. I could kick off a test from the GUI with no issue so nothing was “interfering” from what I could tell. I thought maybe since I was using Site Recovery Manager 5.8 maybe something had changed so I tried it with my 5.5 environment and got the same result.

srm55

webclient

After I was about to lose my mind it finally occurred to me that I was connecting to the protected vCenter and the protected SRM server (I did enter in remote credentials for the recovery SRM server though). While I could query the recovery plan etc without issue from here, maybe SRM didn’t allow a recovery plan to be started unless you directly connected to the recovery vCenter/SRM server.

So I reconnected to the recovery site and it worked! So I guess it makes a difference, so FYI. Now there might be a workaround to this and it is definitely possible I missed something that allows this but this seems to be what you need to do. If you find this isn’t true please let me know!

Thanks Ken and Ben for getting me started!! Cool stuff. Kens posts:

http://blogs.vmware.com/vsphere/2014/05/automate-failover-with-srm.html

http://blogs.vmware.com/vsphere/2014/05/srm-powercli-reporting.html

http://blogs.vmware.com/vsphere/2014/05/powercli-and-the-srm-api.html

PowerShell and Pure Storage REST API Scripting

Previously I blogged about using PowerShell with the Pure Storage FlashArray to enable scripting of common tasks like provisioning or snapshotting. In that post I showed how to use SSH to run Purity operations, but with the introduction of the REST APIs (fully available in 3.4+) there is now a much better and cleaner way to script this. You no longer need to install extra SSH modules and the like, all you need is the Invoke-RestMethod in PowerShell.

flasharray

Continue reading “PowerShell and Pure Storage REST API Scripting”

PowerShell and the Pure Storage FlashArray CLI

Scripting is a wonderful thing–saves me tons of time. PowerShell is no exception. VMware offers a very robust PowerShell cmdlet offering (called PowerCLI) which allows you to do essentially anything you can think of in vSphere. Of course this is all specific to VMware or Windows. What about including scripting commands for Pure Storage into PowerShell (PowerCLI) scripts? It is actually pretty simple using the readily available SSH plugin for PowerShell.

flasharray

Continue reading “PowerShell and the Pure Storage FlashArray CLI”

VMware PowerCLI and Pure Storage

This is a post I plan on just updating on a rolling basis. I have been working on updating the vSphere and Pure Storage Best Practices document and there are few settings that can be tweaked to increase performance. A common question I have and occasionally receive is can this be easily simplified or automated? Of course! And PowerCLI is the best option in most cases–I will continue to add to this post or update it as I find newer or better ways of doing things.

****UPDATED SCRIPTS AND NEW FUNCTIONALITY check out this blog post for insight****

Update: get my scripts on my GitHub page here:

https://github.com/codyhosterman/powercli

flasharray

Continue reading “VMware PowerCLI and Pure Storage”

Unattended/silent deployment of ScaleIO features on Windows Server

Two posts in two days. Phew! So much to talk about, but this is a quick one. In my previous post I wrote about installing ScaleIO on Windows hosts via a manual/user-controlled process using the CLI and running the MSI install file on each server. In larger environments this may not be practical where an automated deployment solution is required. Furthermore, it is invariably necessary to also deploy the software in a “silent” unattended mode so that end-users do not need to interact with the installer. Luckily this is a pretty simple process in Windows environments using the MSI ScaleIO installer.

Continue reading “Unattended/silent deployment of ScaleIO features on Windows Server”

Using PowerCLI to correlate VMware VMFS and ScaleIO volume info

In my previous post I wrote about expanding a ScaleIO volume in a VMware environment. During that procedure there is a requirement  to correlate the EUI of the device hosting the VMFS to the ScaleIO identifier so that you can ensure that you actually expand the correct volume. Especially important in large environments. So I thought is there a way to script this correlation in a simple fashion to save you some work? Can the whole process be automated?

The answer to both is yes!

intro

Continue reading “Using PowerCLI to correlate VMware VMFS and ScaleIO volume info”

Scripting ESI PowerShell cmdlets and VMware

EMC offers a variety of tools to manage/enhance your virtual or physical environments–some free, some licensed. In most cases when you think of EMC tools for VMware one conjures up the free Virtual Storage Integrator which is more commonly referred to as VSI.

VSI is a great tool and continues to be improved through each version and allows you to provision storage, manage pathing, configure SRM etc. The one thing it does not have is a way to automate these tasks through an API or CLI. This is where another product comes in–one that many do not associate with VMware. The EMC Storage Integrator (ESI) is a lot of times seen as the Microsoft version of VSI–but that isn’t really true at all. While it might have started out that way and does indeed support Hyper-V and has a ton of Microsoft-specific features it is really the heterogeneous storage integrator. Importantly it  has a very handy and powerful feature–PowerShell cmdlets.

Continue reading “Scripting ESI PowerShell cmdlets and VMware”