Automating 3PAR Upgrades

Some of the ground work you have to do when planning a 3PAR upgrade can be quite time consuming, so I have been looking at ways to automate the process and make it quicker. Today’s post focuses on using scripts to speed things up.  This will form part of a series on upgrades so don’t forget to connect with me on LinkedIn and Twitter to ensure you don’t miss any posts.

 

Check multipath policy

As a pre-upgrade step you will need to check that all Windows 2008 hosts using the MS MPIO driver have their multipath policy set to round robin. I used a script to make this step quicker.

The script uses Psexec to connect to a list of hosts and run mpclaim –s –d from the command line to check the current multipath policy. You can download Psexec from here .

The steps to check the host multipathing on multiple hosts via a single script are as follows:

1 Choose the server you want to run the script from and create a folder on it called C:scripts. Copy psexec to this folder

2 In C:scripts create a file called 3par_servers.txt Populate this with a list of the servers you wish to check for multipath configuration

3 Also in C:scripts create a batch file called mpclaim.bat and enter the following command line into it:

mpclaim -s -d

4 Finally, open a command line on the machine from which you wish to run the script, change directory to C:scripts and then enter

psexec -c -f @C:scripts3par_servers.txt C:scriptsmpclaim.bat

5 You should then see the window populate with the information you require. An example of the output is below:

PsExec v1.71 - Execute processes remotely
Copyright (C) 2001-2006 Mark Russinovich
Sysinternals - www.sysinternals.com
\Server1
C:Windowssystem32>mpclaim -s -d
For more information about a particular disk, use 'mpclaim -s -d #' where # is the MPIO disk number.
MPIO Disk    System Disk  LB Policy    DSM Name
-------------------------------------------------------------------------------
MPIO Disk4   Disk 5       RR           Microsoft DSM
MPIO Disk3   Disk 4       RR           Microsoft DSM
MPIO Disk2   Disk 3       RR           Microsoft DSM
MPIO Disk1   Disk 2       RR           Microsoft DSM
MPIO Disk0   Disk 1       RR           Microsoft DSM

 

Check LB policy appears as RR for all volumes.

 

Compatibility Check

Before you upgrade your 3PAR system you need to check the compatibility of all the components in the SAN, this can be time consuming particularly in a large environment. One component that can be particularly lengthy is gathering information on all the attached hosts.  In order to make gathering the host information as easy as possible in conjunction with my colleague  Rafal Kozaczek we have taken a PowerShell script (SystemInfo_(Excel).ps1) written by Amol Patil and modified it so that all the host information required to check host compatibility is gathered automatically for Windows servers.

I have included the modified version of the script at the end of this post. As ever you are welcome to use the script, but please check it is suitable for use in your environment and you do so entirely at your own risk.

You will need to run the script from a workstation with PowerShell and Excel installed.

1 Copy the PowerShell script found at the bottom of this post into Notepad and then save as 3PAR_Hosts.ps1 to the location C:scripts on the machine you wish to run the script from

 

2 Open PowerShell as an administrator and change directory to c:scripts

cd c:scripts

3 Choose to run the script you just saved

3PAR_Hosts.ps1

1 powershell select

4 Select option 1 to run the script against a list of hosts in a text file.  When prompted enter the host list you created earlier 3par_servers.txt

The resulting spreadsheet will deliver all the information you need to complete the host checks. Columns A – I are the ones you will need, the other info was already pulled by the original script so I just left it in there.

2 excel

The PowerShell code is in full below.  You are free to use it but you do so entirely at your own risk, please also take the time to read through it before you run it so you fully understand what it does.

[code language="powershell"]
 #@=============================================
 #@ FileName: SystemInfo_(Excel).ps1
 #@=============================================
 #@ Script Name: SystemInfo_(Excel)
 #@ Created: [DATE_DMY] 20/03/2013
 #@ Author: Amol Patil
 #@ Email: amolsptec[email protected]
 #@ Edited by 3ParDude (Richard Arnold) / Rafal Kozaczek to gather host information for 3PAR upgrade. http://3ParDude.com
 #@ Web:
 #@ Requirements:
 #@ OS:
 #@ Keywords:
 #@ Version History:
 #@=============================================
 #@ Purpose:
 #@ To collect System Information local/remote
 #@
 #@=============================================

