Find it

Thursday, January 2, 2014

Online data from storage luns in ZPOOL

Wishing you & your family very Happy New Year, may this year brings you all the success, good health & wealth.

Today will be writing about online storage (LUNs) migration for ZFS zpool. I'll be replacing the LUNs from old array to new array.

The best thing about the procedure is that during migration all the data which was present in ZFS file systems in ZPOOL nsrpool is still accessible without any issues, no performance lag. No impact to production system and no down time!!!

Each disk in zfs pool has the same size.

One can do this storage migration in two ways online.

1. One can use attach/detach options, zpool attach -f [pool] [device] [new-device] and then once re-silver done zpool detach [pool] [old-device]
2. Or simply one can simply do device replace, zpool replace [pool] [device] [new-device]

I’m going to use the 2nd option because I think this is the easiest way to achieve this LUN migration.

Newly allocated disks are as below,

/dev/rdsk/c6t6006016070312700CEB537F88C48E311d0s2 - 60G format
/dev/rdsk/c6t6006016070312700FA0468009348E311d0s2 - 60G format
/dev/rdsk/c6t600601606B312700FBA40FCCC0BCE211d0s2 - 60G format
/dev/rdsk/c6t600601606B3127002E623AB38B48E311d0s2 - 60G format
/dev/rdsk/c6t600601606B3127000283C9778948E311d0s2 - 60G format
/dev/rdsk/c6t6006016070312700008A87119148E311d0s2 - 60G format


Have formatted the above disks palcing everything on slice 0.

root@XXXXXX:/root# zpool status nsrpool
  pool: nsrpool
 state: ONLINE
 scan: none requested
config:

        NAME                                       STATE     READ WRITE CKSUM
        nsrpool                                  ONLINE       0     0     0
          c6t60060160E6C31D00625335009BF1DB11d0  ONLINE       0     0     0
          c6t60060160E6C31D00C8B0F7B898F1DB11d0  ONLINE       0     0     0
          c6t60060160E6C31D000C0C7E699AF1DB11d0  ONLINE       0     0     0
          c6t60060160E6C31D00AB24671C98F1DB11d0  ONLINE       0     0     0
          c6t60060160E6C31D0060312EA39BF1DB11d0  ONLINE       0     0     0
          c6t60060160E6C31D00CCF4057397F1DB11d0  ONLINE       0     0     0

errors: No known data errors

Let's start the migration -

root@XXXXXX:/root# zpool replace nsrpool c6t60060160E6C31D00625335009BF1DB11d0 c6t6006016070312700CEB537F88C48E311d0
root@XXXXXX:/root# zpool replace nsrpool c6t60060160E6C31D00C8B0F7B898F1DB11d0 c6t6006016070312700FA0468009348E311d0
root@XXXXXX:/root# zpool replace nsrpool c6t60060160E6C31D000C0C7E699AF1DB11d0 c6t600601606B312700FBA40FCCC0BCE211d0
root@XXXXXX:/root# zpool replace nsrpool c6t60060160E6C31D00AB24671C98F1DB11d0 c6t600601606B3127002E623AB38B48E311d0
root@XXXXXX:/root# zpool replace nsrpool c6t60060160E6C31D0060312EA39BF1DB11d0 c6t600601606B3127000283C9778948E311d0
root@XXXXXX:/root# zpool replace nsrpool c6t60060160E6C31D00CCF4057397F1DB11d0 c6t6006016070312700008A87119148E311d0


Now that resilvering started, will have to wait.

root@XXXXXX:/root# zpool status nsrpool
  pool: nsrpool
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scan: resilver in progress since Wed Dec  4 13:04:21 2013
    44.4G scanned out of 220G at 75.1M/s, 0h39m to go
    44.4G scanned out of 220G at 75.1M/s, 0h39m to go
    44.4G resilvered, 20.24% done
config:

        NAME                                         STATE     READ WRITE CKSUM
        nsrpool                                    ONLINE       0     0     0
          replacing-0                              ONLINE       0     0     0
            c6t60060160E6C31D00625335009BF1DB11d0  ONLINE       0     0     0
            c6t6006016070312700CEB537F88C48E311d0  ONLINE       0     0     0  (resilvering)
          replacing-1                              ONLINE       0     0     0
            c6t60060160E6C31D00C8B0F7B898F1DB11d0  ONLINE       0     0     0
            c6t6006016070312700FA0468009348E311d0  ONLINE       0     0     0  (resilvering)
          replacing-2                              ONLINE       0     0     0
            c6t60060160E6C31D000C0C7E699AF1DB11d0  ONLINE       0     0     0
            c6t600601606B312700FBA40FCCC0BCE211d0  ONLINE       0     0     0  (resilvering)
          replacing-3                              ONLINE       0     0     0
            c6t60060160E6C31D00AB24671C98F1DB11d0  ONLINE       0     0     0
            c6t600601606B3127002E623AB38B48E311d0  ONLINE       0     0     0  (resilvering)
          replacing-4                              ONLINE       0     0     0
            c6t60060160E6C31D0060312EA39BF1DB11d0  ONLINE       0     0     0
            c6t600601606B3127000283C9778948E311d0  ONLINE       0     0     0  (resilvering)
          replacing-5                              ONLINE       0     0     0
            c6t60060160E6C31D00CCF4057397F1DB11d0  ONLINE       0     0     0
            c6t6006016070312700008A87119148E311d0  ONLINE       0     0     0  (resilvering)

errors: No known data errors


After a long time, resilvering done and now we see zpool with new disks - so our zpool online migration is done.

root@XXXXXX:/root# zpool status nsrpool
errors: No known data errors
  pool: nsrpool
 state: ONLINE
 scan: resilvered 219G in 2h55m with 0 errors on Wed Dec  4 16:00:07 2013
config:

        NAME                                       STATE     READ WRITE CKSUM
        nsrpool                                  ONLINE       0     0     0
          c6t6006016070312700CEB537F88C48E311d0  ONLINE       0     0     0
          c6t6006016070312700FA0468009348E311d0  ONLINE       0     0     0
          c6t600601606B312700FBA40FCCC0BCE211d0  ONLINE       0     0     0
          c6t600601606B3127002E623AB38B48E311d0  ONLINE       0     0     0
          c6t600601606B3127000283C9778948E311d0  ONLINE       0     0     0
          c6t6006016070312700008A87119148E311d0  ONLINE       0     0     0


It was easy! Hope this helps...

3 comments: