Archive for April, 2015

Connecting to StorSimple 8k using Powershell


StorSimple 8k series Cloud Integrated Storage Arrays are typically managed from Azure StorSimple Manager. However, in some cases we may need to run Powershell commands directly against the array itself as in troubleshooting situations. This script establishes PS connectivity to a StorSimple 8k array. The script can be downloaded from the Microsoft Script Center Repository.

Requirements:

SS20

The array runs a version of Windows 2012 R2 server core OS. It’s not domain joined. As a typical 2012 R2 server, it comes with Remote PS enabled. Line 11 adds the array to the local trusted hosts on the management computer. Lines 17-21 receive, encrypt and save the array admin password for future use. Lines 24-26 establish a remote PS session with the array.

SS21We can now run PS commands against the array. This is an alternative way of array management to using a serial interface as used in this post.

For example:

Invoke-Command -Session $StorSimpleSession { Get-Command }  | sort name | FT -a

shows the available commands on the StorSimple 8k series array, which runs a limited version of Powershell.

SS22

For more information see Connect remotely to your StorSimple device

Advertisements

StorSimple 8k series troubleshooting – lost access to DNS server


In this incident, a StorSimple 8100 Integrated Cloud Storage Array lost access to its local DNS server. As a result, it could not communicate to its Azure StorSimple Manager where it appeared to be down and unmanageable. During this period however, access to the iSCSI volumes presented by StorSimple to local file servers was not interrupted. The extent of this outage was loss of array manageability.

Array monitoring is enabled by default, and it would email all people who have admin rights on the Azure subscription under which the array’s StorSimple Manager is registered. Other recipients can be configured to receive alerts from the array as well. By default, the Azure StorSimple Manager expects a heartbeat from the array every 5 minutes. Loss of heartbeat results in an email similar to:

SS17I like that the email is well formatted, easy to read, and tells you clearly what the problem is, which array is affected (if you’re managing several arrays), when it happened, and what it suggests you do about it.

I have the serial interface of the array connected to a serial port on a physical server to which I have remote access. This is a best practice that I recommend to StorSimple clients for exactly this sort of situations where literally at 2 AM, the array is down and you need to console to it.

SS16

After connecting to the array serial interface, and running the

Test-HcsmConnection 

command, it showed that it the local DNS server(s) were down. I then ran the

Invoke-HcsSetupWizard

to change the IP address of the DNS server to a public DNS server like 8.8.8.8

The array displayed the message in the image above in red. This may suggest that the configuration change did not go through, but it did. In the Azure Management Interface, the array was back in manageable state and I got the all OK email.

Alerts can also be viewed under your StorSimple Manager / Alerts link:

SS18

 


Powershell 5


Powershell 5 is expected to be released with Windows 10. It’s currently (April 2015) in preview. It’s backward compatible with Windows 8, 8.1, 2012, and 2012 R2. To get PS5 install WMF5 from this link. Here’s the general PowershellGet architecture:

2677.1.png-550x0

For more information see the Powershell Gallery. PS5 installation requires a reboot

PS5-01After a reboot, in Powershell ISE, PS version shows as version 5

$PSVersionTable

PS5-02PS5 comes with PowershellGet module. To see its commands:

Get-Command -Module PowerShellGet

PS5-03

When running for the first time, run this command to automate the download of the needed nuget-anycpu.exe

Get-PackageProvider -Name NuGet -ForceBootstrap

PS5-04The default Repository is the Powershell Gallery, and it’s untrusted by default:

PS5-05To check out currently available modules:

$Modules = Find-Module
$Modules.Count # 153
$Modules | sort name | select * | Out-GridView

To install a module from the Gallery, use Install-Module as in:

Install-Module Pester

PS5-06Since the Powershell Gallery is untrusted by default, we’ll get the message above. If you want to trust the Powershell Gallery, use:

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Alternatively, use the -Force parameter with the Install-Module command to avoid the untrusted repository prompt.

Pester is a great unit testing module to help test Powershell scripts, developed by David Wyatt and the Pester team. To see its commands:

Get-Command -Module Pester

For more information on Pester see Pester on GitHub and video presentation from Powershell Summit NA 2015.

Now I have this module and can use its commands.

One of the great benefits of a NuGet repository for PS modules like PowershellGet is version control, as it keeps track of module versions as they’re published. To see different versions of a module:

Find-Module -Name Pester -AllVersions | select version,PublishedDate  | FT -a

PS5-07

 

 

 

 

 

 

 

 


Powershell module to send email without need for SMTP relay server


This script module contains Send-Email function that can be used to send email messages from Powershell. This function has the following advantages/differences compared to the Powershell native Send-MailMessage cmdlet:

Although this was purpose-built to handle bulk emails, it can also be used for script/Powershell based notifications/alerting – similar to the work of Jason (Robert) Morgan.

To use this module, download the .rar file, use WinRar or similar tool to extract its contents, unblock the files, open the Installer script in Powershell_ISE and run it. Then simply use the Send-Email function as you would any PS cmdlet.

Example:

Send-Email -From samb@mydomain.com -To samb@townsware.com -Subject ‘Test Message’ -Body ‘this is the email body text’ -MyFQDN ‘mail.thismachinedomain.com’ -ShowSMTP

Send-Email1


StorSimple 5k/7k series training video


This is a recording of a training session I did recently. It covers the common administrative tasks that may be needed to manage and use StorSimple 5k/7k series array. For more information on StorSimple see this post.

Summary of tasks covered include:

  • How to provision LUNs/iSCSI volumes
  • How to add it/present it to server(s)
  • How to expand LUN/iSCSI volume
  • Setup volume groups and protection policies for backup and DR

It also goes over best practices and recommended settings.