FlashBlade Management with PowerShell 6+
PureStorage FlashBlade

FlashBlade Management with PowerShell 6+

Storage Management does not have to be hard!!

If you have been a storage admin at any time in your life, you will know how complicated it can be. In years past you would have had some complex tool that was generally in the form of an off-box application or VM that followed the SMI-S standard that was unnecessarily complex and slow. To be fair, you probably had an equally complex spreadsheet full of RAID groups and volume names, mapped to hosts and applications ....... does that still go on today :-)

I think for many vendors those days have past, not for all, but for many. Storage management does not have to be hard.

Pure Storage has an API first approach to storage management. If you can do it in the CLI or the GUI, then you could also do it via the RESTful APIs.

What better way to simplify a rich and powerful set of APIs than to wrap a safe pair of hands simple toolkit around it to make it even easier to consume. Pure already had a Python SDK, so why not create a toolkit for the non-linux customers with what is now becoming a very simple cross-platform development framework, PowerShell.

Let's be clear, PowerShell is for Microsoft Windows users. I happen to run a MacBook Pro - so I installed the HomeBrew version of PowerShell to do this development.

How simple is simple?

Good question. First thing you need to do is create a simple config file, or you can use command line parameters, but the config file is easier.

Note: I wont walk through installing the toolkit here, just some of its capabilities.

Create a file called FlashBlade.JSON in the directory you will run the commands from.

Add the IP or FQDN, the APIToken from the Array so you can create an authenticated session and that should be it. If you have your own certificates, you can remove the lat line.

[

	{

		"FlashBlade": 	"xxx.xxx.xxx.x", 

		"APIToken": 	"xxx",

		"APIvers": 	1.8,

		"CertificateCheck": "-SkipCertificateCheck"

	}

]

Once the module is imported/installed you can access any of the Get-Pfb, Update-Pfb, Add-Pfb or Remove-Pfb cmdlets.

All of the cmdlets have helper functions:

  • Get-Help <cmdlet> -Example
  • Get-Help <cmdlet> -Detail
  • Get-Help <cmdlet> -Full for more comprehensive help and examples.

For any of the cmdlets you can also parse the -FlashBlade and -ApiToken parameters if you want to customise your connection. You need to do this when using the Zero Touch Provisioning function as per the end of this blog.

Examples:

Give me a brief overview of my array. Including hostname, timezone, version of software.

PS /Users/alexjohnson/powershell> Get-PfbArray                            


name        : RedDotFB
id          : #########################
os          : Purity//FB
revision    : de7d9979
version     : 3.0.1
time_zone   : Asia/Singapore
ntp_servers : {0.sg.pool.ntp.org, 1.sg.pool.ntp.org}
_
as_of      : 1592193396862

Get the first 10 filesystems sorted by name

PS /Users/alexjohnson/powershell> Get-PfbFilesystem -Sort 'name' -Limit 10 




name                          : aj_test
created                       : 1525919771000
fast_remove_directory_enabled : True
snapshot_directory_enabled    : True
destroyed                     : False
promotion_status              : promoted
requested_promotion_state     : promoted
writable                      : True
time_remaining                : 
nfs                           : @{enabled=True; rules=*(rw,no_root_squash); v3_enabled=True; v4_1_enabled=False}
smb                           : @{enabled=True; acl_mode=shared}
http                          : @{enabled=False}
provisioned                   : 429496729600
hard_limit_enabled            : False
default_user_quota            : 0
default_group_quota           : 0
space                         : @{virtual=269795514368; unique=65055341154; snapshots=0; data_reduction=4.1; total_physical=65055341154}
source                        : @{name=; id=; resource_type=; location=; is_local=True; display_name=}
id                            : 3824f937-2648-d541-b6a7-e7fe603c1d9a


name                          : aj_test2
created                       : 1589506917000
fast_remove_directory_enabled : True
snapshot_directory_enabled    : True
destroyed                     : False
promotion_status              : promoted
requested_promotion_state     : promoted
writable                      : True
time_remaining                : 
nfs                           : @{enabled=False; rules=*(rw,no_root_squash); v3_enabled=False; v4_1_enabled=False}
smb                           : @{enabled=True; acl_mode=shared}
http                          : @{enabled=False}
provisioned                   : 429496729600
hard_limit_enabled            : False
default_user_quota            : 0
default_group_quota           : 0
space                         : @{virtual=52541966336; unique=12912116316; snapshots=0; data_reduction=4.1; total_physical=12912116316}
source                        : @{name=; id=; resource_type=; location=; is_local=True; display_name=}
id                            : dea44edf-f043-98b3-b5e9-2a935d04c8cf

Get the FileSystem replication links and status

PS /Users/alexjohnson/powershell> Get-PfbFileSystemReplicaLinks 


id                 : a1f03498-6ccb-2050-30dc-215a4f7bbd7c
direction          : outbound
lag                : 301000
recovery_point     : 1592193530000
local_file_system  : @{name=markus1; id=a91a60b1-a27f-3f2a-8628-782303504abc; resource_type=file-systems}
remote             : @{name=sglab-fb1; id=fc5855e6-63a8-4b3d-9a6d-38ee0654b055}
remote_file_system : @{name=markus1; id=14b97ffd-348f-720c-8d47-aad2d4aedcb7}
policies           : {@{name=markus2; id=2487e936-6f86-3395-ceab-13e5d62b9016; resource_type=policies; location=; is_local=True; display_name=markus2}}
status             : replicating
status_details     : 
  • Show me the current open alerts - Get-PfbAlert -Filter 'state="opened"'
  • Check how much space is being used on the array - Get-PfbArraySpace -Type 'file-system'
  • Show me the current NFS performance - Get-PfbArrayPerformance -Protocol 'nfs'
All of the current Get-Pfb cmdlets

Zero Touch Provisioning

The FlashBlade PowerShell Toolkit also supports Pure Storages latest Zero Touch Provisioning. This is an alternative to the method in the blog link I just provided.

Take a snapshot, replicate a filesystem or an object, create a bucket, show the performance........ Storage management does not have to be complicated!


To view or add a comment, sign in

More articles by Alex J.

  • FlashBlade PowerShell ToolKit 3.2.3

    Today I released an updated PowerShell toolkit for the Pure Storage FlashBlade. This release can only be found on the…

    3 Comments
  • FlashBlade, Elasticsearch and Kibana...

    I was asked recently how I could use the ELK stack to view filesystem information scraped from a FlashBlade. It was a…

  • Microsoft PowerShell Integration for Pure Storage FlashBlade......

    One of the reasons I joined Pure almost 6 years ago now was the API first approach to storage management. Having been…

    1 Comment
  • Business Lessons From a Boat Race

    Yesterday Emirates Team New Zealand (ETNZ) took the Americas Cup from Oracle Team USA (OTUSA) and it was a great day to…

    2 Comments

Others also viewed

Explore content categories