Find it

Wednesday, December 26, 2012

UNABLE TO MIRROR VxVM VOLUME

First of all... Merry Christmas, everybody!

Yes, again after a long time... past few weeks were very hyperactive and quite attentive but finally, yes… finally one more unsleeping late night… I decided to take some timeout to post this interesting post for all my sysadmin friends!

Few days back I got a request to mirror an existing volume. Easy enough right? - Yes, it is! but then I revealed into an interesting problem causing me to unable mirror the existing volume.

Let's see what was the issue and what logic I used to get rid of the issue.

Volume DXarchive90d was not mirrored for some unknown reason and so I've been requested to mirror it.

root:XXXXXXXX:/root # vxprint -htg asmm7 DXarchive90d

V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO

v DXarchive90d - ENABLED ACTIVE 419430400 SELECT - fsgen
pl DXarchive90d-01 DXarchive90d ENABLED ACTIVE 418426880 CONCAT - RW
sd asmm7_8-01 DXarchive90d-01 asmm7_8 0 167270400 0 usp006_21 ENA
sd asmm7_9-01 DXarchive90d-01 asmm7_9 0 167270400 167270400 usp006_19 ENA
sd asmm7_10-01 DXarchive90d-01 asmm7_20 0 83886080 334540800 usp006_9 ENA

In order to mirror it I decided to create the new sub disks, new plex and attach the plex to make mirror for volume DXarchive90d. When I tried so, I got an interesting error -

1)  I created another plex of same size and tried to attach but get below message.

- Create sub-disk

Syntax - vxmake [-g diskgroup] sd subdisk diskname,offset,length

root:XXXXXXXX:/root # vxmake -g asmm7 sd asmm7_21m-01 asmm7_21m,0,167270400
root:XXXXXXXX:/root # vxmake -g asmm7 sd asmm7_22m-01 asmm7_22m,0,167270400
root:XXXXXXXX:/root # vxmake -g asmm7 sd asmm7_23m-01 asmm7_23m,0,83886080

- Create Plex of same size

Syntax - vxmake [-g diskgroup] plex plex sd=subdisk1[,subdisk2,...]

root:XXXXXXXX:/root # vxmake -g asmm7 plex DXarchive90d-02 sd=asmm7_21m-01,asmm7_22m-01,asmm7_23m-01

- Attach the plex

root:XXXXXXXX:/root # vxplex -g asmm7 att DXarchive90d DXarchive90d-02
VxVM vxplex ERROR V-5-1-4035 Plex DXarchive90d-02 would be a sparse plex of Volume DXarchive90d

Tried with "force" option.

root:XXXXXXXX:/root # vxplex -g asmm7 -o force att DXarchive90d DXarchive90d-02
VxVM vxplex ERROR V-5-1-1204 Volume DXarchive90d has no complete plexes, cannot attach

2) Tried another way,

root:XXXXXXXX:/root # vxassist -v -b -g asmm7 mirror DXarchive90d layout=mirror-concat alloc="asmm7_21m asmm7_22m asmm7_23m"
VxVM vxassist ERROR V-5-1-437 Cannot allocate space to mirror 419430400 block volume

Later, carefully looking at things - Ahh.... See that -

Volume length: 419430400
Plex length: 418426880

The mirror attach operations are failing due to the addressable size of storage in the volume being larger than that of the plex assigned to it. i.e the volume has no complete plex that will store the entire volume data.

So what is the way out to such situation?

Well, I got the link where it says -

http://www.symantec.com/business/support/index?page=content&id=TECH67644

- Remove the volume
- Then attached the plex to the volume.

Well, unfortunately this solution was not for me! So, I figured out another way -

So, there is 1003520 sector diffrence between Volume length and Plex length. So how about associating subdisk of size 1003520 sectors.... just wild idea - let's see how it goes...

root:XXXXXXXX:/root # vxmake -g asmm7 sd asmm7_10-04 asmm7_10,0,1003520
root:XXXXXXXX:/root # vxsd -g asmm7 assoc DXarchive90d-01 asmm7_10-04

BEFORE:

