Microsoft Virtualization Discussions

Wildcards for Snapshot names

gavin_meadows
3,784 Views

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
3,784 Views

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
3,785 Views

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!

SomeGuy
3,489 Views

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.

Public