分类:
2008-08-04 16:10:32
今天,研究了下VIO SERVER备份、恢复的问题。先试用了下官方推荐的backupios命令,backupios命令可以这样写:backupios -file
/ftp/`hostname`.mksysb -mksysb。但考虑到两个问题:不保留镜像信息问题;排除文件问题,感觉还是直接在root用户下用mksysb好些。
mksysb我觉得做一次就够了,因为除了IO部分VIO SERVER的内容基本是不变的。那剩下的工作就是每天把存储设备的LUN信息和lsmap信息
导出来,保存到异地就可以了。
EMC CLARiiON存储提供了inq.aix64_51命令(不安装PowerPath一样可用)可以查看存储设备的LUN信息,唯一的缺陷是LUN ID是用16进制
表示的;安装PowerPath后,也可以用powermt display dev=all命令直接看10进制的LUN ID,但RAID类型、LUN的大小是看不到的。所以个人倾
向于用inq.aix64_51命令比较好,但要略加修改才能看到10进制的LUN ID:
/usr/lpp/EMC/CLARiiON/bin/inq.aix64_51 -clariion |\
awk -F: '{if ($2 ~ /DGC/) {printf "%s %d\n",$0,"0x"$(NF-1)} else {print}}'
lsmap -all的信息导出来很简单,但如果不幸两个VIO SERVER同时坏了,要重新恢复就比较耗时间了,不如现在就把相应的chdev、mkvdev
命令反推出来,给以后的恢复工作缩短点儿时间:
su - padmin "-c ioscli lsmap -all" | \
awk '{a[$1]=$NF} $1 ~ /vhost/{vhost=$1;printf "#VHOST: %s\n#LPAR_ID: %s %d\n",$1,$NF,$NF}; \
$1=="Physloc"{if (a["Backing"] ~ /hdiskpower/) {attr="reserve_lock=no"} else {attr="reserve_policy=no_reserve"}; \
print "chdev -dev",a["Backing"],"-attr",attr,"\n" \
"mkvdev -vdev",a["Backing"],"-vadapter",vhost,"-dev",a["VTD"]}'
上面两个命令及lsmap -all的效果如下:
14:57:09 -clariion |\
> awk -F: '{if ($2 ~ /DGC/) {printf "%s %d\n",$0,"0x"$(NF-1)} else {print}}'
su - padmin "-c ioscli lsmap -all" | \
awk '{a[$1]=$NF} $1 ~ /vhost/{vhost=$1;printf "#VHOST: %s\n#LPAR_ID: %s %d\n",$1,$NF,$NF}; \
$1=="Physloc"{if (a["Backing"] ~ /hdiskpower/) {attr="reserve_lock=no"} else {attr="reserve_policy=no_reserve"}; \
Inquiry utility, Version V7.3-771 (Rev 0.0) (SIL Version V6.3.0.0 (Edit Level 771)
Copyright (C) by EMC Corporation, all rights reserved.
For help type inq -h.
print "chdev -dev",a["Backing"],"-attr",attr,"\n" \
"mkvdev -vdev",a["Backing"],"-vadapter",vhost,"-dev",a["VTD"]}'..................................
-------------------------------------------------------------------------------------------
DEVICE :VEND :PROD :REV :SER NUM :CAP(kb) :VLU :CLUN:State
-------------------------------------------------------------------------------------------
/dev/rhdisk0 :IBM H0:ST3146855LC :C808 :00037C7A : 143374000: : :
/dev/rhdisk1 :IBM H0:ST3146855LC :C808 :000621D0 : 143374000: : :
/dev/rhdisk2 :DGC :RAID 5 :0324 :5800005C : 31457280: 0: 258:ASSIGNED 600
/dev/rhdisk3 :DGC :RAID 5 :0324 :20000094 : 31457280: 1: 320:ASSIGNED 800
/dev/rhdisk4 :DGC :RAID 5 :0324 :4C000063 : 31457280: 2: 44c:ASSIGNED 1100
/dev/rhdisk5 :DGC :RAID 5 :0324 :F600004A : 268435456: 3: 1f6:ASSIGNED 502
/dev/rhdisk6 :DGC :RAID 5 :0324 :B00000BF : 31457280: 4: 4b0:ASSIGNED 1200
/dev/rhdisk7 :DGC :RAID 5 :0324 :F700005C : 52428800: 5: 1f7:ASSIGNED 503
/dev/rhdisk8 :DGC :RAID 5 :0324 :F80000B8 : 268435456: 6: 1f8:ASSIGNED 504
/dev/rhdisk9 :DGC :RAID 5 :0324 :2A00009B : 31457280: 17: 32a:ASSIGNED 810
/dev/rhdisk10 :DGC :RAID 5 :0324 :5A000044 : 31457280: 7: 25a:ASSIGNED 602
/dev/rhdisk11 :DGC :RAID 5 :0324 :5B000044 : 31457280: 8: 25b:ASSIGNED 603
/dev/rhdisk12 :DGC :RAID 5 :0324 :5C0000A3 : 52428800: a: 25c:ASSIGNED 604
/dev/rhdisk13 :DGC :RAID 5 :0324 :5D0000A4 : 268435456: b: 25d:ASSIGNED 605
/dev/rhdisk14 :DGC :RAID 5 :0324 :BD0000DD : 536870912: c: 2bd:ASSIGNED 701
/dev/rhdisk15 :DGC :RAID 5 :0324 :BE0000BE : 536870912: d: 2be:ASSIGNED 702
/dev/rhdisk16 :DGC :RAID 5 :0324 :5E0000A5 : 31457280: e: 25e:ASSIGNED 606
/dev/rhdisk17 :DGC :RAID 5 :0324 :FC00004C : 134217728: f: 1fc:ASSIGNED 508
/dev/rhdisk18 :DGC :RAID 5 :0324 :250000F8 : 31457280: 10: 325:ASSIGNED 805
/dev/rhdisk19 :DGC :RAID 5 :0324 :FD0000E8 : 31457280: 11: 1fd:ASSIGNED 509
/dev/rhdisk20 :DGC :RAID 5 :0324 :FE000055 : 31457280: 12: 1fe:ASSIGNED 510
/dev/rhdisk21 :DGC :RAID 5 :0324 :FF000073 : 31457280: 13: 1ff:ASSIGNED 511
/dev/rhdisk22 :DGC :RAID 5 :0324 :6300004A : 146800640: 9: 263:ASSIGNED 611
/dev/rhdisk23 :DGC :RAID 5 :0324 :280000DD : 31457280: 14: 328:ASSIGNED 808
/dev/rhdisk24 :DGC :RAID 5 :0324 :290000DD : 31457280: 15: 329:ASSIGNED 809
/dev/rhdisk25 :DGC :RAID 5 :0324 :2B00008E : 134217728: 16: 32b:ASSIGNED 811
/dev/rhdisk26 :DGC :RAID 5 :0324 :6200000B : 31457280: 18: 262:ASSIGNED 610
/dev/rhdisk27 :DGC :RAID 5 :0324 :6600004D : 67108864: 19: 266:ASSIGNED 614
/dev/rhdisk28 :DGC :RAID 5 :0324 :C400005D : 31457280: 1a: 2c4:ASSIGNED 708
/dev/rhdisk29 :DGC :RAID 5 :0324 :C500005D : 67108864: 1b: 2c5:ASSIGNED 709
/dev/rhdisk30 :DGC :RAID 5 :0324 :6700004F : 31457280: 1c: 267:ASSIGNED 615
/dev/rhdisk31 :DGC :RAID 5 :0324 :6800004F : 67108864: 1d: 268:ASSIGNED 616
/dev/rhdisk32 :DGC :RAID 5 :0324 :C9000040 : 31457280: 1e: 2c9:ASSIGNED 713
/dev/rhdisk33 :DGC :RAID 5 :0324 :CA0000F7 : 67108864: 1f: 2ca:ASSIGNED 714
14:57:13 - padmin "-c ioscli lsmap -all" | \
> awk '{a[$1]=$NF} $1 ~ /vhost/{vhost=$1;printf "#VHOST: %s\n#LPAR_ID: %s %d\n",$1,$NF,$NF}; \
> $1=="Physloc"{if (a["Backing"] ~ /hdiskpower/) {attr="reserve_lock=no"} else {attr="reserve_policy=no_reserve"}; \
> print "chdev -dev",a["Backing"],"-attr",attr,"\n" \
> "mkvdev -vdev",a["Backing"],"-vadapter",vhost,"-dev",a["VTD"]}'
#VHOST: vhost0
#LPAR_ID: 0x00000004 4
chdev -dev hdisk15 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk15 -vadapter vhost0 -dev dvg_nimmaster
chdev -dev hdisk2 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk2 -vadapter vhost0 -dev rvg_nimmaster
#VHOST: vhost1
#LPAR_ID: 0x00000005 5
chdev -dev hdisk12 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk12 -vadapter vhost1 -dev dvg_st-stock2
chdev -dev hdisk6 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk6 -vadapter vhost1 -dev rvg_st-stock2
chdev -dev hdisk14 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk14 -vadapter vhost1 -dev svg_st-stock
#VHOST: vhost2
#LPAR_ID: 0x00000006 6
chdev -dev hdisk5 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk5 -vadapter vhost2 -dev hd0_test
chdev -dev hdisk16 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk16 -vadapter vhost2 -dev hd2_test
chdev -dev hdisk4 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk4 -vadapter vhost2 -dev rvg_test
#VHOST: vhost3
#LPAR_ID: 0x00000008 8
chdev -dev hdisk9 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk9 -vadapter vhost3 -dev rvg_uat-ganglia
#VHOST: vhost4
#LPAR_ID: 0x00000009 9
chdev -dev hdisk10 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk10 -vadapter vhost4 -dev hd1_st-gcm
chdev -dev hdisk18 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk18 -vadapter vhost4 -dev hd4_st-gcm
chdev -dev hdisk11 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk11 -vadapter vhost4 -dev rvg_st-gcm
#VHOST: vhost5
#LPAR_ID: 0x0000000a 10
chdev -dev hdisk19 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk19 -vadapter vhost5 -dev avg_uat-stock
chdev -dev hdisk7 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk7 -vadapter vhost5 -dev dvg_uat-stock
chdev -dev hdisk3 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk3 -vadapter vhost5 -dev rvg_uat-stock
chdev -dev hdisk8 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk8 -vadapter vhost5 -dev svg_uat-stock
#VHOST: vhost6
#LPAR_ID: 0x00000000 0
chdev -dev hdisk17 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk17 -vadapter vhost6 -dev rvg_temp
#VHOST: vhost7
#LPAR_ID: 0x0000000e 14
chdev -dev hdisk21 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk21 -vadapter vhost7 -dev dvg_uat-mbfe3
chdev -dev hdisk20 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk20 -vadapter vhost7 -dev rvg_uat-mbfe3
#VHOST: vhost8
#LPAR_ID: 0x0000000d 13
chdev -dev hdisk22 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk22 -vadapter vhost8 -dev rvg_lyydb
#VHOST: vhost9
#LPAR_ID: 0x0000000b 11
chdev -dev hdisk23 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk23 -vadapter vhost9 -dev rvg_uat-wmp
#VHOST: vhost10
#LPAR_ID: 0x0000000c 12
chdev -dev hdisk25 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk25 -vadapter vhost10 -dev dvg_uat-wmdb
chdev -dev hdisk24 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk24 -vadapter vhost10 -dev rvg_uat-wmdb
#VHOST: vhost11
#LPAR_ID: 0x0000000f 15
chdev -dev hdisk27 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk27 -vadapter vhost11 -dev dvg_st-tax
chdev -dev hdisk26 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk26 -vadapter vhost11 -dev rvg_st-tax
#VHOST: vhost12
#LPAR_ID: 0x00000010 16
chdev -dev hdisk29 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk29 -vadapter vhost12 -dev dvg_uat-tax
chdev -dev hdisk28 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk28 -vadapter vhost12 -dev rvg_uat-tax
#VHOST: vhost13
#LPAR_ID: 0x00000011 17
chdev -dev hdisk31 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk31 -vadapter vhost13 -dev dvg_uat-ibp
chdev -dev hdisk30 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk30 -vadapter vhost13 -dev rvg_uat-ibp
#VHOST: vhost14
#LPAR_ID: 0x00000012 18
chdev -dev hdisk33 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk33 -vadapter vhost14 -dev dvg_st-ibp
chdev -dev hdisk32 -attr reserve_policy=no_reserve
mkvdev -vdev hdisk32 -vadapter vhost14 -dev rvg_st-ibp
14:57:18
15:03:21 -all
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0 U9116.561.0682A80-V3-C3 0x00000004
VTD dvg_nimmaster
Status Available
LUN 0x8200000000000000
Backing device hdisk15
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-LD000000000000
VTD rvg_nimmaster
Status Available
LUN 0x8100000000000000
Backing device hdisk2
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L0
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost1 U9116.561.0682A80-V3-C6 0x00000005
VTD dvg_st-stock2
Status Available
LUN 0x8300000000000000
Backing device hdisk12
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-LA000000000000
VTD rvg_st-stock2
Status Available
LUN 0x8100000000000000
Backing device hdisk6
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L4000000000000
VTD svg_st-stock
Status Available
LUN 0x8400000000000000
Backing device hdisk14
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-LC000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost2 U9116.561.0682A80-V3-C7 0x00000006
VTD hd0_test
Status Available
LUN 0x8200000000000000
Backing device hdisk5
Physloc U7879.001.DQDZVZW-P1-C5-T1-W5006016341E07DAE-L3000000000000
VTD hd2_test
Status Available
LUN 0x8300000000000000
Backing device hdisk16
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-LE000000000000
VTD rvg_test
Status Available
LUN 0x8100000000000000
Backing device hdisk4
Physloc U7879.001.DQDZVZW-P1-C5-T1-W5006016341E07DAE-L2000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3 U9116.561.0682A80-V3-C11 0x00000008
VTD rvg_uat-ganglia
Status Available
LUN 0x8100000000000000
Backing device hdisk9
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L17000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost4 U9116.561.0682A80-V3-C12 0x00000009
VTD hd1_st-gcm
Status Available
LUN 0x8200000000000000
Backing device hdisk10
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L7000000000000
VTD hd4_st-gcm
Status Available
LUN 0x8500000000000000
Backing device hdisk18
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L10000000000000
VTD rvg_st-gcm
Status Available
LUN 0x8100000000000000
Backing device hdisk11
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L8000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost5 U9116.561.0682A80-V3-C13 0x0000000a
VTD avg_uat-stock
Status Available
LUN 0x8400000000000000
Backing device hdisk19
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L11000000000000
VTD dvg_uat-stock
Status Available
LUN 0x8200000000000000
Backing device hdisk7
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L5000000000000
VTD rvg_uat-stock
Status Available
LUN 0x8100000000000000
Backing device hdisk3
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L1000000000000
VTD svg_uat-stock
Status Available
LUN 0x8300000000000000
Backing device hdisk8
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L6000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost6 U9116.561.0682A80-V3-C14 0x00000000
VTD rvg_temp
Status Available
LUN 0x8100000000000000
Backing device hdisk17
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-LF000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost7 U9116.561.0682A80-V3-C15 0x0000000e
VTD dvg_uat-mbfe3
Status Available
LUN 0x8200000000000000
Backing device hdisk21
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L13000000000000
VTD rvg_uat-mbfe3
Status Available
LUN 0x8100000000000000
Backing device hdisk20
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L12000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost8 U9116.561.0682A80-V3-C16 0x0000000d
VTD rvg_lyydb
Status Available
LUN 0x8100000000000000
Backing device hdisk22
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L9000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost9 U9116.561.0682A80-V3-C17 0x0000000b
VTD rvg_uat-wmp
Status Available
LUN 0x8100000000000000
Backing device hdisk23
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L14000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost10 U9116.561.0682A80-V3-C18 0x0000000c
VTD dvg_uat-wmdb
Status Available
LUN 0x8200000000000000
Backing device hdisk25
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L16000000000000
VTD rvg_uat-wmdb
Status Available
LUN 0x8100000000000000
Backing device hdisk24
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L15000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost11 U9116.561.0682A80-V3-C19 0x0000000f
VTD dvg_st-tax
Status Available
LUN 0x8200000000000000
Backing device hdisk27
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L19000000000000
VTD rvg_st-tax
Status Available
LUN 0x8100000000000000
Backing device hdisk26
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L18000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost12 U9116.561.0682A80-V3-C20 0x00000010
VTD dvg_uat-tax
Status Available
LUN 0x8200000000000000
Backing device hdisk29
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L1B000000000000
VTD rvg_uat-tax
Status Available
LUN 0x8100000000000000
Backing device hdisk28
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L1A000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost13 U9116.561.0682A80-V3-C23 0x00000011
VTD dvg_uat-ibp
Status Available
LUN 0x8200000000000000
Backing device hdisk31
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L1D000000000000
VTD rvg_uat-ibp
Status Available
LUN 0x8100000000000000
Backing device hdisk30
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016941E07DAE-L1C000000000000
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost14 U9116.561.0682A80-V3-C24 0x00000012
VTD dvg_st-ibp
Status Available
LUN 0x8200000000000000
Backing device hdisk33
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L1F000000000000
VTD rvg_st-ibp
Status Available
LUN 0x8100000000000000
Backing device hdisk32
Physloc U7879.001.DQDZVZW-P1-C4-T1-W5006016141E07DAE-L1E000000000000
15:03:30
========================================================================
任何形式的转载,请写明出处:
email:
blog: http://www.cublog.cn/u/739/
========================================================================
chinaunix网友2008-08-07 16:00:50
我猜用navicli的前提是要安装agent在