Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
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
Solved! See The Solution
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!
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!
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.