Re: VG mirroring
- From: Doug Freyburger <dfreybur@xxxxxxxxx>
- Date: Wed, 9 Jul 2008 17:59:17 -0700 (PDT)
pomikister <pomikis...@xxxxxxxxx> wrote:
instructions will be very appreciated.
I found my old files on a backup CD-ROM. These are the HPUX
ones that use mirroring. Note that they assume Symmetrix arrays
ahd have embedded serial numbers that will need to be changed.
hpux.directions --
Host level migration of EMC frames for HPUX.
hpux.directions - This file.
hpux.disks - Check for new provisioning.
hpux.postprov - Build final tables.
hpux.start - Build initial tables before provisioning.
hpux.vgclean - Per volume group clean-up script.
hpux.vgmove - Per volume group move script.
hpux.vgprep - Per volume group internal support script,
used by hpux.start and hpux.postprov
Before starting anything:
1) Go through the scripts and check the PATH. Especially
check where EMC's "inq" is installed.
2) Note the serial numbers of the frames involved and the names
of the frames involved. Edit all of the "inq" calls to reflect
the serial numbers and names. In the original, there are 4
frames named f8, f11, f13 and f14 referenced.
Initialize the tables by running "ksh hpux.start". It will
produce an "ioscan.$DATE.txt" for easy reference, "inq.$NAME.txt"
for each frame's LUNs, "vg.list" for the list of volume
groups, *.LVLIST for the list of logical volumes in each
vloume group, *.NEWPRILIST for the new primary devices,
*.NEWALTLIST for the new alternate paths, *.OLDPRILIST for
the old primary devices and *.OLDAALTLIST for the old alternate
paths. Also *.OLD*LIST.orig for later use.
Look at inq.*.txt to see what devices come from what frame.
Edit vg.list and remove any volume group that only has internal
devices. Delete the tables for any of those volume groups.
Edit *.OLD*LIST.orig to see if there are any new devices listed
as old.
Provision the new storage. ioscan ; insf -e
Run "ksh hpux.disks" to see the new storage. Note the devices.
By hand add the devices to each volume group.
NOTE FOR HPUX! When a volume group is created with only
single/regular LUNs, by default it can end up only taking more
single LUNs. "vgdisplay -v /dev/$VG | more" and look for the
Max PPs per PV column to check. This is the main reason
devices need to be added by hand. Only add singles to VGs
that can only handle singles. Feel free to add metas to groups
that can take metas.
It may be necessary to add only a few LUNs by hand if the number
of physical volumes hits the max. If so the later scripts can
be run a bit at a time.
After provisioning run "ksh hpux.postprov" to build the new
tables. It uses the *.OLD*LIST.orig files and hpux.vgprep, then
rebuilds *.NEW*LIST to reflect the new storage. Inspect the
*.NEW*LIST files to see if they are correct.
Loop running the move on each volume group and the clean on
each volume group.
for i in ` cat vg.list ` ; do
ksh hpux.vgmove $i
ksh hpux.vgclean $i
done
Deprovision using the numbers in inq.*.
The HPUX scripts loop through the logical volumes using
lvextend -m 1 (oldlist) (newlist) rather than looping through
the devices devices using pvmove (olddev) (newdev). When I
benchmarked the two methods on a couple of N-class hosts the
pvmove method took 8+ hours per meta, well over 10 times as
long as the mirror/unmirror method. Also the man page for
pvmove claims it conflicts with clustering.
hpux.start --
#! /bin/ksh
#
# Bootstrap by recording the devices now existing.
#
/sbin/ioscan -fn > ioscan.fn.`date +%Y-%m-%d`.txt
#
# Find all EMC devices by frame.
#
/usr/local/adm/bin/inq -sid -sortsymm | grep 1169 | sort > inq.f8.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0300 | sort > inq.f11.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0404 | sort > inq.f13.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0247 | sort > inq.f15.txt
#
# Get the list of volume groups, trim vg00.
#
vgdisplay | grep "VG Name" | grep -v vg00 | awk ' { print $3 } ' | tr
"/" " " | awk ' { print $2 } ' > vg.list
#
cat vg.list | while read i ; do
#
ksh hpux.vgprep ${i}
#
# Retain the list of old volumes beccause we will overwrite it when
# we use the same hpux.vgprep script to find the new volumes.
#
cp ${i}.OLDPRILIST ${i}.OLDPRILIST.orig
cp ${i}.OLDALTLIST ${i}.OLDALTLIST.orig
#
done
#
exit 0
hpux.disks --
#! /bin/ksh
#
# Bootstrap by recording the devices now existing.
#
/sbin/ioscan
/sbin/insf -e
#
# Find all EMC devices by frame.
#
/usr/local/adm/bin/inq -sid -sortsymm | grep 1169 | sort > inq.f8.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0300 | sort > inq.f11.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0404 | sort >
inq.f13.txt.new
/usr/local/adm/bin/inq -sid -sortsymm | grep 0247 | sort >
inq.f15.txt.new
#
echo New drives on f13
diff inq.f13.txt inq.f13.txt.new
#
echo New drives on f15
diff inq.f15.txt inq.f15.txt.new
#
exit 0
hpux.postprov --
#! /bin/ksh
#
# Bootstrap by recording the devices now existing.
#
ioscan
insf -e
/sbin/ioscan -fn > ioscan.fn.`date +%Y-%m-%d`.txt
#
# Find all EMC devices by frame. See the new ones.
#
/usr/local/adm/bin/inq -sid -sortsymm | grep 1169 | sort > inq.f8.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0300 | sort > inq.f11.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0404 | sort > inq.f13.txt
/usr/local/adm/bin/inq -sid -sortsymm | grep 0247 | sort > inq.f15.txt
#
# No need to repeatedly get the list of volume groups, trim vg00.
#
# vgdisplay | grep "VG Name" | grep -v vg00 | awk ' { print $3 } ' |
tr "/" " " | awk ' { print $2 } ' > vg.list
#
cat vg.list | while read i ; do
#
ksh hpux.vgprep ${i}
#
# Restore the list of old volumes beccause we just overwrote it.
#
cp ${i}.OLDPRILIST.orig ${i}.OLDPRILIST
cp ${i}.OLDALTLIST.orig ${i}.OLDALTLIST
comm -3 ${i}.OLDPRILIST ${i}.NEWPRILIST > wow
cat wow | sed -e 's/ //' > ${i}.NEWPRILIST
comm -3 ${i}.OLDALTLIST ${i}.NEWALTLIST > wow
cat wow | sed -e 's/ //' > ${i}.NEWALTLIST
#
done
#
exit 0
hpux.vgmove --
#! /bin/ksh
#
cat ${1}.LVLIST | while read i ; do
#
echo lvchange -s n ${i}
lvchange -s n ${i}
#
echo lvextend -m 1 ${i} ` cat ${1}.NEWPRILIST `
lvextend -m 1 ${i} ` cat ${1}.NEWPRILIST `
#
echo lvreduce -m 0 ${i} ` cat ${1}.OLDPRILIST ${1}.OLDALTLIST `
lvreduce -m 0 ${i} ` cat ${1}.OLDPRILIST ${1}.OLDALTLIST `
#
echo lvchange -s y ${i}
lvchange -s y ${i}
#
done
#
exit 0
hpux.vgclean --
#! /bin/ksh
#
cat ${1}.OLDPRILIST ${1}.OLDALTLIST | while read i ; do
#
echo vgreduce /dev/${1} ${i}
vgreduce /dev/${1} ${i}
#
done
#
exit 0
hpux.vgprep --
#! /bin/ksh
#
# Logical volumes
#
vgdisplay -v /dev/${1} | grep "LV Name" | awk ' { print $3 } ' >
${1}.LVLIST
#
# Old devices
#
vgdisplay -v /dev/${1} | grep "PV Name" | grep -v Alternate | awk
' { print $3 } ' > ${1}.OLDPRILIST
#
vgdisplay -v /dev/${1} | grep "PV Name" | grep Alternate | awk
' { print $3 } ' > ${1}.OLDALTLIST
#
# New devices
#
vgdisplay -v /dev/${1} | grep "PV Name" | grep -v Alternate | awk
' { print $3 } ' > ${1}.NEWPRILIST
#
vgdisplay -v /dev/${1} | grep "PV Name" | grep Alternate | awk
' { print $3 } ' > ${1}.NEWALTLIST
#
echo "Now edit" ${1}.NEW* ${1}.OLD* "to reflect which devices are old
and which are old."
#
exit 0
.
- References:
- VG mirroring
- From: pomikister
- VG mirroring
- Prev by Date: Re: VG mirroring
- Next by Date: Re: Available consultant Vijay for Unix System Admin with sun Solories Expireance.
- Previous by thread: Re: VG mirroring
- Next by thread: Re: VG mirroring
- Index(es):
Relevant Pages
|