v DXarchive90d - ENABLED ACTIVE 419430400 SELECT - fsgen
pl DXarchive90d-01 DXarchive90d ENABLED ACTIVE 418426880 CONCAT - RW
sd asmm7_8-01 DXarchive90d-01 asmm7_8 0 167270400 0 usp006_21 ENA
sd asmm7_9-01 DXarchive90d-01 asmm7_9 0 167270400 167270400 usp006_19 ENA
sd asmm7_10-01 DXarchive90d-01 asmm7_20 0 83886080 334540800 usp006_9 ENA

AFTER:

v DXarchive90d - ENABLED ACTIVE 419430400 SELECT - fsgen
pl DXarchive90d-01 DXarchive90d ENABLED ACTIVE 419430400 CONCAT - RW
sd asmm7_8-01 DXarchive90d-01 asmm7_8 0 167270400 0 usp006_21 ENA
sd asmm7_9-01 DXarchive90d-01 asmm7_9 0 167270400 167270400 usp006_19 ENA
sd asmm7_10-01 DXarchive90d-01 asmm7_20 0 83886080 334540800 usp006_9 ENA
sd asmm7_10-04 DXarchive90d-01 asmm7_10 0 1003520 418426880 usp006_16 ENA

Good enough - the root cause of volume mirror not happening was mismatch between volume lenth and plex lenth so all what I did is matched those sizes by associating subdisk of the size of diffrence to existing plex.

Now I think remove the plex which I created for mirroring...

root:XXXXXXXX:/root # vxedit -g asmm7 -rf rm DXarchive90d-02

Execute -

root:XXXXXXXX:/root # vxassist -v -b -g asmm7 mirror DXarchive90d layout=mirror-concat alloc="asmm7_21m asmm7_22m asmm7_23m"

SUCCESS!!!! Mirroring done OK.

See the mirroring progress...

root:XXXXXXXX:/root # vxtask list

TASKID PTID TYPE/STATE PCT PROGRESS
559 ATCOPY/R 01.10% 0/419430400/4608000 PLXATT DXarchive90d DXarchive90d-02 asmm7

root:XXXXXXXX:/root # vxtask -l list
Task: 559 RUNNING
Type: ATCOPY
Operation: PLXATT Vol DXarchive90d Plex DXarchive90d-02 Dg asmm7
Started: Thu Dec XX 12:07:12 2012
Throttle: 0
Progress: 1.23% 5156864 of 419430400 Blocks
Work time: 43 seconds (57:34 remaining)

root:XXXXXXXX:/root # vxprint -htg asmm7 DXarchive90d

V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO
v DXarchive90d - ENABLED ACTIVE 419430400 SELECT - fsgen
pl DXarchive90d-01 DXarchive90d ENABLED ACTIVE 419430400 CONCAT - RW
sd asmm7_8-01 DXarchive90d-01 asmm7_8 0 167270400 0 usp006_21 ENA
sd asmm7_9-01 DXarchive90d-01 asmm7_9 0 167270400 167270400 usp006_19 ENA
sd asmm7_10-01 DXarchive90d-01 asmm7_20 0 83886080 334540800 usp006_9 ENA
sd asmm7_10-04 DXarchive90d-01 asmm7_10 0 1003520 418426880 usp006_16 ENA
pl DXarchive90d-02 DXarchive90d ENABLED ACTIVE 419430400 CONCAT - RW
sd asmm7_21m-01 DXarchive90d-02 asmm7_21m 0 167270400 0 usp009_20 ENA
sd asmm7_22m-01 DXarchive90d-02 asmm7_22m 0 167270400 167270400 usp009_21 ENA
sd asmm7_23m-01 DXarchive90d-02 asmm7_23m 0 84889600 334540800 usp009_22 ENA

Well, now in good shape... Hope this helps someone who gets such a interesting issue...

3 comments:

  1. Very nice article Nilesh.............keeping it handy in case I encounter a situation like this arises................

    ReplyDelete
  2. Hi Nilesh !

    One query,

    Did you created the plex asmm7_23m with size :- 84889600 again ?

    I see you had already execute the below command before the error appeared : -

    vxmake -g asmm7 sd asmm7_23m-01 asmm7_23m,0,83886080

    The post is very informative, Thanks for sharing your experience,

    ReplyDelete