Thursday, 28 March 2013

How to create LUN clones


Recently I had a question from one of my friend on how to restore a snapshot which was created.

Here Iam explaning with the lun clone command.where i clone a lun with the required snapshot. Here in our example. /vol/vol1/q_vol1_004/q_vol1_004.lun is the LUN where they wanted me to restore the lun for with the hourly.4 snapshot

Filer1*> snap list vol1
Volume vol1
working...

  %/used       %/total  date          name
----------  ----------  ------------  --------
  1% ( 1%)    0% ( 0%)  Jul 08 04:30  filer1_vol1.274 (snapmirror)
  1% ( 0%)    0% ( 0%)  Jul 07 23:02  hourly.0
  3% ( 2%)    1% ( 1%)  Jul 06 23:02  hourly.1
  5% ( 1%)    1% ( 0%)  Jul 05 23:02  hourly.2
  7% ( 3%)    2% ( 1%)  Jul 04 23:02  hourly.3
  9% ( 2%)    2% ( 0%)  Jul 03 23:02  hourly.4

in the above command i see the list of snapshots that are available for restore

Filer1*> qtree status vol1
Volume   Tree     Style Oplocks  Status
-------- -------- ----- -------- ---------
vol1          unix  enabled  normal
vol1 q_vol1_001 unix  enabled  normal
vol1 q_vol1_002 unix  enabled  normal
vol1 q_vol1_003 unix  enabled  normal
vol1 q_vol1_004 unix  enabled  normal

In the above command we see the list of qtrees created for that volume


filer1*> qtree create /vol/vol1/q_vol1_005  ( Iam creating a new qtree on the same volume so I can do a lun clone with this qtree wrt to a particualar snapshot.

filer1*> lun clone create /vol/vol1/q_vol1_005/q_vol1_005.lun -o noreserve -b /vol/vol1/q_vol1_004/q_vol1_004.lun hourly.4 ( Here iam creating a new lun using hourly.4 snapshot )

filer1*> lun show unmapped
        /vol/vol1/q_vol1_005/q_vol1_005.lun  500.1g (536952700920)  (r/w, online)

filer1*> lun map /vol/vol1/q_vol1_005/q_vol1_005.lun host1 22 ( here iam mapping to the host with lun ID 22)

where 22 is the LUN ID

No comments:

Post a Comment