Video Screencast Help

Creating and Managing a Linked Snapshot in Storage Foundation

Created: 31 Mar 2009 • Updated: 31 Mar 2009
M.Pozzi's picture
0 0 Votes
Login to vote

This is a practical example on how to create and manage a linked snapshot in Storage Foundation.
Initial situation:

Source dg: dg_src (with dco)

root@ / #vxprint -Qqthg dg_src
dg dg_src       default      default  6000     1238408559.174.tx088sd1
dm lun_src      xp12k0_11    auto     65536    204713728 -
v  src_vol      -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl src_vol-01   src_vol      ENABLED  ACTIVE   20971520 CONCAT    -        RW
sd lun_src-01   src_vol-01   lun_src  0        20971520 0         xp12k0_11 ENA
dc src_vol_dco  src_vol      src_vol_dcl
v  src_vol_dcl  -            ENABLED  ACTIVE   1712     SELECT    -        gen
pl src_vol_dcl-01 src_vol_dcl ENABLED ACTIVE   1712     CONCAT    -        RW
sd lun_src-02   src_vol_dcl-01 lun_src 20971520 1712    0         xp12k0_11 ENA

Source fs: /mnt/sorce_fs

root@#df -g /mnt/sorce_fs
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/vx/dsk/dg_src/src_vol     10.00      9.36    7%        4     1% /mnt/sorce_fs

DG/volume for linked snap dg: dg_ln_snap (whit dco)

root@ / #vxprint -Qqthg dg_ln_snap
dg dg_ln_snap   default      default  15000    1238408593.178.tx088sd1
dm lun_ln_snap  xp12k0_10    auto     65536    204713728 -
v  ln_snap_vol  -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl ln_snap_vol-01 ln_snap_vol ENABLED ACTIVE   20971520 CONCAT    -        RW
sd lun_ln_snap-01 ln_snap_vol-01 lun_ln_snap 0 20971520 0         xp12k0_10 ENA
dc ln_snap_vol_dco ln_snap_vol ln_snap_vol_dcl
v  ln_snap_vol_dcl -         ENABLED  ACTIVE   1712     SELECT    -        gen
pl ln_snap_vol_dcl-01 ln_snap_vol_dcl ENABLED ACTIVE 1712 CONCAT  -        RW
sd lun_ln_snap-02 ln_snap_vol_dcl-01 lun_ln_snap 20971520 1712 0  xp12k0_10 ENA

Create the linked snapshot:
root@ #vxsnap -g dg_src -b addmir src_vol mirvol=ln_snap_vol mirdg=dg_ln_snap

root@ / #vxtask -l list                                                       
Task:      1072 RUNNING                                                               
Type:      LINKSYNC                                                                   
Operation: LINKSYNC Vol ln_snap_vol Dg dg_ln_snap                                     
Started:   Mon Mar 30 13:08:10 DFT 2009                                               
Throttle:  0                                                                          
Progress:  3.33% 698368 of 20971520 Blocks                                            
Work time: 4 seconds (01:56 remaining)

Prints of dgs:
Source:

root@ #vxprint -Qqthg dg_src
dg dg_src       default      default  6000     1238408559.174.tx088sd1
dm lun_src      xp12k0_11    auto     65536    204713728 -
v  src_vol      -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl src_vol-01   src_vol      ENABLED  ACTIVE   20971520 CONCAT    -        RW
sd lun_src-01   src_vol-01   lun_src  0        20971520 0         xp12k0_11 ENA
dc src_vol_dco  src_vol      src_vol_dcl
v  src_vol_dcl  -            ENABLED  ACTIVE   1712     SELECT    -        gen
pl src_vol_dcl-01 src_vol_dcl ENABLED ACTIVE   1712     CONCAT    -        RW
sd lun_src-02   src_vol_dcl-01 lun_src 20971520 1712    0         xp12k0_11 ENA
ln src_vol_ln   src_vol      src_vol_dco


Snapshot:
root@/ #vxprint -Qqthg dg_ln_snap
dg dg_ln_snap   default      default  15000    1238408593.178.tx088sd1
dm lun_ln_snap  xp12k0_10    auto     65536    204713728 -
v  ln_snap_vol  -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl ln_snap_vol-01 ln_snap_vol ENABLED ACTIVE   20971520 CONCAT    -        RW
sd lun_ln_snap-01 ln_snap_vol-01 lun_ln_snap 0 20971520 0         xp12k0_10 ENA
dc ln_snap_vol_dco ln_snap_vol ln_snap_vol_dcl
v  ln_snap_vol_dcl -         ENABLED  ACTIVE   1712     SELECT    -        gen
pl ln_snap_vol_dcl-01 ln_snap_vol_dcl ENABLED ACTIVE 1712 CONCAT  -        RW
sd lun_ln_snap-02 ln_snap_vol_dcl-01 lun_ln_snap 20971520 1712 0  xp12k0_10 ENA
ln ln_snap_vol_ln ln_snap_vol ln_snap_vol_dco