#@================Code Start===================

# ==============================================================================================
 # Function SysInfo - collects information using WMI and places results in Excel Sheet
 # ==============================================================================================
 Function SysInfo {

foreach ($StrComputer in $colComputers){

$GenItems1 = gwmi Win32_ComputerSystem -Comp $StrComputer
 $GenItems2 = gwmi Win32_OperatingSystem -Comp $StrComputer
 $SysItems3 = gwmi Win32_WmiSetting -Comp $StrComputer
 $MemItems1 = gwmi Win32_PhysicalMemory -Comp $StrComputer
 $MemItems2 = gwmi -class MSFC_FCAdapterHBAAttributes -Comp $StrComputer -Namespace "rootWMI"
 $MemItems3 = Invoke-Command -ComputerName $StrComputer -ScriptBlock {(Get-Command c:windowssystem32driversmpio.sys).FileVersionInfo}
 $NetItems = gwmi Win32_NetworkAdapterConfiguration -Comp $StrComputer  | where{$_.IPEnabled -eq "True" -and $_.DNSHostName -ne $NULL}

# Populate General Sheet(1) with information

foreach ($objItem in $GenItems1){

#$Sheet1.Cells.Item($intRow, 1) = $StrComputer
 $Sheet1.Cells.Item($intRow, 1) = $objItem.Name
 $Sheet1.Cells.Item($intRow, 15) = $objItem.Domain
 $Sheet1.Cells.Item($intRow, 2) = $objItem.Manufacturer
 $Sheet1.Cells.Item($intRow, 3) = $objItem.Model
 $Sheet1.Cells.Item($intRow, 16) = $objItem.SystemType
 $Sheet1.Cells.Item($intRow, 10) = $objItem.TotalPhysicalMemory / 1024 / 1024

}

foreach ($objItem in $GenItems2){

$Sheet1.Cells.Item($intRow, 4) = $objItem.Caption
 $Sheet1.Cells.Item($intRow, 11) = $objItem.BuildNumber
 $Sheet1.Cells.Item($intRow, 5) = $objItem.CSDVersion
 $Sheet1.Cells.Item($intRow, 9) = $objItem.Version
 $Sheet1.Cells.Item($intRow, 12) = $objItem.OSArchitecture

}
 foreach ($objItem in $NetItems){

$Sheet1.Cells.Item($intRowNet, 13) = $objItem.IPAddress

}

foreach ($objItem in $MemItems2){

$Sheet1.Cells.Item($intRow, 6) = $objItem.Model
 $Sheet1.Cells.Item($intRow, 7) = $objItem.DriverVersion
 $Sheet1.Cells.Item($intRow, 8) = $objItem.FirmwareVersion

}

foreach ($objItem in $MemItems3){

$Sheet1.Cells.Item($intRow, 14) = $objItem.ProductVersion

}

$intRow = $intRow + 1
 $intRowNet = $intRowNet + 1

}

}

#@=============================================

# ========================================================================

# Function Name 'HostList' - Enumerates Computer Names in a text file

# Create a text file and enter the names of each computer. One computer

# name per line. Supply the path to the text file when prompted.

# ========================================================================

Function HostList {
 $strText = Read-Host "Enter the path for the text file"
 $colComputers = Get-Content $strText
 }

# ========================================================================

# Function Name 'Host' - Enumerates Computer from user input

# ========================================================================

Function Host {

$colComputers = Read-Host "Enter Computer Name or IP"

}
 # ========================================================================

# Function Name 'LocalHost' - Enumerates Computer from user input

# ========================================================================

Function LocalHost {

$colComputers = $env:computername

}

#@=================================================================================================================================
 #Gather info from user input.

