5. Method 2: VxAssist

Rather than mess with vxmake and all the objects on a very personal basis you can employ vxassist to do all the dirty work. If you have any amount of experience with vxassist you'll know that the more information you can supply to vxassist the better the end product will be.

I'm going to use vxassist to build a stripe-pro volume from four disks and I want the volume to be 1G in size:

root@sun7:/usr/sbin# vxassist -g testdg make stripeprovol 1g  layout=stripe-mirror \
			testdg01 testdg02 testdg03 testdg04

This command took along time to return due to syncing, but when it came back I had this to show for it (vxprint -hrt):

v  stripeprovol -            ENABLED  ACTIVE   2097152  fsgen     stripeprovol-03 SELECT
pl stripeprovol-03 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sv stripeprovol-S01 stripeprovol-03 stripeprovol-L01 1 1048576 0/0 2/2     ENA
v2 stripeprovol-L01 -        ENABLED  ACTIVE   1048576  fsgen     -        SELECT
p2 stripeprovol-P01 stripeprovol-L01 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg02-02  stripeprovol-P01 testdg02 0    1048576  0         c1t3d0   ENA
p2 stripeprovol-P02 stripeprovol-L01 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg04-02  stripeprovol-P02 testdg04 0    1048576  0         c1t3d2   ENA
sv stripeprovol-S02 stripeprovol-03 stripeprovol-L02 1 1048576 1/0 2/2     ENA
v2 stripeprovol-L02 -        ENABLED  ACTIVE   1048576  fsgen     -        SELECT
p2 stripeprovol-P03 stripeprovol-L02 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg03-02  stripeprovol-P03 testdg03 0    1048576  0         c1t3d1   ENA
p2 stripeprovol-P04 stripeprovol-L02 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg01-02  stripeprovol-P04 testdg01 0    1048576  0         c1t3d30  ENA

Pretty kool, huh? Quick, efficient, and poorly named; everything you love about vxassist. I can then go a bit further and explore my sizing options to see how much I can grow my new volume if I need to:

root@sun7:/usr/sbin# vxassist -g testdg maxgrow stripeprovol
Volume stripeprovol can be extended by 282050560 to 284147712 (138744Mb)

See? Just like a normal volume. Now comes the beauty part. When you look at that seemingly unmanageable mess of objects above does it really make you want to tear it apart and work on it like you might other "normal" volumes? Probably not. And you'd be wise to feel that way, there are just too many places to get confused or make a mistake when real data is involved. What if you could get back to a more normal point of view? Luckily you can, check this out:

root@sun7:/usr/sbin# vxassist -g testdg convert stripeprovol layout=mirror-stripe

Pretty easy line huh? We're simply telling Veritas Volume Manager that we want it convert (actually, its a relayout) our "stripe-mirror" to a "mirror-stripe". The beauty of this is that there is NO CONVERSION TIME! Because the process is a simple change in the way that VxVM looks at the disks rather than the way that it positions the data there is no conversion time. Lets look at what our earlier built volume looks like now that we've converted it (vxprint -hrt):

v  stripeprovol -            ENABLED  ACTIVE   2097152  fsgen     -        SELECT
pl stripeprovol-01 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sd testdg02-01  stripeprovol-01 testdg02 0     1048576  0/0       c1t3d0   ENA
sd testdg03-01  stripeprovol-01 testdg03 0     1048576  1/0       c1t3d1   ENA
pl stripeprovol-02 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sd testdg04-01  stripeprovol-02 testdg04 0     1048576  0/0       c1t3d2   ENA
sd testdg01-01  stripeprovol-02 testdg01 0     1048576  1/0       c1t3d30  ENA

Look alittle less intimidating? It should. Using vxassist we can convert back and forth seamlessly between stripe-mirror and mirror-stripe. The same can be done with concat-mirror and mirror-concat. The only catch is that you can't use "vxassist convert" to convert from stripe-mirror to concat-mirror (or any other concat to stripe combination), for that you'd need to do a full-blown vxrelayout.

I should also note that the vxassist conversion will work on any properly formed volume. This means that you can build a volume by hand (vxmake) as a RAID0+1 and then convert it to the RAID1+0. Or you could create a volume using vxassist as RAID1+0 and then convert it, work on it (tear apart the plexes, whatever) and then when finished just convert it back! This make everything really simple to work with.

