Microsoft Virtualization Discussions

Wildcards for Snapshot names

gavin_meadows

Does the ONTAP powershell toolkit support the use of wildcards when specifying a snapshot name?

eg - if i want to create a flexclone from a SME snapshot with a time/date included in the name.  There will only ever be one snapshot per volume that ends _Weekly.

So I was wondering if i could use a wildcard like:

New-NaVolClone -CloneVolume vol_Server_DB1_NDMP -ParentVolume vol_Server_DB1 -ParentSnapshot

exchsnap__Server_DB1_*_Weekly -SpaceReserve none

*the wildcard is replacing the time and date within the snapshot name.

cheers

1 ACCEPTED SOLUTION

gavin_meadows

I found a solution to this myself using a variable in case anyone was wondering:

$Weeklysnapshot = Get-NaSnapshot VOLUME | Where-Object {$_.Name –match “Weekly”}

New-NaVolClone -CloneVolume VOLUME_CLONE-ParentVolume VOLUME -ParentSnapshot $Weeklysnapshot -SpaceReserve none

Although this will serve my needs it is relient on there only ever being 1 snapshot per volume with "weekly" in its name.  I'm making good headway with passing the actual snapshot names from SME into a similar script - a much more elegant solution me thinks!

View solution in original post

2 REPLIES 2

gavin_meadows

I found a solution to this myself using a variable in case anyone was wondering:

$Weeklysnapshot = Get-NaSnapshot VOLUME | Where-Object {$_.Name –match “Weekly”}

New-NaVolClone -CloneVolume VOLUME_CLONE-ParentVolume VOLUME -ParentSnapshot $Weeklysnapshot -SpaceReserve none

Although this will serve my needs it is relient on there only ever being 1 snapshot per volume with "weekly" in its name.  I'm making good headway with passing the actual snapshot names from SME into a similar script - a much more elegant solution me thinks!

View solution in original post

SomeGuy

I have been trying to figure out how to pick the most recent snapshot created by SMO to make a clone out of. This might work if I can get the DBAs to add a job that is monthly.


It would be nice to have some sort of option to do wildcards and most recent for chosing a snapshot to back a clone, that would make things even easier.

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