How to create/remove Linked Volume (ln) and Breakoff Snapshot (sp)

book

Article ID: 100001115

calendar_today

Updated On:

Resolution

A linked volume is basically a mirror that is attached to the parent volume , except it is located in another diskgroup on the same host to be used for distance mirroring for Disaster Recovery or break off style snapshots.
 
 
The semantics of linked volume can be summarized as follows:

Linked-to volume (LT): A volume that receives all the updates from another volume (which is linked-from volume). This volume basically acts as a mirror of the other volume, with some differences. It is not directly accessible to the applications. This is also referred to as a target volume, secondary volume, or a remote volume.

Linked-from volume (LF): A volume that has another volume linked to it. It sends all the updates it receives to the linked volume. The linked-from volume is accessible to the application and acts as a primary data volume. This is also referred to as a source volume, primary volume, or a local volume.

Linkset (dglink) object (LS): This object represents linking (mirroring) relationship between two disk groups. It also represents a group of volumes that is involved in linking relationship with another group.

Link object (LN): This object represents a linking relationship between two volumes. This is sometimes referred to as volume link object.

Note: The linked-to volume and linked-from volume can be a part of different disk groups. This way, no DG split/join operations are required to do off-host processing. However both the volumes are accessible through the same host and the data is transferred from linked-from volume to the linked-to volume through normal I/O interface.

The link objects can go into various states as a result of the link operations. Some of the valid state transitions are:

Attaching This is a state that applies to both side of the link. When a link is first created or when a Broken or Stopped link is started, the current contents of the linked-from volume must be copied to the linked-to volume. Until that operation completes, the linked-to volume does not have well defined contents. On first creation of the link, the complete volume will be copied. Subsequent operations will use update maps stored in DCO objects to optimize the copy operation. At completion of the attaching operation, the link enters the Active state. Note that this state may be associated with other sub-states.

Active Under normal operation, writes flow from the linked-from volume to the linked-to volume. Writes are not allowed on the linked-to volume. Both DCO objects are updated separately (and concurrently) to track updates.

Broken When a write that passes through to a linked-to volume fails, or when a linked-to volume becomes disabled, or the link is detached or stopped for some other reason, the link enters the Broken state on the linked-from side. In that state, updates to the linked-from volume are tracked relative to the linked-to volume in the DCO of the linked-from volume(just as with a plex detach). When the linked-to volume comes back and recovery occurs, it enters the attaching state, using the accumulated changes listed in both linked-from and linked-to DCO objects as the map of regions to recover.

Stopped This is a state that can be associated with either side of the link. It is an administrative version of the Broken state. While in this state, automated recovery (on crash) is turned off.

Issue:

How to create and remove a linked volume and break-off snapshot

1:  Create datadg=ddg with volume=vol1 and snapdg=sdg with volume=snapvol1

# vxassist -g ddg make vol11433600s  logtype=dco drl=off dcoversion=20 regionsz=128 init=active

# vxassist -g ddg make snapvol1 1433600s logtype=dco drl=offdcoversion=20 regionsz=128 init=active


# vxprint -g ddg -htv vol1

v  vol1        -            ENABLED  ACTIVE  1433600  SELECT    -        fsgen
plvol1-01      vol1        ENABLED  ACTIVE  1433600  CONCAT    -        RW
sdd1-01        vol1-01      d1      0        204800   0        HDS9500-ALUA0_0 ENA
sdd1-03        vol1-01      d1      205344   1228800  204800    HDS9500-ALUA0_0 ENA
dcvol1_dco     vol1        vol1_dcl
v  vol1_dcl    -            ENABLED  ACTIVE  560      SELECT    -        gen
plvol1_dcl-01  vol1_dcl     ENABLED  ACTIVE  560      CONCAT    -        RW
sdd1-02        vol1_dcl-01  d1      3531296  560      0        HDS9500-ALUA0_0 ENA


# vxprint -g sdg  -htv snapvol1

