30 November 2014

XtremIO PowerShell Module Updated -- v0.7.0 available

XtremIO + PowerShell!Even more updates!  Version 0.7.0 of the XtremIO.Utils PowerShell module is now available.  This release brings some great new features, like superior handling of credentials (via new Connect-XIOServer and Disconnect-XIOServer cmdlets), the rest of the New-XIO* cmdlets for creating items in the XtremIO configuration, and new performance-related cmdlets for focusing in on XtremIO performance reporting from several different aspects.

You can read about the new features available in each updated release in the docs in the repo at https://github.com/mtboren/XtremIO.Utils. We have also made a new general information page for this PowerShell module (like how to get it, how to install it, credentials handling). One can find this info page in the Sticky Posts section at the right, too. Or, if you just want at the module immediately, you can download it from https://github.com/mtboren/XtremIO.Utils/releases/download/Latest/XtremIO.Utils.zip.
Once you have read those items, let us get to some examples!

Connect to a couple of XMS servers:
PS vN:\> Connect-XIOServer -Credential $credMe -ComputerName somexms01.dom.com,somexms02.dom.com -TrustAllCert

ComputerName             ConnectDatetime               Port
------------             ---------------               ----
somexms01.dom.com        11/30/2014 1:54:02 PM         443
somexms02.dom.com        11/30/2014 1:54:02 PM         443

Note: this allows for the rest of the subsequent XIO cmdlet calls to be used without presenting credentials again to the cmdlet -- the cmdlets will use the given XIO connection(s) and corresponding connection credentials! Yes, that also means that you need not supply the XMS name each subsequent call: the default, connected XMS servers will be used, unless otherwise specified by the user.

Get the cluster performance information for all XIO clusters managed by the XMS servers:
PS vN:\> Get-XIOClusterPerformance

Name        WriteBW_MBps   WriteIOPS    ReadBW_MBps   ReadIOPS   BW_MBps      IOPS     TotWriteIOs  TotReadIOs
----        ------------   ---------    -----------   --------   -------      ----     -----------  ----------
somexms01   6.057          771          41.768        531        47.824       1302     4664182545   3886061537
somexms02   67.480         2783         238.808       5286       306.288      8069     31163303937  81948491968

Create a new initiator in initiator group "myserver0" on array managed by "somexms02":
PS vN:\> New-XIOInitiator -Name myserver0-hba2 -InitiatorGroup myserver0 -PortAddress 0x100000000000ab56 -ComputerName somexms02.dom.com

Name                   PortAddress                   PortType              IOPS
----                   -----------                   --------              ----
myserver0-hba2         10:00:00:00:00:00:ab:56       fc                    0

Create a new LUN maps on array managed by "somexms02":
PS vN:\> New-XIOLunMap -Volume myVolume02 -InitiatorGroup myserver0,myserver1 -HostLunId 50 -ComputerName somexms02.dom.com

VolumeName          LunId           InitiatorGroup           tg-name
----------          -----           --------------           -------
myVolume02          50              myserver0                Default
myVolume02          50              myserver1                Default

A couple of Get-XIOEvent examples:
PS vN:\> Get-XIOEvent

EventID  DateTime               Severity     EntityDetails      Description
-------  --------               --------     -------------      -----------
2267     11/30/2014 10:39:29 PM information  myVolume02 [1]     Mapped LUN 50 to Volume myVolume02 TG Defa...
2266     11/30/2014 10:39:29 PM information                     User: vNuggsUser, Command: maplun, Argumen...
...
27672    11/30/2014 1:37:41 PM  information  someVolume03       Small block (blocks smaller than 4KB) IO r...
27671    11/30/2014 1:17:05 PM  information                     External user 'vNuggsUser' authenticated w...
...


PS vN:\> Get-XIOEvent -Category activity -Severity information -EntityType BatteryBackupUnit -Start "11 oct 2014" -End "14 nov 2014 8am"

EventID  DateTime               Severity     EntityDetails   Description
-------  --------               --------     -------------   -----------
195      11/11/2014 9:29:30 PM  information  X2-BBU [2]      Added new Battery Backup Unit - UPS[2] "X2-BB...
193      11/11/2014 9:29:30 PM  information  X1-BBU [1]      Added new Battery Backup Unit - UPS[1] "X1-BB...

While it was quite a bit of doing to make this release happen, the new features are well worth it, and it was quite fun along the way. Now to keep the creativity flowing: on to the next update, in which better pipeline support is one of the targets. Until then, enjoy!

4 comments:

  1. Is there an "easy" way to get a list of Volumes and the folder they sit in? I feel like I missed something because I couldn't find the easy way using your functions and had to invent the hard way.

    Please pardon the excessively long variable names. They help me when learning a new product.

    CLS;
    Import-Module (Join-Path -Path $ENV:USERPROFILE -ChildPath "Documents\WindowsPowerShell\Modules\XtremIO.Utils");
    Connect-XIOServer -Credential [creds_here] -ComputerName [name_here] -TrustAllCert;
    $Volumes = Get-XIOVolume | WHERE {$_.NaaName -ine ""};
    $VolumeFolders = Get-XIOVolumeFolder -ReturnFullResponse;
    $hashVolumeFolder_to_Volumes = @{};
    ForEach ($VolumeFolder in $VolumeFolders) {
    $VolumeFolder = $VolumeFolder.Content
    ForEach ($Volume in $VolumeFolder."direct-list") {
    $hashVolumeFolder_to_Volumes.Add($Volume[0],$VolumeFolder.Name)
    }
    }
    $Volumes | SORT Name,NaaName | %{$_ | Add-Member -MemberType NoteProperty -Name Path -Value $hashVolumeFolder_to_Volumes[($_.VolID[0])] -Force -PassThru} | FT Name, Path -AutoSize;

    ReplyDelete
    Replies
    1. Hello, Greg D.-

      As of v0.7.0, no -- no "easy" way of which I can think. Your hard way looks to be spot-on, though -- using the .direct-list property of "raw" VolumeFolder objects to make the correlation between Volume and VolumeFolder.

      I know that it does not help you now, but, FYI: support for the ability to pipe output from one cmdlet to another is definitely in the to-do list. And, particularly for this example, support for something like:
      Get-XIOVolumeFolder | Get-XIOVolume
      ...so as to be able to get this info far more easily.

      Glad to see you getting into the module! I believe that you are the first person (other than myself) that I have seen use the -ReturnFullResponse feature of any of the cmdlets.

      Cheers!

      Matt

      Delete
  2. hi
    what about Get-XIOEvent -EntityType "ALERT" or Get-XIOAlert?

    ReplyDelete
  3. Hello, LIO-

    It's been quite a while since this was added, but closing the loop here: Get-XIOAlert is in the module, now -- see a current release at https://github.com/mtboren/XtremIO.Utils/releases. Enjoy!

    Matt

    ReplyDelete

Note: Only a member of this blog may post a comment.