How to mirror an existing volume with a different layout of the mirrored plex?

book

Article ID: 100004927

calendar_today

Updated On:

Resolution

If customer's want to migrate their data to different devices from a new storage or if the customer wants to mirror the existing volumes and also change the layout of the volume, then by using the following approach it is possible to achieve the task using only a single command:

Below is an example where we have a Volume with 'concat' layout and we are now going to add a new mirror with a different layout than the original volume. The task is to migrate the data from old storage to new storage with a 'stripe' layout volume and then remove and release the old storage

Here is how we achieve it:

# vxprint -qhtrg datadg
dg datadg       default      default  1000     1296742019.39.rdgv240sol05

dm emc0_02a2    emc0_02a2    auto     65536    19320448 -

v  datavol      -            ENABLED  ACTIVE   2097152  SELECT    -        fsgen
pl datavol-01   datavol      ENABLED  ACTIVE   2097152  CONCAT    -        RW
sd emc0_02a2-01 datavol-01   emc0_02a2 0       2097152  0         emc0_02a2 ENA
 

So we have a volume 'datavol' which is currently using a concat layout and a single disk emc0_02a2 and is presented from Enclosure emc0.

 # vxdmpadm getsubpaths dmpnodename=emc0_02a2
NAME         STATE[A]   PATH-TYPE[M] CTLR-NAME  ENCLR-TYPE   ENCLR-NAME    ATTRS
================================================================================
c3t5006048C5368E5A0d350s2 ENABLED(A)   -          c3         EMC          emc0             -
 

The new enclosure has been attached to the system:

==> The list of available enclosures

 # vxdmpadm listenclosure all
ENCLR_NAME        ENCLR_TYPE     ENCLR_SNO      STATUS       ARRAY_TYPE     LUN_COUNT
===================================================================================
disk              Disk           DISKS                CONNECTED    Disk        2
emc1              EMC            000290301414         CONNECTED    A/A         5
emc0              EMC            000290300822         CONNECTED    A/A        20
 

We have 5 new devices presented from the new storage on enclosure emc1 which will be used to replace the old storage from emc0.

rdgv240sol05 # vxdmpadm getsubpaths enclosure=emc1
NAME         STATE[A]   PATH-TYPE[M] DMPNODENAME  ENCLR-NAME   CTLR    ATTRS
================================================================================
c3t5006048C536979A0d73s2 ENABLED(A)   -          emc1_008b    emc1         c3        -
c3t5006048C536979A0d74s2 ENABLED(A)   -          emc1_008c    emc1         c3        -
c3t5006048C536979A0d75s2 ENABLED(A)   -          emc1_008d    emc1         c3        -
c3t5006048C536979A0d76s2 ENABLED(A)   -          emc1_008e    emc1         c3        -
c3t5006048C536979A0d77s2 ENABLED(A)   -          emc1_008f    emc1         c3        -

The task is to migrate the data from the disk on enclosure emc0 to new devices on enclosure emc1 and also converting the layout of the volume into a 4 column stripe layout.

So we add the 4 new required disks to the diskgroup:

# vxdg -g datadg adddisk emc1_008b emc1_008c emc1_008d emc1_008e

rdgv240sol05 # vxprint -qhtrg datadg
dg datadg       default      default  1000     1296742019.39.rdgv240sol05

dm emc0_02a2    emc0_02a2    auto     65536    19320448 -
dm emc1_008b    emc1_008b    auto     65536    10202368 -
dm emc1_008c    emc1_008c    auto     65536    10202368 -
dm emc1_008d    emc1_008d    auto     65536    10202368 -
dm emc1_008e    emc1_008e    auto     65536    10202368 -

v  datavol      -            ENABLED  ACTIVE   2097152  SELECT    -        fsgen
pl datavol-01   datavol      ENABLED  ACTIVE   2097152  CONCAT    -        RW
sd emc0_02a2-01 datavol-01   emc0_02a2 0       2097152  0         emc0_02a2 ENA
 

Now we can mirror the volume specifying the required layout and the allocation policy based on enclosure names:

# vxassist -b -g datadg mirror datavol layout=stripe enclosure:emc1

The Atomic Copy process has been started and the mirror is now formed as we can see from the 'vxprint' output below:

rdgv240sol05 # vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   169           ATCOPY/R 47.75% 0/2097152/1001472 PLXATT datavol datavol-02 datadg
rdgv240sol05 # vxprint -qhtrg datadg
dg datadg       default      default  1000     1296742019.39.rdgv240sol05

