How to mount 3PAR Virtual Copy onto RHEL Servers

By Dusan Baljevic ()

This was done as part of HP Edu labs as proof of concept that I preparedfor 3PAR course. Testing Virtual Copy export to RHEL 5.x server with LVM… The most crucial command was vgimportcloneon RHEL server…

A. On Linux server check the WWNs:

# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

# cat /sys/class/fc_host/host*/port_name

0x50014380167d7e94

0x50014380167d7e96

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. In

This case, two volumes were exported: one fully provisioned, and one

thin provisioned.

D. Go to Linux server and check the new disks:

# hp_rescan -a

Rescanning /sys/class/scsi_host/host0

Rescanning /sys/class/scsi_host/host1

# multipath -l

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]

# pvscan

PV /dev/cciss/c0d0p2 VG VolGroup00 lvm2 [136.56 GB / 0free]

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/lv3par00

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

256000 inodes, 512000 blocks

25600 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=524288000

16 block groups

32768 blocks per group, 32768 fragments per group

16000 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or

180 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: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

256000 inodes, 512000 blocks

25600 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=524288000

16 block groups

32768 blocks per group, 32768 fragments per group

16000 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

# mkdir /3parlv0

# mkdir /3parlv1

# cat /etc/fstab

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

tmpfs/dev/shm tmpfs defaults 0 0

devpts /dev/pts devpts gid=5,mode=620 0 0

sysfs /sys sysfs defaults 0 0

proc /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

# df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

120807460 3843816 110727896 4% /

/dev/cciss/c0d0p1 101086 16833 79034 18% /boot

tmpfs 8219324 0 8219324 0% /dev/shm

/dev/mapper/vg3par01-lv3par01

2015824 35808 1877616 2% /3parlv1

/dev/mapper/vg3par00-lv3par00

2015824 35808 1877616 2% /3parlv0

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 VSize

1 .srdata full base --- 1 RW normal 0 0 61440 61440

0 admin full base --- 0 RW normal 0 0 10240 10240

21 tariq-test01-FC tpvv base --- 21 RW normal 128 512 512 4096

22 tariq-test02-fc.0 tpvv base --- 22 RW normal 128 512 512 1024

23 tariq-test02-fc.1 tpvv base --- 23 RW normal 128 512 512 1024

24 tariq-test02-fc.2 tpvv base --- 24 RW normal 128 512 512 1024

25 tariq-test02-fc.3 tpvv base --- 25 RW normal 128 512 512 1024

26 tariq-test02-fc.4 tpvv base --- 26 RW normal 128 512 512 1024

3 TL_1_2G_Thick cpvv base --- 3 RW normal128 512 2048 2048

28 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 4096

7 TL_2_2G_Thickcpvv base --- 7 RW normal 128 512 2048 2048

31 Dusan-VC0 snp vcopy TL_2_2G_Thick 7 RW normal ------2048

4 TL_2_4GB_TP tpvv base --- 4 RW normal 128 512 512 4096

8 TL_3_2G_Thick_namechange cpvv base --- 8 RW normal 128 512 3072 3072

9 TL_4_2G_Thick cpvv base --- 9 RW normal 128 512 2048 2048

6 TL_4_4GB_TP tpvv base --- 6 RW normal 128 512 512 4096

10 TL_TPVV_1GB_1.0 tpvv base --- 10 RW normal 128 512 512 1024

11 TL_TPVV_1GB_1.1 tpvv base --- 11 RW normal 128 512512 1024

12 TL_TPVV_1GB_1.2 tpvv base --- 12 RW normal 128 512 512 1024

13 TL_TPVV_1GB_1.3 tpvv base --- 13 RW normal 128 512 512 1024

14 TL_TPVV_1GB_1.4 tpvv base --- 14 RW normal 128 512 512 1024

15 TL_TPVV_2GB_Template tpvv base --- 15 RW normal 128 512 512 2048

16 TL_VV_CLI_4GB full base --- 16 RW normal 0 0 4096 4096

18 TL_VV_Multi_1.0 full base --- 18 RW normal 0 0 1024 1024

19 TL_VV_Multi_1.1 full base --- 19 RW normal 0 0 1024 1024

20 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% showvlun

Active VLUNs

LunVVName 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 5001438003B0B3940: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_TPWindows_HostB 5001438003B0B392 1:2:4 host active 0

------

22 total

VLUN Templates

LunVVName 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 -l

mpath2 (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 / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

tmpfs /dev/shm tmpfs defaults 0 0

devpts /dev/pts devpts gid=5,mode=620 0 0

sysfs /sys sysfs defaults 0 0

proc /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 ext3defaults 0 0

/dev/vg3par00-snap/lv3par01 /3parlv0-vc ext3 defaults 0 0

# mkdir /3parlv0-vc

# mount –a

# df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

120807460 3843856 110727856 4% /

/dev/cciss/c0d0p1 101086 16833 79034 18% /boot

tmpfs 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