v  snapvol1    -            ENABLED  ACTIVE  1433600  SELECT    -        fsgen
plsnapvol1-01  snapvol1     ENABLED  ACTIVE  1433600  CONCAT    -        RW
sds1-01        snapvol1-01  s1      0        1433600  0        HDS9500-ALUA0_2 ENA
dc snapvol1_dco snapvol1    snapvol1_dcl
v  snapvol1_dcl-            ENABLED  ACTIVE  544      SELECT    -        gen
plsnapvol1_dcl-01 snapvol1_dcl ENABLED ACTIVE544      CONCAT    -        RW
sds1-02        snapvol1_dcl-01s1    1433600  544      0        HDS9500-ALUA0_2 ENA

2:  Create filesystem and add data to the datadg/volume and mount

# mkfs -F vxfs /dev/vx/rdsk/ddg/vol1
#mount -F vxfs /dev/vx/dsk/ddg/vol1 /d1
# cp /etc/a* /d1
# df-kl /d1
Filesystem            kbytes    used  avail capacity  Mounted on
/dev/vx/dsk/ddg/vol1  716800  67513  608719    10%    /d1

3: Create Link between volumes

#  vxsnap -g ddg  -b  addmir vol1 mirvol=snapvol1 mirdg=sdg  

# vxtask -llist
Task:      360RUNNING
Type:      LINKSYNC
Operation:LINKSYNC Vol snapvol1 Dg sdg
Started:   Mon Jan 18 21:12:412010
Throttle:  0
Progress:  2.57% 36864 of1433600 Blocks
Work time: 1 second (0:37remaining)

#  vxsnap -g ddg snapwait   vol1 mirvol=snapvol1 mirdg=sdg &
During synchronization waits for thelinked volume to become ACTIVE

# vxprint -g ddg -htv vol1

dgddg          default      default  5000    1260975635.19.mtvav215-c9i

dm d1          HDS9500-ALUA0_0auto  65536    6116608  -

v  vol1        -            ENABLED  ACTIVE  1433600  SELECT    -        fsgen
plvol1-01      vol1        ENABLED  ACTIVE  1433600  CONCAT    -        RW
sdd1-01        vol1-01      d1      0        204800   0        HDS9500-ALUA0_0 ENA
sdd1-03        vol1-01      d1      205344   1228800  204800    HDS9500-ALUA0_0 ENA
dcvol1_dco     vol1        vol1_dcl
v  vol1_dcl    -            ENABLED  ACTIVE  544      SELECT    -        gen
plvol1_dcl-01  vol1_dcl     ENABLED  ACTIVE  544      CONCAT    -        RW
sdd1-02        vol1_dcl-01  d1      204800   544      0        HDS9500-ALUA0_0 ENA
lnvol1_ln      vol1        vol1_dco

4. Check status of the volumes and link set

#vxprint -g sdg -htv snapvol1

dgsdg          default      default  29000    1263009324.35.mtvav215-c9h

dms1           HDS9500-ALUA0_2auto  65536    6116608  -

v  snapvol1    -            ENABLED  ACTIVE  1433600  SELECT    -        fsgen
plsnapvol1-01  snapvol1     ENABLED  ACTIVE  1433600  CONCAT    -        RW
sds1-01        snapvol1-01  s1      0        1433600  0        HDS9500-ALUA0_2 ENA
dc snapvol1_dco snapvol1    snapvol1_dcl
v  snapvol1_dcl-            ENABLED  ACTIVE  544      SELECT    -        gen
plsnapvol1_dcl-01 snapvol1_dcl ENABLED ACTIVE544      CONCAT    -        RW
sds1-02        snapvol1_dcl-01s1    1433600  544      0        HDS9500-ALUA0_2 ENA
ln snapvol1_ln  snapvol1    snapvol1_dco

The Link (ln) objects are now seen in vxprint -ht outputs above.

#  /sbin/vxlink  -g ddg print
TYNAME       ROLE  VOLUME    LINKSET    LNSTATE    LSSTATE    DIFF
ls ddg-lset-ispbo-lf-01LF    --        --          --        ACTIVE     N/A