dm emc0_02a2    emc0_02a2    auto     65536    19320448 -
dm emc1_008b    emc1_008b    auto     65536    10202368 -
dm emc1_008c    emc1_008c    auto     65536    10202368 -
dm emc1_008d    emc1_008d    auto     65536    10202368 -
dm emc1_008e    emc1_008e    auto     65536    10202368 -

v  datavol      -            ENABLED  ACTIVE   2097152  SELECT    -        fsgen
pl datavol-01   datavol      ENABLED  ACTIVE   2097152  CONCAT    -        RW
sd emc0_02a2-01 datavol-01   emc0_02a2 0       2097152  0         emc0_02a2 ENA
pl datavol-02   datavol      ENABLED  TEMPRMSD 2097152  STRIPE    4/128    WO
sd emc1_008b-01 datavol-02   emc1_008b 0       524288   0/0       emc1_008b ENA
sd emc1_008c-01 datavol-02   emc1_008c 0       524288   1/0       emc1_008c ENA
sd emc1_008d-01 datavol-02   emc1_008d 0       524288   2/0       emc1_008d ENA
sd emc1_008e-01 datavol-02   emc1_008e 0       524288   3/0       emc1_008e ENA

As we can see, the mirrored plex 'datavol-02' is of layout STRIPE and it has taken the disk allocation from the emc1 enclosure as we defined in our command.

Once the mirrors are synchronized, both the plexes will be in "ENABLED ACTIVE" state. The time taken to complete the Atomic Copy process to sync up the plexes depends on the size of the volumes.

Now we can easily remove the original plex to free up the storage:

rdgv240sol05 # vxprint -qhtrg datadg
dg datadg       default      default  1000     1296742019.39.rdgv240sol05

dm emc0_02a2    emc0_02a2    auto     65536    19320448 -
dm emc1_008b    emc1_008b    auto     65536    10202368 -
dm emc1_008c    emc1_008c    auto     65536    10202368 -
dm emc1_008d    emc1_008d    auto     65536    10202368 -
dm emc1_008e    emc1_008e    auto     65536    10202368 -

v  datavol      -            ENABLED  ACTIVE   2097152  SELECT    datavol-02 fsgen
pl datavol-01   datavol      ENABLED  ACTIVE   2097152  CONCAT    -        RW
sd emc0_02a2-01 datavol-01   emc0_02a2 0       2097152  0         emc0_02a2 ENA
pl datavol-02   datavol      ENABLED  ACTIVE   2097152  STRIPE    4/128    RW
sd emc1_008b-01 datavol-02   emc1_008b 0       524288   0/0       emc1_008b ENA
sd emc1_008c-01 datavol-02   emc1_008c 0       524288   1/0       emc1_008c ENA
sd emc1_008d-01 datavol-02   emc1_008d 0       524288   2/0       emc1_008d ENA
sd emc1_008e-01 datavol-02   emc1_008e 0       524288   3/0       emc1_008e ENA
 

So let us disassociate the original plex from the volume and delete it to then remove the disk from the diskgroup and uninitialize it and release the device back to the storage:

# vxplex -g datadg dis datavol-01

# vxedit -g datadg -rf rm datavol-01

# vxdg -g datadg rmdisk emc0_02a2

# vxdisk rm emc0_02a2

# vxprint -qhtrg datadg
dg datadg       default      default  1000     1296742019.39.rdgv240sol05

dm emc1_008b    emc1_008b    auto     65536    10202368 -
dm emc1_008c    emc1_008c    auto     65536    10202368 -
dm emc1_008d    emc1_008d    auto     65536    10202368 -
dm emc1_008e    emc1_008e    auto     65536    10202368 -

v  datavol      -            ENABLED  ACTIVE   2097152  SELECT    datavol-02 fsgen
pl datavol-02   datavol      ENABLED  ACTIVE   2097152  STRIPE    4/128    RW
sd emc1_008b-01 datavol-02   emc1_008b 0       524288   0/0       emc1_008b ENA
sd emc1_008c-01 datavol-02   emc1_008c 0       524288   1/0       emc1_008c ENA
sd emc1_008d-01 datavol-02   emc1_008d 0       524288   2/0       emc1_008d ENA
sd emc1_008e-01 datavol-02   emc1_008e 0       524288   3/0       emc1_008e ENA
 

So now we have achieved the task of migrating the data from old storage to new storage with a new stripe layout of the volume without any outage and the devices from the old storage have been released from Volume Manager control and can now safely be removed from the host and unpresented from the Storage.


Issue/Introduction

How to mirror an existing volume with a different layout of the mirrored plex?