Write-Host "********************************"               -ForegroundColor Green
 Write-Host "System Information Inventory"                   -ForegroundColor Green
 Write-Host "by: Amol Patil "                                -ForegroundColor Green
 Write-Host "********************************"               -ForegroundColor Green
 Write-Host " "

Write-Host "Which computer resources would you like in the report?"   -ForegroundColor Green

$strResponse = Read-Host "
 [1] Computer Names from a File.
 [2] Enter a Computer Name manually.
 ------OR------
 [3] Local Computer.

"

If($strResponse -eq "1"){. HostList}
 elseif($strResponse -eq "2"){. Host}
 elseif($strResponse -eq "3"){. LocalHost}
 else{Write-Host "You did not supply a correct response, `

Please run script again." -foregroundColor Red}

Write-Progress -Activity "Getting Inventory" -status "Running..." -id 1
 #@=================================================================================================================================

#New Excel Application

$Excel = New-Object -Com Excel.Application

$Excel.visible = $True

# Create 2 worksheets

$Excel = $Excel.Workbooks.Add()

# Assign each worksheet to a variable and

# name the worksheet.

$Sheet1 = $Excel.Worksheets.Item(1)

$Sheet2 = $Excel.WorkSheets.Item(2)

$Sheet1.Name = "SysInfo"

$Sheet2.Name = "Software"

#Create Heading for General Sheet

$Sheet1.Cells.Item(1,1) = "Host Name"
 $Sheet1.Cells.Item(1,2) = "Manufacturer"
 $Sheet1.Cells.Item(1,3) = "Server Model"
 $Sheet1.Cells.Item(1,4) = "Operating_System"
 $Sheet1.Cells.Item(1,5) = "ServicePack"
 $Sheet1.Cells.Item(1,6) = "HBA-Model"
 $Sheet1.Cells.Item(1,7) = "HBA-DriverVersion"
 $Sheet1.Cells.Item(1,8) = "HBA-FirmwareVersion"
 $Sheet1.Cells.Item(1,9) = "MS MPIO Version"
 $Sheet1.Cells.Item(1,10) = "Memory"
 $Sheet1.Cells.Item(1,11) = "BuildNumber"
 $Sheet1.Cells.Item(1,12) = "OSArchitecture"
 $Sheet1.Cells.Item(1,13) = "IPAddress"
 $Sheet1.Cells.Item(1,14) = "ProductVersion"
 $Sheet1.Cells.Item(1,15) = "Domain"
 $Sheet1.Cells.Item(1,16) = "SystemType"

$colSheets = ($Sheet1, $Sheet2)

foreach ($colorItem in $colSheets){

$intRow = 2

$intRowDisk = 2

$intRowSoft = 2

$intRowNet = 2

$WorkBook = $colorItem.UsedRange

$WorkBook.Interior.ColorIndex = 40

$WorkBook.Font.ColorIndex = 11

$WorkBook.Font.Bold = $True

}

If($credResponse -eq "y"){SysInfoCrd}

Else{SysInfo}

#Auto Fit all sheets in the Workbook

foreach ($colorItem in $colSheets){

$WorkBook = $colorItem.UsedRange

$WorkBook.EntireColumn.AutoFit()

#clear

}

Write-Host "@*******************************@" -ForegroundColor Green

Write-Host "The Report has been completed."  -ForeGroundColor Green

Write-Host "@*******************************@" -ForegroundColor Green

#@================Code End=====================
 [/code]

If you have found a way to speed up the process that you use, please let us all know in the comments.

 

Installing the 3PAR Management Console

The process for downloading and installing the 3PAR Management Console is covered in this post. The 3PAR Management Console was the traditional tool for managing your 3PAR systems. 4.7.3 was the last incarnation of IMC, since it has been superseded by the StoreServ Management Console (SSMC) which gives you a pretty web based management interface.  If you want to get started with the SSMC you can get ready with our SSMC install guide and beginners SSMC posts.

If you are running 3PAR OS 3.3.1 and below or just prefer the traditional management console then read on.

Downloading the 3PAR Management Console

1 You can download the 3PAR Management console, form this direct link which takes you to the 3PAR software depot.  If you just browse the depot its hidden.

Installing the IMC

Its dead easy but here I will walk you though the process with screen shots.

1 Choose to run setup.exe for the v4.7 files you just downloaded. In my case from inside the Windows directory of the ISO

2 Just choose next at the 3PAR management console introduction screen

Introduction screen on 3PAR management console install

2 Choose the install location, leave it default unless you have specific reason to move it and then click next

Choosing file location for installation

3 A summary of the install appears, check your selections and then click install

Summary of selections made in wizard

4 A couple of information screens appear during the install, no need for any input.  Just wait for the install to complete.

Screen displaying progress of install

5 That’s it just click done, and you have the latest version of IMC installed!

Screen confirming 3PAR Management console 4.7 has been installed

Don’t forget to install your other 3PAR management tools the CLI and SSMC

You can learn more about the IMC in the HPE 3PAR Management Console User Guide

 

3 Par OS Upgrade – Part 3 Upgrade Checklist

As I went through the HP 3Par 3.1.3 Inform OS upgrade process I created a checklist of the key steps for quick reference. I have shared it below, but please double check this list against the official HP documentation to ensure all points relevant to your environment and version are covered. Any comments or additions you would like to see on the checklist get in touch through Twitter

A) Pre-Upgrade Checks

