How to find out the percentage of completion of an atomic copy or mirrored plex resync
Details:
Prior to VERITAS Volume Manager (VxVM) 3.x, there were no commands available to allow viewing the percentage of completion of a plex resynchronization or plex attach (atomic copy)
Below is a script that can be added to the system to enable finding out approximately what that percentage of completion is.
1) Enter the following script and name it vxpercent.sh
#!/usr/bin/ksh
vxprint $@ |
while read line; do
echo $line | read tag plex vol kstate len off state tutil putil
if [ X$tag = X"pl" -a X$tutil = X"ATT" ]; then
offset=$(vxtrace -t 1 $plex | tail -1 | cut -f9 -d" ")
percent=$(( 100 * 0$offset / $len ))
echo "$line" | sed "s/ATT /ATT $percent%\ /"
else
if [ X$tag = X"v" -a X$state = X"SYNC" ]; then
offset=$(vxprint -l $plex | grep flags | sed "s/.*offset=\([0-9][0-9]*\).*
/\1/")
percent=$(( 100 * 0$offset / $len ))
echo "$line" | sed "s/SYNC /SYNC $percent%/"
else
echo "$line"
fi
fi;
done;
2) If given no options the script will list all of the volumes.
When using the vxpercent.sh <volume name> syntax, an output similar to the following will be seen:
# vxpercent.sh testvol
Disk group: clarii0n
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
v testvol fsgen ENABLED 12582912 - ACTIVE ATT1 -
pl testvol-01 testvol ENABLED 12593568 - ACTIVE - -
sd clarii009-01 testvol-01 ENABLED 3148320 0 - - -
sd clarii010-01 testvol-01 ENABLED 3148320 0 - - -
sd clarii001-01 testvol-01 ENABLED 3148320 0 - - -
sd clarii002-01 testvol-01 ENABLED 3148320 0 - - -
pl testvol-02 testvol ENABLED 12593568 - TEMPRMSD ATT 39% -
sd clarii007-02 testvol-02 ENABLED 3148320 0 - - -
sd clarii003-02 testvol-02 ENABLED 3148320 0 - - -
sd clarii004-02 testvol-02 ENABLED 3148320 0 - - -
sd clarii005-02 testvol-02 ENABLED 3148320 0 - - -
In the above example it is shown that plex testvol-02 is 39% completed.
NOTE: In VxVM 3.x, the vxtask (1m) command provides extended information and control over resync and recovery processes.
Products Applied:
Subjects:
Volume Manager for UNIX
Application: How To
Languages:
English (US)
Operating Systems:
Solaris2.5.1, 2.6, 7.0 (32-bit)
THE INFORMATION PROVIDED IN THE VERITAS SOFTWARE KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. VERITAS SOFTWARE DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL VERITAS SOFTWARE OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES,EVEN IF VERITAS SOFTWARE OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.