"How to do LUN Cloning - Step by Step"

LUN cloning allows the user to create a copy of a LUN, which was initially
created to be backed by a LUN or a file in a snapshot (i.e. using lun clone create ).

LUN cloning creates a complete copy of the LUN and frees the snapshot,
which can then be deleted.

The lun clone create command creates a lun on the local filer that is a
clone of a "backing" lun. A clone is a lun that is a writable snapshot
of another lun. Initially, the clone and its parent share the same
storage; more storage space is consumed only as one lun or the other
changes.
The parent_snap is locked in the parent volume, preventing its deletion
until the clone is either destroyed or split from the parent using the
lun clone split start command.

The lun clone create command fails if the chosen parent_lunpath is
currently involved in a lun clone split operation.

lun clone split start lun_path

This command begins separating clone lun_path from its underlying parent.
New storage is allocated for the clone lun that is distinct from the parent.
This process may take some time and proceeds in the background.

Use the lun clone split status command to view the command's progress.
Both clone and parent luns remain available during this process of splitting them apart.
Upon completion, the snapshot on which the clone was based will be unlocked in the parent vol.


EXAMPLE:-

I want to clone a LUN (/vol/sanboot/pc113lun) in sanboot volume.

1) Check volume status
fas940-ca> vol status
Volume State Status Options
vol0 online raid_dp, flex root
sanboot online raid_dp, flex

2) Check LUN status
fas940-ca> lun show/vol/sanboot/pc113lun 10g (10737418240) (r/w, online, mapped)

3) Create Snapshot of sanboot volume which contain LUN I want to clone.
fas940-ca> snap create sanboot sanboot_snap

4) Verify snapshot I just created
fas940-ca> snap listVolume sanbootworking...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Apr 29 20:14 sanboot_snap
10% (10%) 0% ( 0%) Apr 29 20:00 hourly.0
fas940-ca>

5) Clone LUN using following command.
fas940-ca> lun clone create /vol/sanboot/pc113lun_clone -b /vol/sanboot/pc113lun sanboot_snap

6) Verify clone created as new LUN. In this example it is pc113lun_clone
fas940-ca> lun show/vol/sanboot/pc113lun 10g (10737418240) (r/w, online, mapped)/vol/sanboot/pc113lun_clone 10g (10737418240) (r/w, online)

7) Verify snapshot status. You will see it as a busy LUN.
fas940-ca> snap list
Volume sanbootworking...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Apr 29 20:14 sanboot_snap (busy,LUNs)
10% (10%) 0% ( 0%) Apr 29 20:00 hourly.0

8) Now Split the LUN
fas940-ca> lun clone split start /vol/sanboot/pc113lun_clone

9) Verify status of lun cloning/split.
fas940-ca> lun clone split status /vol/sanboot/pc113lun_clone
lun clone split status: Done 1534504 of 2621440 blocks (58% complete).

fas940-ca> lun clone split status /vol/sanboot/pc113lun_clone
lun clone split status: /vol/sanboot/pc113lun_clone: LUN is not a clone

10) Verify snapshot. Now you will not see snapshot as busy because we just split the LUN.
fas940-ca> snap list sanboot
Volume sanbootworking...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Apr 29 20:14 sanboot_snap
5% ( 5%) 0% ( 0%) Apr 29 20:00 hourly.0

11) Delete the snapshot.
fas940-ca> snap delete sanboot sanboot_snap

12) Verify LUN
fas940-ca> lun show
/vol/sanboot/pc113lun 10g (10737418240) (r/w, online, mapped)
/vol/sanboot/pc113lun_clone 10g (10737418240) (r/w, online)

13) Unmap the original LUN
fas940-ca> lun unmap /vol/sanboot/pc113lun pc13grp

14) Offline original LUN
fas940-ca> lun offline /vol/sanboot/pc113lun

15) Verify LUN status.
fas940-ca> lun show/vol/sanboot/pc113lun 10g (10737418240) (r/w, offline)/vol/sanboot/pc113lun_clone 10g (10737418240) (r/w, online, mapped)

16) Make a Comment on Original LUN.
fas940-ca> lun comment /vol/sanboot/pc113lun "VMWare ESX 3.5 Server Boot Golden LUN"

17) Verfiy LUN status.
fas940-ca> lun show -v /vol/sanboot/pc113lun
/vol/sanboot/pc113lun 10g (10737418240) (r/w, offline)
Comment: "VMWare ESX 3.5 Server Boot Golden
LUN"Serial#: Vqi6FJI0QEY-
Share: none
Space Reservation: enabled
Multiprotocol Type: vmware

18) Map the new LUN which is cloned
fas940-ca> lun map /vol/sanboot/pc113lun_clone pc13grp

19) Verify LUN mapping.
fas940-ca> lun show -m
LUN path Mapped to LUN ID Protocol
-----------------------------------------------------------------/vol/sanboot/pc113lun_clone pc13grp 0 FCP

fas940-ca> lun show
/vol/sanboot/pc113lun 10g (10737418240) (r/w, offline)
/vol/sanboot/pc113lun_clone 10g (10737418240) (r/w, online, mapped)

20) Now you have copy of LUN which you can use in case of disaster or to create new LUN from this for fast and easy deployment of OS.

Comments

Popular posts from this blog

VMware PSOD Purple Screen of Death - Debugger waiting (world 2078) -- no port for remote debugger. "Escape" for local debugger

The Windows Time Service terminated with the following error - Event ID 7023 & 46

IBM x3650 M4 Series Server Model - Activation Keys Backup to be taken for IMM Moduel II, why?