How do I clone an existing snapshot in SnapCreator?

by Frequent Contributor on ‎2013-08-29 10:03 AM

SnapCreator gives you an ability to create NetApp FlexClones from an existing backup or a freshly created backup.

SnapCreator Clone vs Mount workflow Explained

When to use clone action?

A customer who wants to refresh a "Report Database" every Sunday night, may use a Clone action from the "Production Database".

The clone action will always take a fresh backup (a snapshot after quiescing your database application), and will use that snapshot as the base for your clone.

When to use mount action?

There are also situations where you may want to spin a Dev/Test database based on a previously taken snapshot.

     Example:

          A customer has taken hourly snapshots at 7am, 8am, 9am and 10am.

          A logical corruption occurred at 9:30am.

          A fresh clone may not be useful in this scenario and the customer might want to use the 9am snapshot as the base for his clone.

The mount action will make use of an user supplied backup (snapshot) name to create the clones.

Example Clone Options section from my config file.

########################################################################################################################

#     Clone Options                                                                                                    #

########################################################################################################################

NTAP_CLONE_IGROUP_MAP=mynetapp:proddatavol/devboxigroup

NTAP_NFS_EXPORT_ACCESS=read-only

NTAP_LUN_CLONE_RESERVATION=N

NTAP_CLONE_SECONDARY_VOLUMES=

NTAP_NUM_VOL_CLONES=1

NTAP_NFS_EXPORT_PERSISTENT=N

NTAP_CLONE_FOR_BACKUP=Y

NTAP_CIFS_EXPORT_ENABLE=N

NTAP_CLONE_SECONDARY=N

NTAP_NFS_EXPORT_HOST=

NTAP_VOL_CLONE_RESERVE=NONE

With the above values, a Clone action will trigger a backup and will make use of that backup to create a clone and will also map the cloned LUNs to the mentioned igroup.

The NTAP_NUM_VOL_CLONES dictate how many volume clones you may keep at any given time.

A clone action can be kicked by this below command. (user and pass options are cached in the below example.)

(Also the output is trimmed to show the necessary sections)

[root@localhost scServer4.0.0]# ./snapcreator --profile siva --config prod --action cloneVol --policy hourly --verbose

########## Taking Snapshot copy on Primary mynetapp:proddatavol ##########

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-02007: Creating Snapshot copy [s-hourly_20130829125639] on volume [proddatavol].

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-02008: Snapshot copy [s-hourly_20130829125639] on volume [proddatavol] created successfully.

########## Snapshot copy create of s-hourly_20130829125639 on mynetapp:proddatavol Completed Successfully ##########

########## Executing Vol Clone ##########

[Thu Aug 29 12:56:40 2013] INFO: Creating Volume Clone from Snapshot copy s-hourly_20130829125639 of mynetapp:proddatavol

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-02036: Creating clone [cl_prod_proddatavol_20130829125639] of volume [proddatavol] based on Snapshot copy [s-hourly_20130829125639].

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-02037: Creating clone [cl_prod_proddatavol_20130829125639] of volume [proddatavol] based on Snapshot copy [s-hourly_20130829125639] finished successfully.

[Thu Aug 29 12:56:41 2013] INFO: Successfully created volume clone from Snapshot copy proddatavol of mynetapp:proddatavol

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-02050: Listing luns.

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-02051: Listing luns finished successfully.

[Thu Aug 29 12:56:41 2013] INFO: Creating igroup map for /vol/cl_prod_proddatavol_20130829125639/lun.1 on mynetapp:cl_prod_proddatavol_20130829125639

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-03003: Making lun [lun.1] online on vol [cl_prod_proddatavol_20130829125639].

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-03004: Lun-online of lun [cl_prod_proddatavol_20130829125639] on vol [lun.1] finished successfully.

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-02022: Mapping igroup [devboxigroup] on lun [/vol/cl_prod_proddatavol_20130829125639/lun.1].

[Thu Aug 29 12:56:44 2013] INFO: STORAGE-03000: Mapping igroup [devboxigroup] on lun [/vol/cl_prod_proddatavol_20130829125639/lun.1] finished successfully.

[Thu Aug 29 12:56:41 2013] INFO: Igroup Map of /vol/cl_prod_proddatavol_20130829125639/lun.1 to igroup devboxigroup finished successfully

If you want to create a clone from an available snapshot, you may first list snapshots using the syntax below.

[root@localhost scServer4.0.0]# ./snapcreator --profile siva --config prod --action backupList --policy hourly --verbose

[Thu Aug 29 12:57:18 2013] INFO: STORAGE-02090: Listing Snapshot copies on volume [proddatavol].

