пятница, 21 июля 2017 г.

How to monitor Storage Appliance using PowerShell and Swordfish

In this short post, I'll show you how easy it is to learn about your Storage Appliance using only PowerShell, which is available in any modern Microsoft Windows operating system. You do not need to install any additional software.


The whole power of this solution is in REST technology, which underlies all modern cloud solutions. Vendors of storage systems of corporate scale seriously approached the issue of integration into the present and future clouds. Namely, they initiated the work on Swordfish - a single standard of the interaction of storage systems, which would correspond to the basic principles of REST. On their initiative, the SNIA created a special working group to work on it. Swordfish is an extension of the Redfish standard, which in turn is based on the popular standard for RESTfull services called the Open Data Protocol.
When in a year Microsoft, VMware, Dell, HP, NetApp, IBM, Supermicro, StarWind ... (and many others) will work on a common interface with storage and server hardware in general, then to change the storage for, say, Hyper-V or vSphere from the Dell's RAID for the HP's SAN, it will be necessary to press only one button.
Despite the fact that Swordfish is still being developed, many leading companies are already developing their own Swordfish providers, which at the time of the release of the standard will provide them with leading positions in the cloud storage and hyperconverged solutions market.

Since Swordfish is a REST service, you can work with it from under PowerShell with the Invoke-RestMethod cmdlet.

Next, I just give a few examples of how to get the status of the StarWind iSCSI SAN by accessing its Swordfish Provider from under PowerShell.

Information about Starwind Swordfish Provider
PS C:\ > Invoke-RestMethod 'http://sw-dev-pc11:9000/redfish/v1/' -Method Get

Request state of StarWind iSCSI SAN

Let's get the list of Storage Services. Each separate Storage Service is a separate StarWind iSCSI SAN.
Invoke-RestMethod 'http://sw-dev-pc11:9000/redfish/v1/StorageServices' -Method Get

As you can see, there is only one system in the list. I'll request information about it:
Invoke-RestMethod 'http://sw-dev-pc11:9000/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077' -Method Get

In addition to the name of the storage array (SAN), we can also get information about the Storage Pools from which the Volumes are allocated, and also about the Volumes themselves.

Storage Pools Information

We build the query according to the same scheme. You just need to combine the base URL with the provided relative reference to Storage Pools:
PS C:\> Invoke-RestMethod 'http://sw-dev-pc11:9000/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077/StoragePools' -Method Get


Now we can look at the Storage Pool itself:
PS C:\> Invoke-RestMethod 'http://sw-dev-pc11:9000/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077/StoragePools/6a6fd384-d605-48a3-a1f3-5a7d984113c8' -Method Get


Information about Volumes

We get information about the created devices/volumes:
PS C:\> Invoke-RestMethod 'http://sw-dev-pc11:9000/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077/Volumes' -Method Get


We got here such a list of devices in the form of relative URLs. Volume Serial Numbers of are listed at the end of each URL (bold):
{@odata.id=/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077/Volumes/105B02409AB05B58},
{@
{@odata.id=/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077/Volumes/B8A3B637A380E761},
@{@
@{@odata.id=/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077/Volumes/1AF86DAB4DC78D4C
}}
And now we get information about one of the volumes:
PS C:\> Invoke-RestMethod 'http://sw-dev-pc11:9000/redfish/v1/StorageServices/902bbeaa-64e5-4568-bde9-f1127659f077/Volumes/105B02409AB05B58' -Method Get

I'll stop at this point, but I note that in addition to monitoring, Swordfish also allows you to manage the storage. I will discuss this in my next posts.

I will be happy with your comments.