ls ddg-lset-ispbo-lf-00LF    --        --          --        ACTIVE     0.000000
lnvol1_ln    LF    vol1      ddg-lset-ispbo-lf-00  ACTIVE     ACTIVE    0.000000


#  /sbin/vxlink  -g sdg print
TYNAME       ROLE  VOLUME   LINKSET    LNSTATE    LSSTATE     DIFF
ls sdg-lset-ispbo-lt-00LT    --        --          --        ACTIVE     N/A

ls sdg-lset-ispbo-lt-01LT    --        --          --        ACTIVE     0.000000
ln snapvol1_ln LT    snapvol1  sdg-lset-ispbo-lt-01  ACTIVE    ACTIVE    0.000000


NOTE1:  To revert back to remove the  link "ln"objects run

# vxsnap -g ddg rmmir vol1 mirvol=snapvol1 mirdg=sdg


5: Create a "Breakout snapshot"

# vxsnap -g ddg makesource=vol1/snap=snapvol1/snapdg=sdg


6:  Check status of the snapshot (sp)

# vxprint  -g ddg -ht

dgddg          default      default  5000    1260975635.19.mtvav215-c9i

dm d1          HDS9500-ALUA0_0auto  65536    6116608  -

v  vol1        -            ENABLED  ACTIVE  1433600  SELECT    -        fsgen
plvol1-01      vol1        ENABLED  ACTIVE  1433600  CONCAT    -        RW
sdd1-01        vol1-01      d1      0        204800   0        HDS9500-ALUA0_0 ENA
sdd1-03        vol1-01      d1      205344   1228800  204800    HDS9500-ALUA0_0 ENA
dcvol1_dco     vol1        vol1_dcl
v  vol1_dcl    -            ENABLED  ACTIVE  544      SELECT    -        gen
plvol1_dcl-01  vol1_dcl     ENABLED  ACTIVE  544      CONCAT    -        RW
sdd1-02        vol1_dcl-01  d1      204800   544      0        HDS9500-ALUA0_0 ENA
sp snapvol1_snp vol1        vol1_dco

#  vxprint  -g sdg -ht
dgsdg          default      default  29000    1263009324.35.mtvav215-c9h

dms1           HDS9500-ALUA0_2auto  65536    6116608  -

v  snapvol1    -            ENABLED  ACTIVE  1433600  SELECT    -        fsgen
plsnapvol1-01  snapvol1     ENABLED  ACTIVE  1433600  CONCAT    -        RW
sds1-01        snapvol1-01  s1      0        1433600  0        HDS9500-ALUA0_2 ENA
dc snapvol1_dco snapvol1    snapvol1_dcl
v  snapvol1_dcl-            ENABLED  ACTIVE  544      SELECT    -        gen
plsnapvol1_dcl-01 snapvol1_dcl ENABLED ACTIVE544      CONCAT    -        RW
sds1-02        snapvol1_dcl-01s1    1433600  544      0        HDS9500-ALUA0_2 ENA
sp vol1_snp     snapvol1    snapvol1_dco

NOTE 2:  To revert back, dissociate an instant snapshot volume  from its parent volume and remove it from the snapshot hierarchy. ( remove the "sp" object)

# vxsnap -g sdg dis snapvol1
# vxprint -g sdg -htv  snapvol1

dgsdg          default      default  29000    1263009324.35.mtvav215-c9h

dms1           HDS9500-ALUA0_2auto  65536    6116608  -

v  snapvol1    -            ENABLED  ACTIVE  1433600  SELECT    -        fsgen
plsnapvol1-01  snapvol1     ENABLED  ACTIVE  1433600  CONCAT    -        RW
sds1-01        snapvol1-01  s1      0        1433600  0        HDS9500-ALUA0_2 ENA
dc snapvol1_dco snapvol1    snapvol1_dcl
v  snapvol1_dcl-            ENABLED  ACTIVE  544      SELECT    -        gen
plsnapvol1_dcl-01 snapvol1_dcl ENABLED ACTIVE544      CONCAT    -        RW
sds1-02        snapvol1_dcl-01s1    1433600  544      0        HDS9500-ALUA0_2 ENA