[Thu Aug 29 12:57:18 2013] INFO: STORAGE-02091: Listing Snapshot copies on volume [proddatavol] finished successfully.

########## NetApp Snap Creator Framework 4.0.0 Snapshot copy (Primary) List for mynetapp:proddatavol ##########

### Snapshot copy Name ###                      ### Snapshot copy Timestamp ###         ### Busy ###

s-hourly_20130828133259                         Aug 28 2013 14:37:08                    false

s-hourly_20130828133501                         Aug 28 2013 14:39:11                    false

s-hourly_20130828133755                         Aug 28 2013 14:42:05                    false

s-hourly_20130828133930                         Aug 28 2013 14:43:34                    false

s-hourly_20130828134106                         Aug 28 2013 14:45:09                    false

s-hourly_20130828134248                         Aug 28 2013 14:46:51                    false

s-hourly_20130829125639                         Aug 29 2013 14:00:41                    true

To create a clone based on the highlighted snapshot above, you may use the below syntax.

[root@localhost scServer4.0.0]# ./snapcreator --profile siva --config prod --action mount --backupName s-hourly_20130828134106 --policy hourly --verbose

########## Agent validation ##########

[Thu Aug 29 12:57:38 2013] INFO: Agent validation completed successfuly for agent localhost:9090

########## Plugin validation ##########

[Thu Aug 29 12:57:38 2013] INFO: Application not defined. Skipping Plugin validation task

[Thu Aug 29 12:57:39 2013] INFO: Removing log prod.debug.20130802140623.log

[Thu Aug 29 12:57:39 2013] INFO: Removing log prod.out.20130802140623.log

########## Executing Vol Clone ##########

[Thu Aug 29 12:57:39 2013] INFO: Creating Volume Clone from Snapshot copy s-hourly_20130828134106 of mynetapp:proddatavol

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-02036: Creating clone [cl_prod_proddatavol_20130829125738] of volume [proddatavol] based on Snapshot copy [s-hourly_20130828134106].

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-02037: Creating clone [cl_prod_proddatavol_20130829125738] of volume [proddatavol] based on Snapshot copy [s-hourly_20130828134106] finished successfully.

[Thu Aug 29 12:57:39 2013] INFO: Successfully created volume clone from Snapshot copy proddatavol of mynetapp:proddatavol

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-02050: Listing luns.

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-02051: Listing luns finished successfully.

[Thu Aug 29 12:57:39 2013] INFO: Creating igroup map for /vol/cl_prod_proddatavol_20130829125738/lun.1 on mynetapp:cl_prod_proddatavol_20130829125738

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-03003: Making lun [lun.1] online on vol [cl_prod_proddatavol_20130829125738].

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-03004: Lun-online of lun [cl_prod_proddatavol_20130829125738] on vol [lun.1] finished successfully.

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-02022: Mapping igroup [devboxigroup] on lun [/vol/cl_prod_proddatavol_20130829125738/lun.1].

[Thu Aug 29 12:57:43 2013] INFO: STORAGE-03000: Mapping igroup [devboxigroup] on lun [/vol/cl_prod_proddatavol_20130829125738/lun.1] finished successfully.

[Thu Aug 29 12:57:39 2013] INFO: Igroup Map of /vol/cl_prod_proddatavol_20130829125738/lun.1 to igroup devboxigroup finished successfully

You may also use the GUI Action->Mount, that will launch a similar window to choose your backup snapshot, when using mount.

If you have further questions, please feel free to ask your questions in the netapp.com/snapcreator communities website.

Comments

Thanks for really usefull info.

 

I would like to ask a question about executing pre/post_clone commands from configuration during the clone (un)mount process. At this time there are only commands (UN)MOUNT_CMDxx executed. Or am I wrong?

It means that I have to script all necessary actions only AFTER creating clone from existing snapshot  (MOUNT_CMDxxx) or BEFORE clone delete (UMOUNT_CMDxx).

Or is there any trick to be able to use also other pre-post commands in mount/unmount actions?

 

Best regards,

Rostislav

Frequent Contributor

MOUNT_CMDxx and UMOUNT_CMDxx are only intended for filesystem commainds (example: mount /data)

 

Mount workflow is limited.

You are correct with the fact that mount and unmount workflows do not execute pre/post clone commands.

 

You sure can execute a script as part of MOUNT_CMDxx after creating clone from an existing snapshot. (ore before clone delete via UMOUNT_CMDxx)



Thanks a lot for explanation Unfortunatelly (for me Man Happy ) the functionality is what you described. I just wanted to be sure about that...

 

 

Warning!

This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.