300-003-978 A01 Elccnt 0
300-003-978 A01 Elccnt 0
P/N 300-003-978
Rev A01
This document provides best practices and advice for using EMC®
PowerPath® Migration Enabler.
Topics include:
◆ Executive summary.............................................................................. 2
◆ Introduction........................................................................................... 3
◆ Overview of PowerPath Migration Enabler ..................................... 4
◆ Open Replicator scenario 1: Pseudo device to pseudo device....... 6
◆ Open Replicator scenario 2: Native device to pseudo device...... 14
◆ Invista encapsulation scenario ......................................................... 30
◆ VERITAS volume management........................................................ 45
◆ Tips and best practices....................................................................... 65
◆ Conclusion........................................................................................... 75
◆ References ............................................................................................ 76
◆ Appendix: Scripts ............................................................................... 77
1
Executive summary
Executive summary
EMC PowerPath Migration Enabler is a tool designed to leverage
existing EMC replication technologies and allow faster and easier
data migrations. PowerPath Migration Enabler is also designed to
significantly decrease application downtime and provide enhanced
data protection. As a new product, there is a need for a deeper
understanding of how to best perform a successful implementation.
In its initial release, PowerPath Migration Enabler enhances the
capabilities of EMC Open Replicator by maintaining both source and
target devices in a consistent state. Mirroring the two devices allows
auditioning the migration and returning to the initial state with no
downtime. Additional benefits will be provided to users of EMC
Invista, through transparent encapsulation of existing storage
devices. This functionality allows hosts that are using devices
presented through an existing array/SAN a potentially
nondistruptive method of accessing the same devices.
This offering will be released with PowerPath version 5.0 for each
supported operating system.
To aid in the deployment of the new offering, these technical notes
focus on use case scenarios, as well as tips and best practices to follow
during implementations.
This document contains some information that is specific to the
Solaris operating system used to implement the use cases. However,
the majority of the information is generic, and focuses on the
PowerPath Migration Enabler and the underlying replication
technologies.
Introduction
This document provides best practice guidelines for PowerPath
Migration Enabler. To highlight these capabilities, the document
examines the following use case scenarios:
◆ Perform a migration between PowerPath pseudo devices with no
disruption, using Open Replicator as the underlying replication
technology.
◆ Perform a migration from native devices to PowerPath pseudo
devices with minimum disruption, using Open Replicator as the
underlying replication technology.
◆ Demonstrate the ability to increase file system size without
disruption after migration is complete. This scenario highlights
the case of performing capacity uplift migrations.
◆ Provide the steps necessary to complete a transparent,
nondisruptive Invista encapsulation of devices on a system that is
currently accessing PowerPath pseudo devices.
This document also provides some tips and best practices not covered
in the use case scenarios. Many focus on environmental issues.
PowerPath Migration Enabler leverages the I/O filter of PowerPath
and existing EMC replication technologies. Proper setup and
functioning of these offerings is the key to success when using
PowerPath Migration Enabler.
These technical notes are not a substitute for PowerPath Migration
Enabler training and user documentation. These notes assume that
the reader has a basic understanding of PowerPath, PowerPath
Migration Enabler commands, the underlying replication technology
involved, and any volume management software (such as VERITAS
Volume Manager or Solstice DiskSuite) referenced herein.
Note: Most importantly, this document is not a replacement for the PowerPath
Migration Enabler User's Guide or the release notes. Be sure to read and
understand both documents, as well as the documentation for any asoociated
product, before proceeding with implementation.
Audience
This document is intended for customers who are interested in
maximizing their Open Replicator environment or who are
investigating implementing Invista storage virtualization product.
The session for the first migration is ready to proceed and is in the
setup state.
3. To initiate the movement of data from the source to the target, we
must synchronize the source and target devices (using the handle
that was specified in the powermig setup output):
powermig sync -handle 4 -no
Note: The -no is short for -noprompt, which causes the command to be
executed without requiring a user response.
The lower portion of Figure 5 shows the output from a query sent
after selecting the target.
Note: The brief outage is required only for reconfiguring the Solstice
DiskSuite device, not for the operating system. If this migration were
performed using PowerPath pseudo devices that were formatted with UFS
and no volume manager was involved, the file system could be migrated and
increased without interruption.
from the defined target device by calling the original source device
name, is stopped, and the application must be reconfigured to use the
target device's native device name.
3. As Figure 14 also shows, we can adjust the throttle value for each
device:
powermig throttle -hd handle -tv value
Note: In this scenario, the application itself does not require reconfiguration,
since the Solstice DiskSuite metadevice will not change its name, but only its
available capacity. The metadevice configuration will need to be updated.
Had this been a migration in which the application was configured to use the
native devices, it would require a reconfiguration to access the correct device.
In this example, Solstice DiskSuite is the application.
devices so that the I/O now goes to the selected target devices,
that all reads are performed from the new target devices,
and—most importantly—the mirroring relationship between the
source/target pair has ended. Any change now made to the
selected device will not be replicated.
5. Now that the operating system has the correct information for the
disk layout, we re-establish the metadb and perform the metainit.
As Figure 23 on page 28 shows, the system is still unaware of the
new capacity, but the metadevice is back and functional.
6. The last step to expand the volume to use the new capacity is to
type the Solaris growfs command, as shown in Figure 24 on
page 29. This can be done with the file system mounted; however,
I/O to this disk will be halted while the newfs portion of the
command is executed, so this step should be performed just
before restarting the application that requires access to the file
system.
Note: When performing any operations with Soltice Disksuite or any other
volume management software, carefully review the release notes for
additional information.
Note: New with the PowerPath 5.0 release is the command powermt
display nonvirtual [dev=device|all]. The output from this command
lists the devices presented to the host by the Invista instance. The man
page on powermt contains more details.
After the commit, the display of the mounted file system shows
that the mount point has not changed, and any I/O that had been
accessing this device continued without interruption.
Figure 35 on page 41 and Figure 36 on page 42 are powermt
displays of the emcpower devices used before and after this
encapsulation. Notice that only the native paths that were used to
construct the pseudo device names changed; the pseudo device
names themselves did not change.
Figure 37 Removing the source LUN from the operating system’s view
Note: The pseudo device name removed from PowerPath was the target.
The original source device name is still in use, but the logical units that
were referenced by it have changed. Therefore, as displayed in the
Aftermig.lis, the pseudo device name to be cleared is the one that
references the original devices.
The output shown in Figure 39 indicates that while the host system is
still calling source device c4t0d34s0, PowerPath is providing
redirection to new target c3t0d34s0. This state can be held as long as
is necessary to find a maintenance window during which the final
reconfiguration steps can be performed to allow the application
(VxVM 4.0 in this case) the opportunity to be resized.
7. The last step to increase the usable size of the UFS file system
while that system continues to use the device is to execute the
Solaris growfs command (shown in Figure 59 on page 63).
Note: I/O to the file system will stop for the time required to complete
the newfs portion of growfs. This very short time is not a disruption of
service, but creates a temporary performance degradation.
The system has now expanded the usable capacity of the ppmefs_1
file system without disruption of service.
SP A FA-1
FA-2
Source Target
LUN FA-3 LUN
SP B FA-4
CLARiiON Symmetrix
SAN
HBA 1 HBA 2
IVA-000016
In Figure 61, the host system can see the source LUN through both
HBAs. The target LUN is seen through both HBAs, but is presented
to the system through only two of the Symmetrix FA ports. To
correctly configure the SAN for Open Replicator performing a hot
pull, all FA ports presenting the target LUN require access to the
CLARiiON SPs that are presenting the source device as if those FAs
were host initiators accessing the CLARiiON LUN.
In a Symmetrix-to-Symmetrix environment, all FA ports presenting a
target device require access to all FA ports presenting the source
device.
The final point of interest is that the host system has to see the source
and target devices only down a single path; no extra consideration is
needed.
Note: If the Open Replicator parameter set ceiling is set, Open Replicator
disables the PowerPath Migration Enabler throttle command.
0 3 minutes
1 8 minutes
2 12 minutes
3 15 minutes
4 38 minutes
5 1 hour 4 minutes
6 1 hour 39 minutes
7 2 hours 6 minutes
8 4 hours 4 minutes
9 12 hours 23 minutes
Scripts
PowerPath Migration Enabler is designed to function on one pair of
devices at a time. However, there may be times when many devices
must be migrated at the same time. To aid in such a scenario, this
white paper contains some templates for scripts that were designed
to aid in large-scale migrations.
“Appendix: Scripts” on page 77 contains a series of scripts that can be
edited and tailored to assist in performing a migration using
PowerPath Migration Enabler.
Be aware that these scripts are not production code, and are provided
only to aid in understanding the process and to assist in the effective
use of PowerPath Migration Enabler.
Identifying device The key to any successful migration, regardless of the tool used to
pairs perform the task, is proper planning. Before performing a migration,
the LUNs to be migrated must be identified, and the information
concerning these devices should be viewable from both the host
system and the arrays involved. The script VerifyPairsTSPairs.sh
uses this information to verify the migration pairs of source and
target devices on which PowerPath Migration Enabler will act.
“VerifyTSPairs.sh” on page 77 contains the script.
Synchronizing data Once the source/target migration pairs are established within the
PowerPath Migration Enabler framework, the next step is to begin
the data transfer, while maintaining the consistency of the
information between the devices involved. The script SyncPairs.sh
can be used to initiate the data migration between the established
source/target pairs and report when complete. “SyncPairs.sh” on
page 87 contains the script.
Selecting targets and The last template script is supplied to provide a method for finishing
commiting the the migration in an automated fashion. PowerPath Migration Enabler
migration provides the ability to switch continually between the source and
target devices for testing purposes, and maintains consistent
mirrored copies of data on both devices (even through system
reboots). Once the powermig commit is executed, that consistency is
broken, and the data on the source device will be, for all intents and
purposes, unusable. Use caution when automating the final step of
any migration. Also be aware that once the commit is performed, you
cannot revert to the pre-migration configuration.
The script SelTargComPairs.sh is built to perform a selectTarget on
all pairs currently in the selectSource state. A variable in the script
can be set to perform the commit for these pairs.
“SelTargComPairs.sh” on page 93 contains the script.
Conclusion
The ability to perform data migrations with the minimum
interruption to services is a major challenge through all industries.
The reasons are plentiful: the need to grow an environment, the need
to refresh equipment, the need for Information Lifecycle
Management strategies, and so on. EMC has identified the needs and
has supplied many tools to aid in this key function. From SRDF®,
MirrorView™, SAN Copy™, Open Migrator, Open Replicator and so
on, the ability to migrate data is critical.
PowerPath Migration Enabler addresses one of the most difficult
issues concerning the performance of data movement—time to
completion. With the use of PowerPath pseudo devices, downtime to
applications can virtually be eliminated, and the true value of the
replication technologies can be leveraged.
References
The following documents, available on EMC Powerlink™, contain
additional information. Note that all but the last two items are
available in the Powerlink Documentation and White Papers Library:
◆ PowerPath Version 5.0 Product Guide
◆ PowerPath for Solaris Version 5.0 Installation and Administration
Guide
◆ PowerPath for Solaris Version 5.0 Migration Enabler User’s Guide
◆ PowerPath for Solaris Version 5.0 Release Notes
◆ PowerPath for Solaris Version 5.0 Migration Enabler Release Notes
◆ Invista 1.0 Element Manager Administration Guide
◆ EMC Invista Deployment Scenarios (Powerlink EMC World
presentation)
◆ TS Kit: Open Replicator for Symmetrix Implementation Service
Send any comments or questions concerning this document to
cse-powerpath@EMC.com.
Appendix: Scripts
This appendix contains four scripts that can be tailored to assist in
performing a migration using PowerPath Migration Enabler. Be
aware that these scripts are not production code, and are provided
only to aid in understanding the process and to assist in the effective
use of PowerPath Migration Enabler.
VerifyTSPairs.sh
#!/usr/bin/sh
#
#---------------------------------------------------------------------
#
# File Name: VerifyTSPairs.sh
#
# Script Description: Script to supply detailed information
# about the source/target devices selected
# for a PowerPath Migration Enabler migration
#
#---------------------------------------------------------------------
#
# Author Identification
#
# SRT Steven R Thellen EMC
#
#---------------------------------------------------------------------
#
# Revision History
#
# REV Who Date Comment
# --- --- ---- -------
# 000 SRT 13-JUL-2006 Initial Release
#
#---------------------------------------------------------------------
#
#############################
#
# Script-specific variables
DAT=`date +%y%m%d_%H%M%S`
Sysn=`hostname`
#
##########
#
# OUTF -> location and name of output file
OUTF="PPmigVerf_${DAT}.out"
#
############
#
# WATCHERS -> If using the 'send_email_alarm' function,
# set this variable to contain list of recipients
# Example:
# WATCHERS="user1@company.com user2@company.com"
WATCHERS=""
#
# ENBmail -> Value 0 / 1
# 0 = No emails will be sent using the send_email_alarm function
# 1 = emails will be sent using the send_email_alarm function
ENBmail=0
#
##########
#
# DISPLAY -> Value 0 / 1
# 0 = No additional messages or information displayed
# 1 = Additional information and OUTF file displayed
#
DISPLAY=1
#
##########################################################
#
# dlist -> Populate the variable below with pairs of
# <Source device>:<Target device> separated by spaces
# Example:
# dlist="c4t0d16s2:c3t0d16s2 c4t0d17s2:c3t0d17s2"
#
# If this program is supplied with an additional file name
# on the command line, and populated with
# <Source device>:<Target device>
# in the format of one per line, then that will be the set
# acted upon.
# Example of file format:
# c4t0d16s2:c3t0d16s2
# c4t0d17s2:c3t0d17s2
# emcpower2a:emcpower21a
############################
# Edit the Variable below if you wish to execute using the "dlist"
variable
dlist=""
SupFile=$1
if [ "${SupFile}X" = "X" ]
then
# No file was supplied / Test is dlist is valid
if [ "${dlist}X" = "X" ]
then
# Ok, no file and no dlist. We are exiting
echo " "
echo " <--------------------------------> "
echo " Sorry, but either a file with"
echo " the properly format info -or- "
echo " The 'dlist' variable must be set"
echo " Please try again with correct info"
echo " Thank You"
echo " <--------------------------------> "
echo " "
exit 1
else
# Ok, we have something in the dlist variable
# Lets attempt to proceed.
GO=3
fi
else
# Ok, let's test if file is valid
if test -f ${SupFile}
then
# Ok, found path to file, do quick test and populate dlist
QTest=`grep ":" ${SupFile} | wc -l`
if test $QTest -ge 1
then
# Passed quick test, attempt to populate
dlist=`grep -v "#" ${SupFile}`
GO=3
else
# No ":" found in SupFile, format can not be correct
echo " "
echo " <--------------------------------> "
echo " Sorry, but file is not in the"
echo " proper format "
echo " Please try again with correct info"
echo " Thank You"
echo " <--------------------------------> "
echo " "
exit 1
fi
else
# Path to the SupFile is not valid
echo " "
echo " <--------------------------------> "
echo " Sorry, but file: ${SupFile}"
echo " Not Found "
echo " Please try again with correct info"
#
#################################
#
# --> Subroutines <--
#
###############################################################
# FUNCTION NAME: send_email_alarm
# DESCRIPTION: send an alarm via email
#
# INPUTS: 1 - Subject of email
# 2 - who to send message to
# 3 - log file to mail
# OUTPUTS: None
#
############################################################
SEA_FILE=$OUTF
SEA_TO=$WATCHER
send_email_alarm()
{
# Give passed arguments meaningful names
#SEA_SUBJECT=$1
#SEA_TO=$2
#SEA_FILE=$3
if [ "${SEA_FILE}" = "" ]; then
SEA_FILE=/dev/null
fi
# Figure out which mailer to used based on the OS_TYPE
case ${OS_TYPE} in
"Linux")
MAIL=/bin/mail
;;
"SunOS")
MAIL=/usr/ucb/mail
$MAIL -s "$SEA_SUBJECT" $SEA_TO < $SEA_FILE 1>/dev/null 2>&1
;;
"HP-UX")
MAIL=/usr/bin/elm
cat $SEA_FILE | $MAIL -s "$SEA_SUBJECT" $SEA_TO 1>/dev/null 2>&1
;;
esac
}
#
#
#######################
#
# Main
#
#######
for n in $dlist
do
src=`echo $n | sed s:s0:s2:g | awk -F: '{ print $1 }'`
tgt=`echo $n | sed s:s0:s2:g | awk -F: '{ print $2 }'`
#
# .... proceed to target info for this pair
SetupPairs.sh
#!/usr/bin/sh
#
#---------------------------------------------------------------------
#
# File Name: SetupPairs.sh
#
# Script Description: Script to establish PowerPath Migration
# Enabler device pairs and report when complete
#
#---------------------------------------------------------------------
#
# Author Identification
#
# SRT Steven R Thellen EMC
#
#---------------------------------------------------------------------
#
# Revision History
#
# REV Who Date Comment
# --- --- ---- -------
# 000 SRT 13-JUL-2006 Initial Release
#
#---------------------------------------------------------------------
#
#############################
#
# Script-specific variables
DAT=`date +%y%m%d_%H%M%S`
Sysn=`hostname`
#
##########
#
# OUTF -> location and name of output file
OUTF="PPmigSetupinfo_${DAT}.out"
#
############
#
# TechType -> Select either OR for OpenReplicator or INVE for Invista
# (default: OR)
TechType=OR
#
############
#
# WATCHERS -> If using the 'send_email_alarm' function,
# set this variable to contain list of recipients
# Example:
# WATCHERS="user1@company.com user2@company.com"
WATCHERS=""
#
# ENBmail -> Value 0 / 1
# 0 = No emails will be sent using the send_email_alarm
# function
# 1 = emails will be sent using the send_email_alarm
# function
ENBmail=0
#
##########
#
# DISPLAY -> Value 0 / 1
# 0 = No additional messages or information displayed
# 1 = Additional information and OUTF file displayed
#
DISPLAY=0
#
##########################################################
#
# dlist -> Populate the variable below with pairs of
# <Source device>:<Target device> separated by spaces
# Example:
# dlist="c4t0d16s2:c3t0d16s2 c4t0d17s2:c3t0d17s2"
#
# If this program is supplied with an additional file name
# on the command line, and populated with
# <Source device>:<Target device>
# in the format of one per line, then that will be the set
# acted upon.
# Example of file format:
# c4t0d16s2:c3t0d16s2
# c4t0d17s2:c3t0d17s2
# emcpower2a:emcpower21a
###########################
# Edit the Variable below if you wish to execute using
# the "dlist" variable
dlist=""
SupFile=$1
if [ "${SupFile}X" = "X" ]
then
# No file was supplied / Test is dlist is valid
if [ "${dlist}X" = "X" ]
then
# Ok, no file and no dlist. We are exiting
echo " "
echo " <--------------------------------> "
echo " Sorry, but either a file with"
echo " the properly format info -or- "
echo " The 'dlist' variable must be set"
echo " Please try again with correct info"
echo " Thank You"
echo " <--------------------------------> "
echo " "
exit 1
else
# Ok, we have something in the dlist variable
# Lets attempt to proceed.
GO=3
fi
else
# Ok, let's test if file is valid
if test -f ${SupFile}
then
# Ok, found path to file, do quick test and populate dlist
QTest=`grep ":" ${SupFile} | wc -l`
if test $QTest -ge 1
then
# Passed quick test, attempt to populate
dlist=`grep -v "#" ${SupFile}`
GO=3
else
# No ":" found in SupFile, format can not be correct
echo " "
echo " <--------------------------------> "
echo " Sorry, but file is not in the"
echo " proper format "
echo " Please try again with correct info"
echo " Thank You"
echo " <--------------------------------> "
echo " "
exit 1
fi
else
# Path to the SupFile is not valid
echo " "
echo " <--------------------------------> "
echo " Sorry, but file: ${SupFile}"
echo " Not Found "
echo " Please try again with correct info"
#
#################################
#
# --> Subroutines <--
#
#######################################################
#
# FUNCTION NAME: InfoPPmig
# DESCRIPTION: Collect information about current list of jobs
# scheduled to be executed
#
# INPUTS: none
#
# OUTPUTS: <Job Handle>:<Source dev>:<Target dev>:<Current Status>
#
##################################################################
#
InfoPPME ()
{
MigInfo=`powermig info -query -all |grep -v Source| grep -v "=" \
| awk '{ print $1":"$2":"$3":"$NF }'|grep -v "::"`
}
#
############################################################
#
# FUNCTION NAME: send_email_alarm
# DESCRIPTION: send an alarm via email
#
# INPUTS: 1 - Subject of email
# 2 - who to send message to
# 3 - log file to mail
# OUTPUTS: None
#
###########################################################
SEA_FILE=$OUTF
SEA_TO=$WATCHER
send_email_alarm()
{
# Give passed arguments meaningful names
#SEA_SUBJECT=$1
#SEA_TO=$2
#SEA_FILE=$3
if [ "${SEA_FILE}" = "" ]; then
SEA_FILE=/dev/null
fi
for n in $dlist
do
src=`echo $n | sed s:s0:s2:g | awk -F: '{ print $1 }'`
tgt=`echo $n | sed s:s0:s2:g | awk -F: '{ print $2 }'`
else
echo " tgt: $tgt " >> $OUTF
fi
echo " " >> $OUTF
#
# Now, we setup the src/tgt pairs for execution
powermig setup -tt ${TechType} -src ${src} -tgt ${tgt} -no 1>>${OUTF}
2>&1
SyncPairs.sh
#!/usr/bin/sh
#
#---------------------------------------------------------------------
#
DAT=`date +%y%m%d_%H%M%S`
Sysn=`hostname`
#
##########
#
# OUTF -> location and name of output file
OUTF="PPmigSyncinfo_${DAT}.out"
#
############
#
# ThrottleValue -> Select value between 0 and 9
# 0 = Fastest/Most resources consumed
# 9 = Slowest/Least resources consumed
# (default: 5)
ThrottleValue=0
#
############
#
# MonTillDone -> Value 0 -or- 1
# This variable will enable the Monitoring till done
# functionality. If set to '1', this script will
# continue to execute and wait till ALL migrations
# have completed before sending a report.
#
# Set to '0' (default) and a report will be generated
# immediately
#
MonTillDone=0
#
# RepInt -> This is the report interval in seconds to wait to check on
# progress of migrations monitored
RepInt=180
#
#
############
#
# WATCHERS -> If using the 'send_email_alarm' function,
# set this variable to contain list of recipients
# Example:
# WATCHERS="user1@company.com user2@company.com"
#
WATCHERS=""
#
# ENBmail -> Value 0 / 1
# 0 = No emails will be sent using the send_email_alarm
# function
# 1 = emails will be sent using the send_email_alarm
# function
ENBmail=0
#
##########
#
# DISPLAY -> Value 0 / 1
# 0 = No additional messages or information displayed
# 1 = Additional information and OUTF file displayed
#
DISPLAY=0
#
##########################################################
#
# --> Subroutines <--
#
################################################################
#
# FUNCTION NAME: InfoPPmig
# DESCRIPTION: Collect information about current list of jobs
# scheduled to be executed
#
# INPUTS: none
#
# OUTPUTS: <Job Handle>:<Source dev>:<Target dev>:<Current Status>
#
###############################################################
#
InfoPPmig ()
{
MigInfo=`powermig info -query -all |grep -v Source| grep -v "=" \
| awk '{ print $1":"$2":"$3":"$NF }'|grep -v "::"`
}
#
######################################################
#
# FUNCTION NAME: send_email_alarm
# DESCRIPTION: send an alarm via email
#
# INPUTS: 1 - Subject of email
# 2 - who to send message to
# 3 - log file to mail
# OUTPUTS: None
#
#######################################################
SEA_FILE=$OUTF
SEA_TO=$WATCHER
send_email_alarm()
{
# Give passed arguments meaningful names
#SEA_SUBJECT=$1
#SEA_TO=$2
#SEA_FILE=$3
if [ "${SEA_FILE}" = "" ]; then
SEA_FILE=/dev/null
fi
# Figure out which mailer to used based on the OS_TYPE
case ${OS_TYPE} in
"Linux")
MAIL=/bin/mail
;;
"SunOS")
MAIL=/usr/ucb/mail
$MAIL -s "$SEA_SUBJECT" $SEA_TO < $SEA_FILE 1>/dev/null 2>&1
;;
"HP-UX")
MAIL=/usr/bin/elm
#
# First, get the current list of setup jobs
#
InfoPPmig
for n in $MigInfo
do
# Check if handle is in 'setup' state
state=`echo $n | awk -F: '{ print $NF }'`
if [ "${state}X" = "setupX" ]
then
# Get 'handle' and start sync with preset ThrottleValue
handle=`echo $n | awk -F: '{ print $1 }'`
InfoPPmig
for n in $MigInfo
do
Tstate=`echo $n | grep sync | wc -l`
Tsync=`echo $Tsync $Tstate`
done
Tst=`echo $Tsync | grep 1 | wc -l`
if test $Tst -eq 0
then
# No jobs currently in 'sync' state - send report
sleep $RepInt
fi
done
else
# Send status now
if test $ENBmail -ge 1
then
SelTargComPairs.sh
#!/usr/bin/sh
#
#---------------------------------------------------------------------
#
# File Name: SelTargComPairs.sh
#
# Script Description: Script to will examine current state of PowerPath
# Migration Enabler database and perform a
# 'selectTarget' on ALL devices in the
# 'sourceSelected' state.
#
# In addition, if desired, a 'commit' will be
# performed on ALL devices in the 'targetSelected'
# state.
#
# PLEASE USE EXTREME CAUTION!!!
#
# Once a device pair has been commited, the data on
# the 'source' device will no longer be readily
# available.
#
# Lastly, if desired, will report when all migrations
# are complete (additional configuration required)
#
#---------------------------------------------------------------------
#
# Author Identification
#
# SRT Steven R Thellen EMC
#
#---------------------------------------------------------------------
#
# Revision History
#
# REV Who Date Comment
# --- --- ---- -------
# 000 SRT 13-JUL-2006 Initial Release
#
#---------------------------------------------------------------------
#
#############################
#
# Script-specific variables
DAT=`date +%y%m%d_%H%M%S`
Sysn=`hostname`
#
##########
#
# OUTF -> location and name of output file
OUTF="PPmigComitinfo_${DAT}.out"
#
############
#
# DO_COMMIT -> Value 0 / 1
# 0 -> (default) Do NOT perform commit, just set to
# 'targetSelected' state
# 1 -> After completing the 'selectTraget', attempt
# to perform the 'commit'
# USE EXTREME CAUTION
DO_COMMIT=0
#
############
#
# WATCHERS -> If using the 'send_email_alarm' function,
# set this variable to contain list of recipients
# Example:
# WATCHERS="user1@company.com user2@company.com"
#
WATCHERS=""
#
# ENBmail -> Value 0 / 1
# 0 = No emails will be sent using the send_email_alarm
# function
# 1 = emails will be sent using the send_email_alarm
# function
ENBmail=0
#
##########
#
# DISPLAY -> Value 0 / 1
# 0 = No additional messages or information displayed
# 1 = Additional information and OUTF file displayed
#
DISPLAY=0
#
##########################################################
#
# --> Subroutines <--
#
##########################################################
#
# FUNCTION NAME: InfoPPmig
# DESCRIPTION: Collect information about current list of jobs
# scheduled to be executed
#
# INPUTS: none
#
# OUTPUTS: <Job Handle>:<Source dev>:<Target dev>:<Current Status>
#
##########################################################
#
InfoPPmig ()
{
MigInfo=`powermig info -query -all |grep -v Source| grep -v "=" \
| awk '{ print $1":"$2":"$3":"$NF }'|grep -v "::"`
}
#
######################################################################
########
#
# FUNCTION NAME: send_email_alarm
# DESCRIPTION: send an alarm via email
#
# INPUTS: 1 - Subject of email
# 2 - who to send message to
# 3 - log file to mail
# OUTPUTS: None
#
######################################################################
########
SEA_FILE=$OUTF
SEA_TO=$WATCHER
send_email_alarm()
{
# Give passed arguments meaningful names
#SEA_SUBJECT=$1
#SEA_TO=$2
#SEA_FILE=$3
if [ "${SEA_FILE}" = "" ]; then
SEA_FILE=/dev/null
fi
# Figure out which mailer to used based on the OS_TYPE
case ${OS_TYPE} in
"Linux")
MAIL=/bin/mail
;;
"SunOS")
MAIL=/usr/ucb/mail
$MAIL -s "$SEA_SUBJECT" $SEA_TO < $SEA_FILE 1>/dev/null 2>&1
;;
"HP-UX")
MAIL=/usr/bin/elm
cat $SEA_FILE | $MAIL -s "$SEA_SUBJECT" $SEA_TO 1>/dev/null 2>&1
;;
esac
}
#
#
#######################
#
# Main
#
#######
#
# First, get the current list of setup jobs
#
InfoPPmig
for n in $MigInfo
do
# Get 'handle' and prepare to 'commit'
handle=`echo $n | awk -F: '{ print $1 }'`
if [ "${state}X" = "sourceSelectedX" ]
then
# Perform selectTarget
powermig selectTarget -hd ${handle} -noPrompt 1>>${OUTF} 2>&1
sleep 5
fi
# Perform commit
powermig commit -hd ${handle} -noPrompt 1>>${OUTF} 2>&1
else
echo "state is ${state}"
fi
#
# Send status now
if test $ENBmail -ge 1
then
send_email_alarm "Status of PPMig on ${Sysn}"
else
if test $DISPLAY -ge 1
then
cat $OUTF
fi
fi
#
# End