7: At this stage, the breakout snapshot can be deported and imported on a remote/backup server and used as required . After task completion, to check status changes between the data volume and the snapvolume (%DIRTY) we can run

# vxsnap -g ddg print
NAME    SNAPOBJECT    TYPE    PARENT    SNAPSHOT    %DIRTY    %VALID

vol1    --           volume   --      --           --      100.00
       snapvol1_snp  volume  --       snapvol1    3.27      --

To repeat the breakout snapshot we need to reattach the plexes of the snapshot volume to the source volume for resynchronizing. Please ensure the snapdg/snapvolume is on the same server as the source data volume and not mounted.

# vxsnap -g sdg reattach snapvol1 source=vol1 sourcedg=ddg

On completion, the status of the volumes are as per step 4 above, ready to proceed with step 5.

Note3:  If you try to recreate an existing "ln",  then you will receive this warning
# vxsnap -g ddg  -b  addmir vol1 mirvol=snapvol1mirdg=sdg
VxVM vxsnap ERROR V-5-1-12843 Volume snapvol1 in DG sdg is already part of another relationship. VxVM vxsnap ERROR V-5-1-12745 Unable to create mirror relationship between volume vol1 (dg ddg) and volume snapvol1 (dgsdg)

But you can use the same source volume and create a breakout snapshot to a different a diskgroup

# vxassist -g snap2dg makesnap 2vol 1433600s logtype=dco drl=off dcoversion=20 regionsz=128 init=active

# vxsnap -g ddg -b addmir vol1 mirvol=snap2 volmirdg=s2dg

And a volume

# vxassist -g sdg make snapvol 21433600s logtype=dco drl=off dcoversion=20 regionsz=128 init=active

# vxsnap -g ddg -b addmir vol1 mirvol=snapvol2mirdg=sdg

# /sbin/vxlink -g ddg print

TYNAME       ROLE  VOLUME    LINKSET    LNSTATE    LSSTATE    DIFF
ls ddg-lset-ispbo-lf-00LF    --        --          --        ACTIVE     0.000000
lnvol1_ln    LF    vol1      ddg-lset-ispbo-lf-00  ACTIVE     ACTIVE    0.000000

ls ddg-lset-ispbo-lf-01LF    --        --          --        ACTIVE     0.000000
ln vol1_ln1  LF    vol1      ddg-lset-ispbo-lf-01  ACTIVE     ACTIVE    0.000000

ls ddg-lset-ispbo-lf-02LF    --        --          --        ACTIVE     0.000000
ln vol1_ln2  LF    vol1      ddg-lset-ispbo-lf-02  ACTIVE     ACTIVE    0.000000

# /sbin/vxlink -g sdg print

TYNAME       ROLE  VOLUME    LINKSET    LNSTATE    LSSTATE    DIFF
ls sdg-lset-ispbo-lt-00LT    --        --          --        ACTIVE     0.000000
ln snapvol1_lnLT    snapvol1  sdg-lset-ispbo-lt-00  ACTIVE    ACTIVE    0.000000

ls sdg-lset-ispbo-lt-01LT    --        --          --        ACTIVE     0.000000
ln snapvol2_lnLT    snapvol2  sdg-lset-ispbo-lt-01  ACTIVE    ACTIVE    0.000000

# /sbin/vxlink -g s2dg print

TYNAME       ROLE  VOLUME    LINKSET    LNSTATE    LSSTATE    DIFF
lss2dg-lset-ispbo-lt-00 LT    --        --          --        ACTIVE     0.000000
ln snap2vol_lnLT    snap2vol  s2dg-lset-ispbo-lt-00  ACTIVE    ACTIVE    0.000000


NOTE 4: Please ensure that all vxsnap -g dg addmir commands are executed in sequence (wait for each synchronization to complete)before creating a second  link "ln"  when using the same source volume.
 
 
 

 

Issue/Introduction

How to create/remove Linked Volume (ln) and Breakoff Snapshot (sp)