1. Hosts

  • Check compatibility of components. You can complete this step yourself by using SPOCK or send off a completed host worksheet to HP who will verify the compatibility for you.
  • Apply Windows multipath patches :
    • KB275704 needs to be applied to Windows Server 2008, and 2008 R2
    • KB2821052 needs to be applied to Windows Server 2012 and Windows Server 2008 R2
  • Check MPIO is set to round robin on Windows 2008 servers using the native MPIO driver. The process using psexec is covered in this post under point 2.

2. SAN

  • Load must be below 50% at the time of upgrade. Run statcpu and statport and check utilisation is below 50%
  • Check current version is on upgrade path. showversion
  • Check the system is healthy. checkhealth
  • There are some version specific checks when upgrading from 2.3.1 or 3.1.1 to 3.1.2 check HP 3par OS 3.1.X Upgrade Pre-planning Recommendations for more information

B) Day of upgrade

1. Pre-Upgrade

  • Load must be below 50% at the time of upgrade. Run statcpu and statport and check utilisation is below 50%
  • If possible suspended tasks that would cause a heavy load eg backups
  • Stop AO, DO, and RC tasks before the upgrade. Plus stop anything else that interacts with the system such as scripts
  • Stop system reporter. Stop windows service – 3Par System Reporter Sampler Service
  • Showtask – and check for any DO activity
  • Stop any software that directly interact with the SAN e.g. Recovery Manager, scripts etc.
  • Stop RC
  • Check no one is logged in showuserconn
  • Checkhealth again. checkhealth -svc detail performs a full health check on the system
  • checkupgrade to verify if the system is ready to undergo an online upgrade.
  • Check current connectivity status of the hosts showhost -pathsum
  • All upgrades until after 3.1.3 are performed by HP, so next HP should install the update for you.

2. Post Upgrade

  • Check version is as expected showversion –a -b
  • Verify connectivity of hosts showhost –pathsum, plus check monitoring software attached hosts etc. for any potential issues
  • Restart suspended tasks setsched -resume_all . Check schedules running again showsched
  • Change Windows 2008 and 2012 to host persona 15 sethost –persona 15 servername
  • Remove default CPG. removecpg
  • Restart system reporter windows service (3Par System Reporter Sampler Service) plus any other software you stopped such as Recovery Manager
  • Resume backups and any other systems you suspended to reduce the load on the SAN
  • Check for new CLI and management console from FTP supplied by HP or software depot.  Check compatibility in SPOCK
  • Plus if you use any other 3Par software such as Recovery manager VSS provider etc check in the release notes for the latest version and then download via supplied FTP link from HP or from the software depot

 

Catch the full series of posts in which I ran through the upgrade process in detail: Part 1 

Part 2

3ParDude