Using PowerShell for EMC XtremIO
Introduction
EMC have released XIOS version 4.1.10-33 and XMS version 4.2 recently and with this release they have added PowerShell support. Being a PowerShell guy this is a good thing for automation and maintaining EMC XtremIO. In this post we will cover downloading and installing PowerShell for XtremIO and a few of the available features.
Installation
Download the PowerShell Modules for XtremIO from here https://download.emc.com/downloads/DL71129_XtremIO-Windows-PowerShell-Module-1.0.11.msi?source=OLS. You will need to have an account with EMC to be able to access the download.
Install the package. The libraries will be installed to C:\Windows\System32\WindowsPowerShell\v1.0\Modules. Now you have the PowerShell modules installed and ready to use.
Next you will need to install the root certificate from your array(s) also, to avoid any verification warnings or issues. Load the XMS splash screen and click on and install the certificate into the local Trusted Root Certification Authorities cert store.
Once you have the root certificate you need to install it into Trusted Root Certificates Authorities. Click run > mmc and press OK. Click File > Add/Remove Snapin and move Certificates to Selected snapin. When the popup appears select Computer Account, click Next.
Select Computer account and click Next.
Select Local Computer and click Finish. Click ok and you are ready to import the certificate.
Expand Certificates> Trusted Root Certificates Authorities and click on Certificates. Right click on Certificates and click All Tasks > Import and the wizard will start.
Click the browse button and find the downloaded root certificate and select it. Click Next.
Make sure it says Trusted Root Certification Authorities and click Next.
Click Finish.
If you have more than one XtremIO you will need to import their root certificates as well, otherwise you are done and ready to start using PowerShell for XtremIO.
Using PowerShell for XtremIO
So now we can start using some of the many cmdlets available to manage XtremIO using PowerShell.
Open a PowerShell session and load the xtremlib using import-module.
PS C:\> Import-Module XtremLib
Now we are ready to start a session to XtremIO. Using New-XtremSession we can connect to our XtremIO device.
PS C:\> New-XtremSession -XmsName cvgapemcxio01.td.afg –Username <userid> –Password<password>
Note: If you did not install the root certificate this step will fail.
Exiting a XtremSession
When you are done working on you XtremIO cluster or want to manage another cluster you must exit the session. Note when you run this command it will kill all sessions.
PS C:\> Remove-XtremSession
Check XtremIO health
PS C:\> Get-XtremClusters -Properties sys-health-state | ft –autosize
Get a List of Storage Controllers
PS C:\> Get-XtremStorageControllers
Get Details on a Storage Controller
PS C:\> Get-XtremStorageController XIO-X1
List Tags
PS C:\> Get-XtremTags
Get Details on a specific Tag
PS C:\> Get-XtremTag -TagName SPARE -ObjectType Initiator
Get a list of Volumes
PS C:\> Get-XtremVolumes
Retrieve details on a specific Volume
PS C:\> Get-XtremVolume -VolName cvgapesx403-BOOT
Note: When you see details output the left column are the properties and will allow you to fine tune your queries to exactly what you want by adding -Property <list of items comma separated>
Conclusion
We have install PowerShell for XtremIO and have explored a few of the 122 functions available. To learn what other possibilities there are available type Get-XtremHelp.
I am very new to powershell.
Perfect instructions.. it worked for me..
after investing a lot of time on google and other options.. Finally this one worked. 🙂
Do you have any sample script for XIO Health checks ?
Cheers..
I am just now starting to look into a healthcheck script. I will post it for sure when I get one working.
Thanks for the steps.
I followed your steps. But unable to establish the connection:
PS C:\Users\user1> New-XtremSession -XmsName myxms.myhosted.com -Username admin -Password xxxxxx
Error: XtremIO name or IP not resolveable. It may have been mistyped. This may also indicate that you have not properly
Could not retrieve XMS data from XMS Server, or XMS is less then 4.0.0.
At C:\windows\system32\WindowsPowerShell\v1.0\Modules\XtremLib\xtremlib.psm1:6426 char:9
+ throw “Could not retrieve XMS data from XMS Server, or XMS is less then …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Could not retri…ess then 4.0.0.:String) [], RuntimeException
+ FullyQualifiedErrorId : Could not retrieve XMS data from XMS Server, or XMS is less then 4.0.0.
I know my XMS version is 4.2.2-18. Any idea?
Thanks again
Did you import and retrieve the certificate from XtremeIO? You have to have this for the ID to authenticate. If you have multiple XtremeIO interfaces you will have to have one for each.
Yes, I am testing 2 XMS servers and I have downloaded two root certificates and installed them.
Thanks again
Have you tried to use the ip address instead of the name?
Yes, I have tried both IP and hostname.
Thanks
Hi ,
I have installed the root certificate and installed the module but authentication is getting failed.
Error: XtremIO name or IP not resolveable. It may have been mistyped. This may also indicate that you have not properly
imported the XtremIO certificate.
Could not retrieve XMS data from XMS Server, or XMS is less then 4.0.0.
At C:\windows\system32\windowspowershell\v1.0\Modules\XtremLib\xtremlib.psm1:6426 char:9
+ throw “Could not retrieve XMS data from XMS Server, or XMS is …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Could not retri…ess then 4.0.0.:String) [], RuntimeException
+ FullyQualifiedErrorId : Could not retrieve XMS data from XMS Server, or XMS is less then 4.0.0.
PS N:\> New-XtremSession
cmdlet New-XtremSession at command pipeline position 1
Supply values for the following parameters:
XmsName: ”
ConvertTo-SecureString : Cannot bind argument to parameter ‘String’ because it is an empty string.
At C:\windows\system32\WindowsPowerShell\v1.0\Modules\XtremLib\xtremlib.psm1:6399 char:48
+ … $securepassword = ConvertTo-SecureString $password -AsPlai …
+ ~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [ConvertTo-SecureString], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.ConvertToSecureStringCommand
Could not retrieve XMS data from XMS Server, or XMS is less then 4.0.0.
At C:\windows\system32\WindowsPowerShell\v1.0\Modules\XtremLib\xtremlib.psm1:6426 char:9
+ throw “Could not retrieve XMS data from XMS Server, or XMS is …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Could not retri…ess then 4.0.0.:String) [], RuntimeException
+ FullyQualifiedErrorId : Could not retrieve XMS data from XMS Server, or XMS is less then 4.0.0.