Make of the snapshot volume
vxsnap -g dg_src make source=src_vol/snapvol=ln_snap_vol/snapdg=dg_ln_snap

NB the ln object becamed a sp object

Print source dg/vol:
root@#vxprint -Qqthg dg_src
dg dg_src       default      default  6000     1238408559.174.tx088sd1
dm lun_src      xp12k0_11    auto     65536    204713728 -
v  src_vol      -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl src_vol-01   src_vol      ENABLED  ACTIVE   20971520 CONCAT    -        RW
sd lun_src-01   src_vol-01   lun_src  0        20971520 0         xp12k0_11 ENA
dc src_vol_dco  src_vol      src_vol_dcl
v  src_vol_dcl  -            ENABLED  ACTIVE   1712     SELECT    -        gen
pl src_vol_dcl-01 src_vol_dcl ENABLED ACTIVE   1712     CONCAT    -        RW
sd lun_src-02   src_vol_dcl-01 lun_src 20971520 1712    0         xp12k0_11 ENA
sp ln_snap_vol_snp src_vol   src_vol_dco

Print snapshot dg/vol:
root@t #vxprint -Qqthg dg_ln_snap
dg dg_ln_snap   default      default  15000    1238408593.178.tx088sd1
dm lun_ln_snap  xp12k0_10    auto     65536    204713728 -
v  ln_snap_vol  -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl ln_snap_vol-01 ln_snap_vol ENABLED ACTIVE   20971520 CONCAT    -        RW
sd lun_ln_snap-01 ln_snap_vol-01 lun_ln_snap 0 20971520 0         xp12k0_10 ENA
dc ln_snap_vol_dco ln_snap_vol ln_snap_vol_dcl
v  ln_snap_vol_dcl -         ENABLED  ACTIVE   1712     SELECT    -        gen
pl ln_snap_vol_dcl-01 ln_snap_vol_dcl ENABLED ACTIVE 1712 CONCAT  -        RW
sd lun_ln_snap-02 ln_snap_vol_dcl-01 lun_ln_snap 20971520 1712 0  xp12k0_10 ENA
sp src_vol_snp  ln_snap_vol  ln_snap_vol_dco


Now you can fsck and mount the snapshot volume:
root@ #fsck -V vxfs /dev/vx/dsk/dg_ln_snap/ln_snap_vol
file system is clean - log replay is not required

root@ #mount -V vxfs /dev/vx/dsk/dg_ln_snap/ln_snap_vol /mnt/ln_snap

Reattach the snapshot volume (umount it before proceeding)
root@ #vxsnap -g dg_ln_snap reattach ln_snap_vol source=src_vol sourcedg=dg_src

NB the object sp has again become an ln object

Print of source dg/volume
root@ #vxprint -Qqthg dg_ln_snap                                                                                                              
dg dg_ln_snap   default      default  15000    1238408593.178.tx088sd1                                                                                     
dm lun_ln_snap  xp12k0_10    auto     65536    204713728 -
v  ln_snap_vol  -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl ln_snap_vol-01 ln_snap_vol ENABLED ACTIVE   20971520 CONCAT    -        RW
sd lun_ln_snap-01 ln_snap_vol-01 lun_ln_snap 0 20971520 0         xp12k0_10 ENA
dc ln_snap_vol_dco ln_snap_vol ln_snap_vol_dcl
v  ln_snap_vol_dcl -         ENABLED  ACTIVE   1712     SELECT    -        gen
pl ln_snap_vol_dcl-01 ln_snap_vol_dcl ENABLED ACTIVE 1712 CONCAT  -        RW
sd lun_ln_snap-02 ln_snap_vol_dcl-01 lun_ln_snap 20971520 1712 0  xp12k0_10 ENA
ln ln_snap_vol_ln ln_snap_vol ln_snap_vol_dco

Print of snapshot dg/volume
root@#vxprint -Qqthg dg_src
dg dg_src       default      default  6000     1238408559.174.tx088sd1
dm lun_src      xp12k0_11    auto     65536    204713728 -
v  src_vol      -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl src_vol-01   src_vol      ENABLED  ACTIVE   20971520 CONCAT    -        RW
sd lun_src-01   src_vol-01   lun_src  0        20971520 0         xp12k0_11 ENA
dc src_vol_dco  src_vol      src_vol_dcl
v  src_vol_dcl  -            ENABLED  ACTIVE   1712     SELECT    -        gen
pl src_vol_dcl-01 src_vol_dcl ENABLED ACTIVE   1712     CONCAT    -        RW
sd lun_src-02   src_vol_dcl-01 lun_src 20971520 1712    0         xp12k0_11 ENA
ln src_vol_ln   src_vol      src_vol_dco

To check if the reattach is ended:
root@ #vxsnap -g dg_src snapwait src_vol mirvol=ln_snap_vol mirdg=dg_ln_snap
Snapshot ready on volume src_vol

RESIZE of LINKED SNAPSHOT
If you perform a resize of the source volume when the snapshot is linked the snapshot volume get resized too:
Print of source dg/vol:

