2011-02-24 09:18 AM
We have just starting using the PS toolkit and loving it, but we are struggling to query a value.
When we create a flexclone we are able to present it and use it no problem. We then remove it when we are done with it no problem. However we can't seem to find how to remove the auto-created snapshot that was created when we created flexclone. We'd like to clean up after ourselves so we thought we could have queried for the parent snapshot of the flexclone, but not sure how to query that value - it's there in filerview, but just looking for syntax....
Any help appreciated!
2011-02-25 06:47 AM
You can query the name of the FlexClone backing snapshot using Get-NaVol. For example, if the name of your clone is testvol_clone, you can issue the following commands:
PS C:\> $clone = Get-NaVol testvol_clone
PS C:\> $snapshot = $clone.CloneParent.Get(0).ParentSnapshotName
PS C:\> $snapshot
We can now see that the backing snapshot for testvol_clone is "clone_testvol_clone.1" and can proceed to offline the clone volume, destroy the clone volume, then delete the snapshot from the parent volume.
Hope that helps,
2014-03-07 08:41 AM
Thanks Clinton, I should have been clearer. Yes, I am using that command currently but was wondering if there was any API ref that contained all the objects/types etc. The current ref just seems to have the cmdlets and the API names. basically, what I'm planning on doing is building a little cmdlet to display the tree of volumes and flexclones hanging off those volumes (I'm not aware of any tool that does that so it would be quite useful!)
2014-03-07 08:59 AM
Yes, but for my env. where we have developers with maybe 200+ flexclones, I want to create a cmdlet that does the following against a target aggregate:
Particular to my environment but will save much hassle
2014-03-07 10:56 AM
The cmdlet man pages list the output types, but AFAIK there isn't a simple programmatic reference for that info. That might be a possible addition to Get-NaHelp and Get-NcHelp. You could always parse the cmdlet MAML files yourself, which is what those two cmdlets do.