How to mount 3PAR Virtual Copy onto RHEL Servers
By Dusan Baljevic ([email protected])
This was done as part of labs Dusan Baljevic prepared for training course 3PAR SAN. Testing Virtual Copy export to RHEL 5.x server…
A. On Linux server check the WWNs:
# cat /etc/redhat-releaseRed Hat Enterprise Linux Server release 5.4 (Tikanga)
# cat /sys/class/fc_host/host*/port_name0x50014380167d7e940x50014380167d7e96
B. Go to 3PAR MC or CLI and create host definition for Linux server,based on the WWNs above…
C. Then, within 3PAR MC or CLI export some VVs to Linux server. InThis case, two volumes were exported: one fully provisioned, and onethin provisioned.
D. Go to Linux server and check the new disks:
# hp_rescan -aRescanning /sys/class/scsi_host/host0Rescanning /sys/class/scsi_host/host1
# multipath -lmpath1 (360002ac0000000000000000700002894) dm-3 3PARdata,VV[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=0][active]\_ 0:0:0:1 sdb 8:16 [active][undef]\_ 0:0:1:1 sdd 8:48 [active][undef]mpath0 (360002ac0000000000000000f00002894) dm-2 3PARdata,VV[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=0][active]\_ 0:0:0:0 sda 8:0 [active][undef]\_ 0:0:1:0 sdc 8:32 [active][undef]
# pvscan PV /dev/cciss/c0d0p2 VG VolGroup00 lvm2 [136.56 GB / 0 free] Total: 1 [136.56 GB] / in use: 1 [136.56 GB] / in no VG: 0 [0 ]
# pvcreate /dev/mapper/mpath0 Physical volume "/dev/mapper/mpath0" successfully created# pvcreate /dev/mapper/mpath1
Physical volume "/dev/mapper/mpath1" successfully created
# pvscan PV /dev/cciss/c0d0p2 VG VolGroup00 lvm2 [136.56 GB / 0 free] PV /dev/dm-2 lvm2 [2.00 GB] PV /dev/dm-3 lvm2 [2.00 GB] Total: 3 [140.56 GB] / in use: 1 [136.56 GB] / in no VG: 2 [4.00 GB]
# vgcreate vg3par00 /dev/mapper/mpath0 Volume group "vg3par00" successfully created
# vgcreate vg3par01 /dev/mapper/mpath1 Volume group "vg3par01" successfully created
# vgscan Reading all physical volumes. This may take a while... Found volume group "vg3par01" using metadata type lvm2 Found volume group "vg3par00" using metadata type lvm2 Found volume group "VolGroup00" using metadata type lvm2
# lvcreate -l 500 -n lv3par00 vg3par00 Logical volume "lv3par00" created
# lvcreate -l 500 -n lv3par01 vg3par01 Logical volume "lv3par01" created
# mkfs.ext3 -j /dev/vg3par00/lv3par00mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)256000 inodes, 512000 blocks25600 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=52428800016 block groups32768 blocks per group, 32768 fragments per group16000 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912
Writing inode tables: doneCreating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
# mkfs.ext3 -j /dev/vg3par01/lv3par01
mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)256000 inodes, 512000 blocks25600 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=52428800016 block groups32768 blocks per group, 32768 fragments per group16000 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912
Writing inode tables: doneCreating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
# mkdir /3parlv0
# mkdir /3parlv1
# cat /etc/fstab/dev/VolGroup00/LogVol00 / ext3 defaults 1 1LABEL=/boot /boot ext3 defaults 1 2tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devpts gid=5,mode=620 0 0sysfs /sys sysfs defaults 0 0proc /proc proc defaults 0 0/dev/VolGroup00/LogVol01 swap swap defaults 0 0/dev/vg3par00/lv3par00 /3parlv0 ext3 defaults 0 0/dev/vg3par01/lv3par01 /3parlv1 ext3 defaults 0 0
# mount -a
E. Go to 3PAR MC or CLI and create a Virtual Copy of one of the VVs exported to Linux server:
inserv034 cli% showvv ---Rsvd(MB)---- -(MB)-Id Name Prov Type CopyOf BsId Rd -Detailed_State- Adm Snp Usr VSize1 .srdata full base --- 1 RW normal 0 0 61440 614400 admin full base --- 0 RW normal 0 0 10240 1024021 tariq-test01-FC tpvv base --- 21 RW normal 128 512 512 409622 tariq-test02-fc.0 tpvv base --- 22 RW normal 128 512 512 102423 tariq-test02-fc.1 tpvv base --- 23 RW normal 128 512 512 102424 tariq-test02-fc.2 tpvv base --- 24 RW normal 128 512 512 102425 tariq-test02-fc.3 tpvv base --- 25 RW normal 128 512 512 102426 tariq-test02-fc.4 tpvv base --- 26 RW normal 128 512 512 10243 TL_1_2G_Thick cpvv base --- 3 RW normal 128 512 2048 204828 TL_1_2G_Thick_VC snp vcopy TL_1_2G_Thick 3 RW normal -- -- -- 2048
2 TL_1_4GB_TP tpvv base --- 2 RW normal 128 512 512 40967 TL_2_2G_Thick cpvv base --- 7 RW normal 128 512 2048 204831 Dusan-VC0 snp vcopy TL_2_2G_Thick 7 RW normal -- -- -- 20484 TL_2_4GB_TP tpvv base --- 4 RW normal 128 512 512 40968 TL_3_2G_Thick_namechange cpvv base --- 8 RW normal 128 512 3072 30729 TL_4_2G_Thick cpvv base --- 9 RW normal 128 512 2048 20486 TL_4_4GB_TP tpvv base --- 6 RW normal 128 512 512 409610 TL_TPVV_1GB_1.0 tpvv base --- 10 RW normal 128 512 512 102411 TL_TPVV_1GB_1.1 tpvv base --- 11 RW normal 128 512 512 102412 TL_TPVV_1GB_1.2 tpvv base --- 12 RW normal 128 512 512 102413 TL_TPVV_1GB_1.3 tpvv base --- 13 RW normal 128 512 512 102414 TL_TPVV_1GB_1.4 tpvv base --- 14 RW normal 128 512 512 102415 TL_TPVV_2GB_Template tpvv base --- 15 RW normal 128 512 512 204816 TL_VV_CLI_4GB full base --- 16 RW normal 0 0 4096 409618 TL_VV_Multi_1.0 full base --- 18 RW normal 0 0 1024 102419 TL_VV_Multi_1.1 full base --- 19 RW normal 0 0 1024 102420 TL_VV_Multi_1.2 full base --- 20 RW normal 0 0 1024 1024----------------------------------------------------------------------------------------------------27 total 2432 9728 95744 120832
Then… export Virtual Copy Dusan-VC0 to Linux host:
inserv034 cli% showvlunActive VLUNsLunVVName HostName -Host_WWN/iSCSI_Name- Port Type Status ID 0 TL_TPVV_2GB_Template linux 50014380167D7E94 0:2:3 host active 0 1 TL_2_2G_Thick linux 50014380167D7E94 0:2:3 host active 0 2 Dusan-VC0 linux 50014380167D7E94 0:2:3 host active 0
0 TL_TPVV_2GB_Template linux 50014380167D7E94 1:2:3 host active 0 1 TL_2_2G_Thick linux 50014380167D7E94 1:2:3 host active 0 2 Dusan-VC0 linux 50014380167D7E94 1:2:3 host active 0 0 tariq-test01-FC tariq-windows-host1 5001438003B0B394 0:2:3 host active 0 0 tariq-test01-FC tariq-windows-host1 5001438003B0B396 0:2:4 host active 0 0 tariq-test01-FC tariq-windows-host1 5001438003B0B394 1:2:3 host active 0 0 tariq-test01-FC tariq-windows-host1 5001438003B0B396 1:2:4 host active 0 0 TL_1_4GB_TP Windows_HostB 5001438003B0B390 0:2:3 host active 0 2 TL_4_4GB_TP Windows_HostB 5001438003B0B390 0:2:3 host active 0 3 TL_2_4GB_TP Windows_HostB 5001438003B0B390 0:2:3 host active 0 0 TL_1_4GB_TP Windows_HostB 5001438003B0B392 0:2:4 host active 0 2 TL_4_4GB_TP Windows_HostB 5001438003B0B392 0:2:4 host active 0 3 TL_2_4GB_TP Windows_HostB 5001438003B0B392 0:2:4 host active 0 0 TL_1_4GB_TP Windows_HostB 5001438003B0B390 1:2:3 host active 0 2 TL_4_4GB_TP Windows_HostB 5001438003B0B390 1:2:3 host active 0 3 TL_2_4GB_TP Windows_HostB 5001438003B0B390 1:2:3 host active 0 0 TL_1_4GB_TP Windows_HostB 5001438003B0B392 1:2:4 host active 0 2 TL_4_4GB_TP Windows_HostB 5001438003B0B392 1:2:4 host active 0 3 TL_2_4GB_TP Windows_HostB 5001438003B0B392 1:2:4 host active 0---------------------------------------------------------------------------------------22 total
VLUN TemplatesLunVVName HostName -Host_WWN/iSCSI_Name- Port Type 0 TL_TPVV_2GB_Template linux ---------------- --- host 1 TL_2_2G_Thick linux ---------------- --- host 2 Dusan-VC0 linux ---------------- --- host
0 tariq-test01-FC tariq-windows-host1 ---------------- --- host 0 TL_1_4GB_TP Windows_HostB ---------------- --- host 2 TL_4_4GB_TP Windows_HostB ---------------- --- host 3 TL_2_4GB_TP Windows_HostB ---------------- --- host---------------------------------------------------------------------------- 7 total
F. On Linux server:
# hp_rescan –a
# multipath -lmpath2 (360002ac0000000000000001f00002894) dm-6 3PARdata,VV[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=0][active]\_ 0:0:0:2 sde 8:64 [active][undef]\_ 0:0:1:2 sdf 8:80 [active][undef]mpath1 (360002ac0000000000000000700002894) dm-3 3PARdata,VV[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=0][active]\_ 0:0:0:1 sdb 8:16 [active][undef]\_ 0:0:1:1 sdd 8:48 [active][undef]mpath0 (360002ac0000000000000000f00002894) dm-2 3PARdata,VV[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=0][active]\_ 0:0:0:0 sda 8:0 [active][undef]\_ 0:0:1:0 sdc 8:32 [active][undef]
# vgscan Reading all physical volumes. This may take a while... Found duplicate PV sPqCNKe7AQY38Jb2xiXHqPJVJcXMhhif: using /dev/dm-6 not /dev/dm-3 Found volume group "vg3par01" using metadata type lvm2 Found volume group "vg3par00" using metadata type lvm2 Found volume group "VolGroup00" using metadata type lvm2
# pvscan Found duplicate PV sPqCNKe7AQY38Jb2xiXHqPJVJcXMhhif: using /dev/dm-6 not /dev/dm-3 PV /dev/dm-6 VG vg3par01 lvm2 [2.00 GB / 44.00 MB free] PV /dev/dm-2 VG vg3par00 lvm2 [2.00 GB / 44.00 MB free] PV /dev/cciss/c0d0p2 VG VolGroup00 lvm2 [136.56 GB / 0 free] Total: 3 [140.55 GB] / in use: 3 [140.55 GB] / in no VG: 0 [0 ]
# lvscan Found duplicate PV sPqCNKe7AQY38Jb2xiXHqPJVJcXMhhif: using /dev/dm-6 not /dev/dm-3 ACTIVE '/dev/vg3par01/lv3par01' [1.95 GB] inherit ACTIVE '/dev/vg3par00/lv3par00' [1.95 GB] inherit ACTIVE '/dev/VolGroup00/LogVol00' [118.94 GB] inherit ACTIVE '/dev/VolGroup00/LogVol01' [17.62 GB] inherit
# vgimportclone --basevgname vg3par00-snap /dev/dm-3 WARNING: Activation disabled. No device-mapper interaction will be attempted. Physical volume "/tmp/snap.STU18061/vgimport0" changed 1 physical volume changed / 0 physical volumes not changed WARNING: Activation disabled. No device-mapper interaction will be attempted. Volume group "vg3par01" successfully changed Volume group "vg3par01" successfully renamed to "vg3par00-snap" Reading all physical volumes. This may take a while... Found volume group "vg3par01" using metadata type lvm2 Found volume group "vg3par00-snap" using metadata type lvm2 Found volume group "vg3par00" using metadata type lvm2 Found volume group "VolGroup00" using metadata type lvm2
# vgchange -a y vg3par00-snap 1 logical volume(s) in volume group "vg3par00-snap" now active
# cat /etc/fstab/dev/VolGroup00/LogVol00 /dev/VolGroup00/LogVol00 / ext3 defaults 1 1LABEL=/boot /boot ext3 defaults 1 2tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devpts gid=5,mode=620 0 0sysfs /sys sysfs defaults 0 0proc /proc proc defaults 0 0/dev/VolGroup00/LogVol01 swap swap defaults 0 0/dev/vg3par00/lv3par00 /3parlv0 ext3 defaults 0 0/dev/vg3par01/lv3par01 /3parlv1 ext3 defaults 0 0/dev/vg3par00-snap/lv3par01 /3parlv0-vc ext3 defaults 0 0
# mkdir /3parlv0-vc
# mount –a
# dfFilesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/VolGroup00-LogVol00 120807460 3843856 110727856 4% //dev/cciss/c0d0p1 101086 16833 79034 18% /boottmpfs 8219324 0 8219324 0% /dev/shm/dev/mapper/vg3par01-lv3par01 2015824 35808 1877616 2% /3parlv1/dev/mapper/vg3par00-lv3par00 2015824 35808 1877616 2% /3parlv0/dev/mapper/vg3par00--snap-lv3par01 2015824 35808 1877616 2% /3parlv0-vc