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.
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.
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?
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).