Can't use a SnapShotInfo object directly when creating a new Clone
2010-07-30 10:21 AM
I have a function that finds a snapshot and uses it to create a FlexClone, which looks like this
$snapShot = Get-NaSnapshot -Name $volume -SnapName *recent
$clone = New-NaVolClone -ParentVolume $volume -CloneVolume $cloneVolume `
-ParentSnapshot ($snapshot.name) `
When I call New-NaVolClone, I have to specify -Snapname ($snapshot.name) rather than just passing in $snapshot.
What I think would be really useful is if there was an Override for the ToString() method on the NetApp.Ontapi.Filer.Snapshot.SnapshotInfo class so that it would display the name of the snapshot.
I think the same would be true for all the *info types, particularly VolumeInfo and LunInfo.
1 REPLY 1
Re: Can't use a SnapShotInfo object directly when creating a new Clone
2010-07-31 02:22 PM
It accepts pipeline by property name. Since a ParentSnapshot name property doesn't exist on a snapshot infobject, you'll want to take your $Snapshot object and add a "ParentSnapshot property by aliasing Name.