And just to round this out, lets add take one last look at things by adding a Dirty Region Log to our volume:

root@sun7:/usr/sbin# vxassist -g testdg addlog stripeprovol

(vxprint -hrt)
v  stripeprovol -            ENABLED  ACTIVE   2097152  fsgen     -        SELECT
pl stripeprovol-01 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sd testdg02-01  stripeprovol-01 testdg02 0     1048576  0/0       c1t3d0   ENA
sd testdg03-01  stripeprovol-01 testdg03 0     1048576  1/0       c1t3d1   ENA
pl stripeprovol-02 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sd testdg04-01  stripeprovol-02 testdg04 0     1048576  0/0       c1t3d2   ENA
sd testdg01-01  stripeprovol-02 testdg01 0     1048576  1/0       c1t3d30  ENA
pl stripeprovol-03 stripeprovol ENABLED ACTIVE LOGONLY  CONCAT    -        RW
sd testdg02-02  stripeprovol-03 testdg02 1048576 33     LOG       c1t3d0   ENA

Now, let's convert out newly logged volume back into a stripe-mirror (StripePro):

root@sun7:/usr/sbin# vxassist -g testdg convert stripeprovol layout=stripe-mirror

(vxprint -hrt):
v  stripeprovol -            ENABLED  ACTIVE   2097152  fsgen     stripeprovol-04 SELECT
pl stripeprovol-04 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sv stripeprovol-S01 stripeprovol-04 stripeprovol-L01 1 1048576 0/0 3/3     ENA
v2 stripeprovol-L01 -        ENABLED  ACTIVE   1048576  fsgen     -        SELECT
p2 stripeprovol-P01 stripeprovol-L01 ENABLED ACTIVE LOGONLY CONCAT -       RW
s2 testdg06-01  stripeprovol-P01 testdg06 0    33       LOG       c1t3d3   ENA
p2 stripeprovol-P02 stripeprovol-L01 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg02-03  stripeprovol-P02 testdg02 0    1048576  0         c1t3d0   ENA
p2 stripeprovol-P03 stripeprovol-L01 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg04-02  stripeprovol-P03 testdg04 0    1048576  0         c1t3d2   ENA
sv stripeprovol-S02 stripeprovol-04 stripeprovol-L02 1 1048576 1/0 3/3     ENA
v2 stripeprovol-L02 -        ENABLED  ACTIVE   1048576  fsgen     -        SELECT
p2 stripeprovol-P04 stripeprovol-L02 ENABLED ACTIVE LOGONLY CONCAT -       RW
s2 testdg06-02  stripeprovol-P04 testdg06 33   33       LOG       c1t3d3   ENA
p2 stripeprovol-P05 stripeprovol-L02 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg03-02  stripeprovol-P05 testdg03 0    1048576  0         c1t3d1   ENA
p2 stripeprovol-P06 stripeprovol-L02 ENABLED ACTIVE 1048576 CONCAT -       RW
s2 testdg01-02  stripeprovol-P06 testdg01 0    1048576  0         c1t3d30  ENA

Interesting, huh? Now lets convert back just for fun:

root@sun7:/usr/sbin# vxassist -g testdg convert stripeprovol layout=mirror-stripe

(vxprint -hrt):
v  stripeprovol -            ENABLED  ACTIVE   2097152  fsgen     -        SELECT
pl stripeprovol-01 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sd testdg02-04  stripeprovol-01 testdg02 0     1048576  0/0       c1t3d0   ENA
sd testdg03-01  stripeprovol-01 testdg03 0     1048576  1/0       c1t3d1   ENA
pl stripeprovol-02 stripeprovol ENABLED ACTIVE 2097152  STRIPE    2/128    RW
sd testdg04-01  stripeprovol-02 testdg04 0     1048576  0/0       c1t3d2   ENA
sd testdg01-01  stripeprovol-02 testdg01 0     1048576  1/0       c1t3d30  ENA
pl stripeprovol-04 stripeprovol ENABLED ACTIVE LOGONLY  CONCAT    -        RW
sd testdg06-01  stripeprovol-04 testdg06 0     33       LOG       c1t3d3   ENA

Notice, how the log (the same log) gets seeing in both subvolumes. This goes against all sense, but there it is. This is one of thoughs questions to save for the Veritas Engineers while waiting for phone support. But you can see how easily everything works together.