Active IQ Unified Manager Discussions

LUN clone workflow, any plans?

vladimirzhigulin
4,845 Views

Hi,

Sometimes I do the following to create a LUN clone (note it works when no FlexClone is licensed):

# create a vol snapshot

> snap create vol_01 vol_01_SNAP

# create a LUN clone on the volume

> lun clone create /vol/vol_01/lun-01.CLONE -o noreserve -b /vol/vol_01/lun-01 vol_01_SNAP

# export /vol/vol_01/

# share the LUN clone via NFS

> lun /vol/vol_01/lun-01.CLONE share  all

and then I mount the volume via NFS on a host from where I can copy the cloned LUN.

I'm curious if it can be somehow automated with WFA? Any ideas / suggestions are welcome.

Thanks,

Vladimir

1 ACCEPTED SOLUTION

vladimirzhigulin
4,845 Views

Hi Dave,

Thanks a lot for your feedback, I think this is what I need to start with. I'll try to implement it and update the thread.

Cheers,

Vladimir

View solution in original post

7 REPLIES 7

bdave
4,845 Views

Hi Vladimir,

Yes, it can be automated with WFA.  This is a pretty simple thing to do.

  • There's already a certified command called "Create Snapshot" that will handle your first step.
  • The LUN Clone can be achieved by creating a new command using the PowerShell 'New-NaLunClone' cmdlet.  It would probably look something like this in your new WFA command (after all the normal setup stuff - clone another command to get started quickly):  New-NaLunClone -ClonePath $myClonePath -Unreserved -ParentSnapshot $myParentSnapshot
  • Use certified command "Create Export" for step 3.
  • Clone a simple PowerShell command as a starting point, use 'Set-NaLunShare' cmdlet to allow access to the lun similar to your last command.  Again, your WFA command would contain something like this: Set-NaLunShare -Path $myClonePath -ShareType 'all'
  • (OPTIONAL) I posted a "Mount an Export on a Linux Host using SSH" command out here in the WFA community as part of the Day-0 provisioning stuff.  Feel free to reuse it to have WFA automatically mount the export on your Linux host.  (If it is Linux, that is.)
  • (OPTIONAL) In fact, I also posted a command called "0day - Copy a file from one directory to another on a Linux host" that automate the final step for you as well. 

While I didn't create the workflow for you, I hope this gets you the info you need to create this workflow on your own.  Let me know if you need more help.

Cheers,

Dave

vladimirzhigulin
4,846 Views

Hi Dave,

Thanks a lot for your feedback, I think this is what I need to start with. I'll try to implement it and update the thread.

Cheers,

Vladimir

yaronh
4,845 Views

Hi Vladimir,

Let us know whether you have a working copy. We opened feature tracking requests towards 2.0, but should you have a working copy

it would surely cut our work easier 🙂

Cheers,

Yaron Haimsohn

WFA Team

yaron
4,845 Views

Vladimir, have a look at the attached workflow. It uses LUN clones (not FlexClones) as part of a flow that creates boot images.

A little bit of background on the attached workflow:

1. Customer has a set of volumes containing golden images of OS. Each golden image is placed in a Qtree, resulting in a volume with multiple Qtrees, one Qtree for each version of an OS (i.e. Win2008, Win2008R2, Win2008R2SP1, etc.). Each Qtree contains exactly one LUN.

2. The flow will ask the user to provide the source array and volume, and show a list of all available OS images by detailing all existing Qtrees under that volume

3. The flow will ask the user to provide a destination array and volume, the number of clones, and names of servers these clones are for

4. The flow will create a QSM relationship between the source and destination and wait until the replication is completed

5. The flow will break the replication and remove the replication configuration from the systems (in essence, this LUN represents the first new provisioned server image)

6. The flow will create N-1 Qtrees under the destination volume (one for each new host, the first Qtree is the landing zone for replication and hence the remaining N-1 Qtrees)

7. The flow will create thin provisioned clones in each Qtree by using LUN clone of the replicated LUN

Important note - you will see that one of the entries in the form is the current date/time. This is used as part of the name of the snapshot created to support the clone. We had to do it this way (vs. using a function to determine the current date/time) as it seems like WFA re-evaluated the function in each iteration instead of doing it once, resulting in the flow failing due to changes in the snapshot name resolution.

vladimirzhigulin
4,845 Views

Hi Yaron,

 

Thanks for the WF, it's helpful. I'm almost finished my own one, with some changes to your initial command. I'm working now on implementing this via WFA atm:

> lun /vol/vol_01/lun-01.CLONE share  all

Vladimir

vladimirzhigulin
4,845 Views

Here is the v0.1 of the workflow.

Current limitation:

1. One clone per LUN is allowed.

This is partly because a source volomue snapshot is created with "_SNAP" postfix and LUN clone is named with ".CLONE" postfix. It needs changing as I think it's not good to have something hardcoded in commands. Not sure as yet how to fix it properly.

2. No checks done for free space in the source volume. For instance I want the WF to fail if the source volume doesn't have at least 20% free space. Any suggestions here?

Thanks,

Vladimir

yaron
4,845 Views

Have not looked at the flow yet, but a few comments based on your questions:

1. The way around the hard-coded snap name is to create a snapshot with a date/time stamp in the name (unless you absolutely know the naming convention the user uses for Snapshots in their volume).

2. As for size, you probably should use a Finder to find the source volume with a condition for available capacity (i.e. find Volume by name and available capacity). While the workflow I provided as a sample does not do that, it will increase the size of the volume to accommodate for the space needed for the LUN clone(s).

Yaron

Public