今天的虚拟带库的实验是vistor 又实验了一把lan-free:
在http://192.168.1.141:5050里run start
就会看到下面的:
[root@new-host-37 vistor]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: QUANTUM Model: Scalar i500 Rev: 1.00
Type: Medium Changer ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 01 Lun: 00
Vendor: IBM Model: ULT3580-TD Rev: 1.00
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 02 Lun: 00
Vendor: IBM Model: ULT3580-TD Rev: 1.00
Type: Sequential-Access ANSI SCSI revision: 03
下面让tsm 去找一下机械臂:
cd /opt/tivoli/tsm/devices/bin
[root@new-host-37 bin]# ./autoconf
Tivoli Medium Changer Devices:
==============================
Index Minor Host CHN ID LUN Type Vendor_ID Device_Serial_Number Product_ID Rev.
000 001 001 000 000 000 008 QUANTUM 042c03040 Scalar i500 1.00
[root@new-host-37 dev]# ls -l tsmscsi/
total 4
lrwxrwxrwx 1 root root 8 May 16 04:03 lb0 -> /dev/sg1
-rw-r--r-- 1 root root 175 May 16 04:03 lbinfo
后来发现以上只有机械臂,没有驱动器,还是选其他的驱动吧:
http://192.168.1.141:5050 上操作。
默认的是drive 2个,现在在console界面上改成4个,reset ,commit change 后:
/opt/tivoli/tsm/devices/bin
[root@new-host-37 bin]# ./autoconf
Tivoli Tape Drives:
===================
Index Minor Host CHN ID LUN Type Vendor_ID Device_Serial_Number Product_ID Rev.
000 002 001 000 001 000 001 HP 032d4f361 Ultrium 1-SCSI 1.00
001 003 001 000 002 000 001 HP 032d4f362 Ultrium 1-SCSI 1.00
002 004 001 000 003 000 001 HP 032d4f363 Ultrium 1-SCSI 1.00
003 005 001 000 004 000 001 HP 032d4f364 Ultrium 1-SCSI 1.00
Tivoli Medium Changer Devices:
==============================
Index Minor Host CHN ID LUN Type Vendor_ID Device_Serial_Number Product_ID Rev.
000 001 001 000 000 000 008 QUANTUM 032d4f360 Scalar i500 1.00
[root@new-host-37 tsmscsi]# ls -lrt
total 8
lrwxrwxrwx 1 root root 8 May 16 05:09 lb0 -> /dev/sg1
-rw-r--r-- 1 root root 175 May 16 05:09 lbinfo
lrwxrwxrwx 1 root root 8 May 16 05:09 mt0 -> /dev/sg2
lrwxrwxrwx 1 root root 8 May 16 05:09 mt1 -> /dev/sg3
lrwxrwxrwx 1 root root 8 May 16 05:09 mt2 -> /dev/sg4
-rw-r--r-- 1 root root 436 May 16 05:09 mtinfo
lrwxrwxrwx 1 root root 8 May 16 05:09 mt3 -> /dev/sg5
机械臂:lb0 有了, 驱动: mt0,mt1,mt2,mt3一共是4个驱动器都有了。
非常好,下面开始我的tsm 之行:
-----------------------以下是 我原来用ibm 带库的配置的,linux 认不到,后来改用hp 的带库成功--------------
下面开始定义磁带库,带库设备驱动(server 到lirbary path),检查带库配置;
TSM:TSM_SVR1>define path TSM_SVR1 VTL01 SRCTYPE=SERVER DESTTYPE=library device=/dev/tsmscsi/lb0 online=yes
定义path 的作用是找到那个机械臂:“device=/dev/tsmscsi/lb0”
用q path, q libary 都是原来定义的。
后来换hp带库了,得 把原来的path, lib 都要删掉:
tsm: TSM_SVR1>q path
Source Name Source Type Destination Destination On-Line
Name Type
----------- ----------- ----------- ----------- -------
TSM_SVR1 SERVER VTL01 LIBRARY Yes
tsm: TSM_SVR1>delete path TSM_SVR1 VTL01 srctype=server desttype=library
ANR1721I A path from TSM_SVR1 to VTL01 has been deleted.
tsm: TSM_SVR1>Q PATH
ANR2034E QUERY PATH: No match found using this criteria.
ANS8001I Return code 11.
如果原来的lib 不删掉,建的时候要报错:
tsm: TSM_SVR1>define path tsm_svr1 vtl01 srctype=server desttype=library device=/dev/tsmscsi/lb0 online=yes
Session established with server TSM_SVR1: Linux/i386
Server Version 5, Release 5, Level 1.0
Server date/time: 05/16/2008 06:03:30 Last access: 05/16/2008 05:15:52
ANR8957E DEFINE PATH: Autodetect is OFF and the serial number reported by the library did not match the
serial number in the library definition.
ANS8001I Return code 15.
-------------------
下面还是delete vtl01;
TSM;> help delete library
tsm: TSM_SVR1>delete library vtl01
ANR8411E DELETE LIBRARY: One or more drives are still defined in library VTL01.
ANS8001I Return code 13.
发现vtl01 上有 drive ,下面把他删掉:
如果不知道delete 的命令,可以help delete drive,很详细啊。
tsm: TSM_SVR1>delete drive vtl01 drv1
ANR8412I Drive DRV1 deleted from library VTL01.
tsm: TSM_SVR1>delete drive vtl01 drv2
ANR8412I Drive DRV2 deleted from library VTL01.
看一下,drive 发现没有了:
tsm: TSM_SVR1>q drive
ANR2034E QUERY DRIVE: No match found using this criteria.
ANS8001I Return code 11.
tsm: TSM_SVR1>delete library vtl01
ANR8410I Library VTL01 deleted.
------------------------------------
下面重新开始建library:
tsm: TSM_SVR1>define library vtl01 libtype=SCSI
tsm: TSM_SVR1>define library vtl01 libtype=SCSI
tsm: TSM_SVR1>define path tsm_svr1 vtl01 srctype=server desttype=library device=/dev/tsmscsi/lb0 online=yes
tsm: TSM_SVR1>show slots vtl01
就可以看到带库分配的情况了。
定义驱动器:
tsm: TSM_SVR1>define drive vtl01 drv1 element=2051 online=yes
tsm: TSM_SVR1>define drive vtl01 drv2 element=2052 online=yes
tsm: TSM_SVR1>define drive vtl01 drv3 element=2053 online=yes
tsm: TSM_SVR1>define drive vtl01 drv4 element=2054 online=yes
定义驱动器的path:
tsm: TSM_SVR1>define path tsm_svr1 drv1 srctype=server desttype=drive library=vtl01 device=/dev/tsmscsi/mt0
tsm: TSM_SVR1>define path tsm_svr1 drv2 srctype=server desttype=drive library=vtl01 device=/dev/tsmscsi/mt1
tsm: TSM_SVR1>define path tsm_svr1 drv3 srctype=server desttype=drive library=vtl01 device=/dev/tsmscsi/mt2
tsm: TSM_SVR1>define path tsm_svr1 drv4 srctype=server desttype=drive library=vtl01 device=/dev/tsmscsi/mt3
-------------
下面放入磁带:
tsm: TSM_SVR1>label libvolume vtl01 search=yes labels=barcode checkin=scratch overwrite=yes
ANS8003I Process number 2 started.
tsm: TSM_SVR1>q libv
Library Name Volume Name Status Owner Last Use Home Device
Element Type
------------ ----------- ---------------- ---------- --------- ------- ------
VTL01 CO0001 Scratch 1
VTL01 CO0002 Scratch 2
VTL01 CO0003 Scratch 3
VTL01 CO0004 Scratch 4
VTL01 CO0005 Scratch 5
---------------
定义设备类:
tsm: TSM_SVR1>define devclass lto2 devtype=lto format=ULTRIUM2C ESTCAPACITY=1G LIBRARY=VTL01
定义存储池:
tsm: TSM_SVR1>DEFINE STGPOOL BA_TAPE_POOL LTo2 MAXSCR=2 DESC="Tape Pool for backup"
tsm: TSM_SVR1>DEFINE STGPOOL AR_TAPE_POOL LTo2 MAXSCR=2 DESC="Tape Pool for archive"
tsm: TSM_SVR1>q stgp
Storage Device Estimated Pct Pct High Low Next Stora-
Pool Name Class Name Capacity Util Migr Mig Mig ge Pool
Pct Pct
----------- ---------- ---------- ----- ----- ---- --- -----------
ARCHIVEPOOL DISK 5.0 M 0.0 0.0 90 70
AR_TAPE_PO- LTO2 0.0 M 0.0 0.0 90 70
OL
BACKUPPOOL DISK 10.0 M 0.0 0.0 90 70
BA_TAPE_PO- LTO2 0.0 M 0.0 0.0 90 70
OL
SPACEMGPOOL DISK 0.0 M 0.0 0.0 90 70
-------------
下面第一domain:
tsm: TSM_SVR1>define domain do_vtl desc="Domain for VTL library"
定义一个新的policyset:
tsm: TSM_SVR1>define policyset do_vtl ps_vtl desc="Policy set for the DO_VTL domain"
定义一个管理策略:
tsm: TSM_SVR1>define mgmtclass do_vtl ps_vtl mc_vtl desc="Management Class for DO_vtl domain"
分配默认的管理类:
tsm: TSM_SVR1>assign defmgmtclass do_vtl ps_vtl mc_vtl
定义新的copygroup:
tsm: TSM_SVR1>define copygroup do_vtl ps_vtl mc_vtl standard type=backup dest=ba_tape_pool verexists=3 retextra=120
tsm: TSM_SVR1>define copygroup do_vtl ps_vtl mc_vtl standard type=archive dest=ar_tape_pool retver=365
----------------
验证新定义的管理策略:
tsm: TSM_SVR1>validate policyset do_vtl ps_vtl
激活管理策略:
tsm: TSM_SVR1>activate policyset do_vtl ps_vtl
Do you wish to proceed? (Yes (Y)/No (N)) Y
ANR1514I Policy set PS_VTL activated in policy domain DO_VTL.
--------------------
上面的策略陪玩了,下面说说磁带:
下面将磁带放到存储池:
tsm: TSM_SVR1>define volume ba_tape_pool CO0001
tsm: TSM_SVR1>define volume ba_tape_pool CO0002
tsm: TSM_SVR1>q v
Volume Name Storage Device Estimated Pct Volume
Pool Name Class Name Capacity Util Status
------------------------ ----------- ---------- --------- ----- --------
/opt/tivoli/tsm/server/- ARCHIVEPOOL DISK 5.0 M 0.0 On-Line
bin/archive.dsm
/opt/tivoli/tsm/server/- BACKUPPOOL DISK 10.0 M 0.0 On-Line
bin/backup.dsm
CO0001 BA_TAPE_PO- LTO2 0.0 M 0.0 Empty
OL
CO0002 BA_TAPE_PO- LTO2 0.0 M 0.0 Empty
OL
磁带放进去了,下面要开始rman 和备份了。