Wise people learn when they can; fools learn when they must - Arthur Wellesley

Wednesday, 24 September 2014

Veritas Volume Manager -3

                     
                                     

                                                            VXVM-3 (Dg)

What we will learn in Next Few Pages,

·         Know the Size of Dg with different layouts
·         Vxvm Dg Info
·         Vxvm Disk Info
·         Deport / Import Dg
·         Rename the Disk Group
·         Moving Disk Group


How to know that what is the size of DG,


root@pr-01:>/# vxassist -g test-dg1 maxsize
Maximum volume size: 7778304 (3798Mb)


root@pr-01:>/# vxdg init testdg2 cds=off test-disk3=c2t3d0s2



root@pr-01:>/# vxdg -g testdg2 adddisk test-disk4=c2t4d0s2


root@pr-01:>/# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       -            -            online invalid
c2t2d0s2     auto:sliced     test-disk2   test-dg1     online
c2t3d0s2     auto:sliced     test-disk3   testdg2      online
c2t4d0s2     auto:sliced     test-disk4   testdg2      online
c2t5d0s2     auto:sliced     -            -            online

Let’s explore some more…

Now we have 2 DG’s… and I want to know that how much size I will get if I create a mirror or striped volume,

root@pr-01:>/# vxassist -g testdg2 maxsize
Maximum volume size: 3780608 (1846Mb)


root@pr-01:>/# vxassist -g testdg2 maxsize layout=striped
Maximum volume size: 3780608 (1846Mb)


root@pr-01:>/# vxassist -g testdg2 maxsize layout=mirror
Maximum volume size: 1890304 (923Mb)

Have some info about Dg’s

root@pr-01:>/# vxdg list
NAME         STATE           ID
test-dg1     enabled              1411453154.22.pr-01
testdg2      enabled              1411456168.28.pr-01

Detailed info about dg

root@pr-01:>/# vxdg list testdg2
Group:     testdg2
dgid:      1411456168.28.pr-01
import-id: 1024.27
flags:
version:   180
alignment: 8192 (bytes)
ssb:            on
autotagging:    on
detach-policy: global
dg-fail-policy: obsolete
ioship: off
copies:    nconfig=default nlog=default
config:    seqno=0.1032 permlen=49666 free=49662 templen=2 loglen=7525
config disk c2t3d0s2 copy 1 len=49666 state=clean online
config disk c2t4d0s2 copy 1 len=49666 state=clean online
log disk c2t3d0s2 copy 1 len=7525
log disk c2t4d0s2 copy 1 len=7525


Info about disk used,

root@pr-01:>/# vxdisk -s list        [will give info about all used disks]

root@pr-01:>/# vxdisk -s list c2t2d0s2       [for particular disk] 
Disk:   c2t2d0s2
type:   auto
flags:  online ready private autoconfig autoimport imported
guid:   -
udid:   OPNFILER%5FVIRTUAL-DISK%5FDISKS%5FOPNFILERQ4DTzv-Gk32-rhgx
site:    -
diskid: 1411381730.12.pr-01
dgname: test-dg1
dgid:   1411453154.22.pr-01
hostid: pr-01
info:   format=sliced,privoffset=4,pubslice=4,privslice=3


DEPORT / IMPORT Dg,

Deporting will disable all the access to the Dg that is currently imported by the system. It is required when disks are to be moved from one system to other,

Steps:
1.  Stop all activities by apps to volume that are configured in the Dg
2.  Unmounts the file system
3.  Stop the volume in Dg
4.  Vxdiskadm (option 9)


root@pr-01:>/# vxvol -g testdg2 stopall

root@pr-01:>/# vxdg deport testdg2

OK… no error… means the Dg has been deported, but where it gone ?

root@pr-01:>/# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       -            -            online invalid
c2t2d0s2     auto:sliced     test-disk2   test-dg1     online
c2t3d0s2     auto:sliced     -            (testdg2)    online
c2t4d0s2     auto:sliced     -            (testdg2)    online
c2t5d0s2     auto:sliced     -            -            online


See the GROUP section in which the Dg name in Bracket,

IMPORT

Importing means again system has control over that Dg,

Ensure that the Disks in the deported Dg are Online

root@pr-01:>/# vxdisk -s list c2t3d0s2

root@pr-01:>/# vxdisk -s list c2t4d0s2


root@pr-01:>/# vxdg import testdg2

root@pr-01:>/# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       -            -            online invalid
c2t2d0s2     auto:sliced     test-disk2   test-dg1     online
c2t3d0s2     auto:sliced     test-disk3   testdg2      online
c2t4d0s2     auto:sliced     test-disk4   testdg2      online
c2t5d0s2     auto:sliced     -            -            online

Sometimes we may need to use –C flag to import Dg to clear a vcs lock

#vxdg –C import <Dg Name>


RENAME THE Dg,


Live Dg can’t be renamed

It must be deported before Renaming

root@pr-01:>/# vxdg deport testdg2

root@pr-01:>/# vxdisk -o alldgs list |grep -i testdg2
c2t3d0s2     auto:sliced     -            (testdg2)    online
c2t4d0s2     auto:sliced     -            (testdg2)    online

There are 2 Situations to rename,

1.  I want to import this Dg on different server with different name

root@dr-01:>/# vxdg –C -n newdg2 import testdg2

2.  I want to import this Dg on different server with different name, but I know that I am importing this for just maintenance of pr-01, after that I will deport this to actual location

root@dr-01:>/# vxdg -tC -n newdg2 import testdg2

MOVING Dg’s

That is same Deport / Import Dg

root@pr-01:>/# vxdg deport testdg2

At dr-01

root@dr-01:>/# vxdg import testdg2
VxVM vxdg ERROR V-5-1-10978 Disk group testdg2: import failed:
No valid disk found containing disk group

root@dr-01:>/# vxdg -C import testdg2
VxVM vxdg ERROR V-5-1-10978 Disk group testdg2: import failed:
No valid disk found containing disk group

root@dr-01:>/# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:none       -            -            online invalid
disk_1       auto:sliced     -            (test-dg1)   online

Having only one entry

root@dr-01:>/# vxdisk scandisks


root@dr-01:>/# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:none       -            -            online invalid
disk_1       auto:sliced     -            (test-dg1)   online
disk_2       auto:sliced     -            -            online
disk_3       auto:sliced     -            (testdg2)    online
disk_4       auto:sliced     -            (testdg2)    online


root@dr-01:>/# vxdg import testdg2


root@dr-01:>/# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:none       -            -            online invalid
disk_1       auto:sliced     -            (test-dg1)   online
disk_2       auto:sliced     -            -            online
disk_3       auto:sliced     test-disk4   testdg2      online
disk_4       auto:sliced     test-disk3   testdg2      online

root@dr-01:>/# vxrecover -g testdg2 –sb

to start all volumes in the Dg [yet we did not created any volume ]

The Disks on which Dg has been created are moving from this system to that system, means disks are same but used by 2 systems, How it is possible that 1 disk can be used by 2 systems simultaneously… it is not possible, because when this type of DUAL PORTED DISKS are created system writes a lock on it so that can’t used by 2 at a time, we know that every disks has their config info, and if the disk is used by 2 systems at a time then might be that config info got corrupted and …. And what? … what else BOOOM… all data gone

That’s why we use –C sometimes while importing on other system

What if one disk got crashed in a Dg, and refuses to import…

Well… we know very well our flag i.e. –f means F&^….  go to hell with ur warnings … let me do my work

Ohhh… 1 sec… what u thought about it ???  It means forceful

#vxdg –f import <Dg Name>




No comments:

Post a Comment