Microsoft Virtualization Discussions

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

aschneider146

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

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

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public