Data Backup and Recovery
Data Backup and Recovery
How to create or monitor an event when flexclones have been configured longer then a defined time (20- 25day)
or if a script can be schedule and report all defined flexclones, related file share qtree or volume
Hi,
Operations Manager (we're using 4.0.2) has a canned report called 'Volume Clones'. This will show you all volumes and any clones which exist of them. We also use an alert when a volume has a snapshot > 30 days old (for example) - this will catch any old snapshots including those locked by flexclones.
Alternatively, have a look at this post which has a powershell script to show clones: https://communities.netapp.com/docs/DOC-10355
Hi, Thanks for your posting, i have done some investingation form DFM side and we use 4.02 D1 version from there I can see vol clone list, but it doesn have exact information which i need it. Is there way that we can customized to have a better report include sechdule, snapshot details etc
Power shell i dont have idea, From My undersanding it collects report for VOL?CLONES can you share the INFO about the script execution? with Some O/P is really helpful
Volume | Aggregate | Storage Server | Type | RAID | State | Status | Clone Parent | Clones |
---|
thanks in advance
Jayaprakash Nathan
With the Operations Manager Reports you can manually work out what snapshot is used to create the clone. As far as I'm aware the only way (other than trawling the messages file) to find out when a clone was created is by finding out what snapshot it used in the parent volume. That is normally what is most important as the clone locks the source snapshot.
I would try using Powershell if you're a Windows house, or shell script via ssh/rsh.
The ONTAP Powershell Toolkit provides the necessary module to be added to Windows Powershell. Have a look here:- https://communities.netapp.com/docs/DOC-6162
I've been meaning to put a script together to do this also, so now you've motivated me to do it. This is a basic example, and only shows vol clones (need to work on it a bit more to do LUN clones):
---------------------------------------------------snip----------------------------------------------
Import-Module DataONTAP
$controller=$args[0]
connect-nacontroller $controller | Out-Null
$snapshots=get-navol | get-nasnapshot | where-object {$_.Dependency -like "*vclone*"}
# Search for Snapshots which are locked by clones
if ( $snapshots ) {
ForEach ($snap in $snapshots)
{
$CloneVol = get-navol | where-object {$_.CloneParent -like $snap.TargetName}
ForEach ($vol in $CloneVol) {
$Clone = New-Object PSObject -Property @{
CloneType = 'Vol'
CloneVolumeName = $vol.Name
Created = $snap.Created
ParentSnapshot = $snap.Name
ParentVolume = $snap.TargetName
ParentLun = '' }
$Clones += $Clone
}
}
Return $Clones
}
else {
write-host "No Clones Found on $controller"
}
---------------------------------------------------snip----------------------------------------------
Call the script with the filer name as a command line argument. Looks like this:
PS L:\WindowsPowerShell> .\CloneList.ps1 toaster1
ParentVolume : ORA_DB_01
ParentLun :
ParentSnapshot : smo_orasid_orasid_orahost_20120306082215_f_h_1_8ae6768345g24560135e719f4270001_0
CloneVolumeName : SnapManager_20120306083548285_ORA_DB_01
CloneType : Vol
Created : 06/03/2012 08:23:51
PS L:\WindowsPowerShell>
So the 'Created' date is the timestamp from the source snapshot used for the volume clone.
Hope that helps!!
Craig
You are really appreciated, you have given me idea with an O/P
From My end i cannot use Powershell. may be i will try your power shell options , same with PERL script which we normally use
You can Advise me if you have differnt Options too
thanks in advance
Jayaprakash Nathan
With Perl you can do the same thing (assuming you can get some sort of access to the filer via ssh/rsh), you just don't have the commandlets you get in PS, so you'll need to write more code to do this. You can search for a snapshot status of *vclone* - that tells you the snapshot is locked by volume clone. You then need to find out which volume is cloned from it. You can do this via the vol status command, eg:
root@toaster1:~# vol status SnapManager_20120307050057507_ORA_DB_01
Volume State Status Options
SnapManager_20120307050057507_ORA_DB_01 online raid_dp, flex create_ucode=on, guarantee=none,
fractional_reserve=0
Clone, backed by volume 'ORA_DB_01', snapshot 'smo_orasid_orasid_orahost_20120307013712_f_h_1_8ae6768435eacd710135eacd78280001_0'
Volume UUID: f37e5088-69a4-11e1-8802-00a098163128
Containing aggregate: 'aggr01_sas_600'
You'll need to use some regex in there to pull out the relevant data, then use the snashot create data from the source volume as a reference for when it was created.
Hope that helps,
Craig