root@ #vxprint -Qqthg dg_src
dg dg_src       default      default  6000     1238408559.174.tx088sd1
dm lun_src      xp12k0_11    auto     65536    204713728 -
v  src_vol      -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl src_vol-01   src_vol      ENABLED  ACTIVE   20971520 CONCAT    -        RW
sd lun_src-01   src_vol-01   lun_src  0        20971520 0         xp12k0_11 ENA
dc src_vol_dco  src_vol      src_vol_dcl
v  src_vol_dcl  -            ENABLED  ACTIVE   1712     SELECT    -        gen
pl src_vol_dcl-01 src_vol_dcl ENABLED ACTIVE   1712     CONCAT    -        RW
sd lun_src-02   src_vol_dcl-01 lun_src 20971520 1712    0         xp12k0_11 ENA
ln src_vol_ln   src_vol      src_vol_dco

Print of snapshot dg/vol:

root@ #vxprint -Qqthg dg_ln_snap
dg dg_ln_snap   default      default  15000    1238408593.178.tx088sd1
dm lun_ln_snap  xp12k0_10    auto     65536    204713728 -
v  ln_snap_vol  -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl ln_snap_vol-01 ln_snap_vol ENABLED ACTIVE   20971520 CONCAT    -        RW
sd lun_ln_snap-01 ln_snap_vol-01 lun_ln_snap 0 20971520 0         xp12k0_10 ENA
dc ln_snap_vol_dco ln_snap_vol ln_snap_vol_dcl
v  ln_snap_vol_dcl -         ENABLED  ACTIVE   1712     SELECT    -        gen
pl ln_snap_vol_dcl-01 ln_snap_vol_dcl ENABLED ACTIVE 1712 CONCAT  -        RW
sd lun_ln_snap-02 ln_snap_vol_dcl-01 lun_ln_snap 20971520 1712 0  xp12k0_10 ENA
ln ln_snap_vol_ln ln_snap_vol ln_snap_vol_dco

Resize of source volume:
root@#vxresize -g dg_src src_vol +2G

Task of ln sync volumes:
root@ #vxtask -l list
Task:      1084 RUNNING
Type:      LINKSYNC
Operation: LINKSYNC Vol ln_snap_vol Dg dg_ln_snap

Started:   Mon Mar 30 14:57:57 DFT 2009
Throttle:  0
Progress:  7.57% 1905152 of 25165824 Blocks
Work time: 18 seconds (03:39 remaining)

After resize:

Print of sorce volume:

root@#vxprint -Qqthg dg_src
dg dg_src       default      default  6000     1238408559.174.tx088sd1
dm lun_src      xp12k0_11    auto     65536    204713728 -
v  src_vol      -            ENABLED  ACTIVE   25165824 SELECT    -        fsgen
pl src_vol-01   src_vol      ENABLED  ACTIVE   25165824 CONCAT    -        RW
sd lun_src-01   src_vol-01   lun_src  0        20971520 0         xp12k0_11 ENA
sd lun_src-04   src_vol-01   lun_src  20975504 4194304  20971520  xp12k0_11 ENA
dc src_vol_dco  src_vol      src_vol_dcl1
v  src_vol_dcl1 -            ENABLED  ACTIVE   2272     SELECT    -        gen
pl src_vol_dcl1-01 src_vol_dcl1 ENABLED ACTIVE 2272     CONCAT    -        RW
sd lun_src-03   src_vol_dcl1-01 lun_src 20973232 2272   0         xp12k0_11 ENA
ln src_vol_ln   src_vol      src_vol_dco

New size of fs:
root@#df -g /dev/vx/dsk/dg_src/src_vol
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/vx/dsk/dg_src/src_vol     12.00      7.92   35%       10     1% /mnt/sorce_fs

Print of Snapshot dg/vol (got automagically resized):
root@#vxprint -Qqthg dg_ln_snap
dg dg_ln_snap   default      default  15000    1238408593.178.tx088sd1
dm lun_ln_snap  xp12k0_10    auto     65536    204713728 -
v  ln_snap_vol  -            ENABLED  ACTIVE   25165824 SELECT    -        fsgen
pl ln_snap_vol-01 ln_snap_vol ENABLED ACTIVE   25165824 CONCAT    -        RW
sd lun_ln_snap-01 ln_snap_vol-01 lun_ln_snap 0 20971520 0         xp12k0_10 ENA
sd lun_ln_snap-04 ln_snap_vol-01 lun_ln_snap 20975504 4194304 20971520 xp12k0_10 ENA
dc ln_snap_vol_dco ln_snap_vol ln_snap_vol_dcl1
v  ln_snap_vol_dcl1 -        ENABLED  ACTIVE   2272     SELECT    -        gen
pl ln_snap_vol_dcl1-01 ln_snap_vol_dcl1 ENABLED ACTIVE 2272 CONCAT -       RW
sd lun_ln_snap-03 ln_snap_vol_dcl1-01 lun_ln_snap 20973232 2272 0 xp12k0_10 ENA
ln ln_snap_vol_ln ln_snap_vol ln_snap_vol_dco

Cheers
Marco