Virtualization Articles and Resources

Read in snapshot schedules and modify without changing snap retentions

This may very well be easy for people who have been using powershell for a long time, but after a couple of weeks of use I was amazed by what I can achieve.

This will allow you to export current snapshot schedules on your volumes and then re-apply a different schedule WITHOUT modifying the retention times.

#Connect to a controller, get volumes from the controller, get snapshot schedules for said volumes, and export to a csv:

Connect-NaController Controller1 | get-navol | Get-NaSnapshotSchedule | Export-Csv -path d:\something.csv

#Import the csv reading in current values and assigning each column a label.

#For each object, create a new schedule by RE-USING 4 of the 5 available columns/data fields. Note how the Labels used are the current values previously #exported - hence the values aren't changed

import-csv d:\something.csv -header ("label1","label2","label3","label4","label5") | foreach {Set-naSnapshotschedule $_.label1 -Weeks $_.label2 -Days $_.label3 -Hours $_.label4 -Whichhours "1,2,3,4,5"}

Please Note:

All content posted on the NetApp Community is publicly searchable and viewable. Participation in the NetApp Community is voluntary.

In accordance with our Code of Conduct and Community Terms of Use, DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information (PII)
  • Copyrighted materials without the permission of the copyright owner

Continued non-compliance may result in NetApp Community account restrictions or termination.

All Community Forums