Microsoft Virtualization Discussions

Can't use a SnapShotInfo object directly when creating a new Clone

aschneider146
3,007 Views

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) `
                        -SpaceReserve none

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.

Thanks,

Andy

1 REPLY 1

fjohn
3,007 Views

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.

J

Public