Updating snapshot expiration

420 views
Skip to first unread message

Donald King

unread,
May 12, 2017, 1:01:10 PM5/12/17
to Isilon Technical User Group
Hi all.

We initially set up our SyncIQ to retain 12 months of snapshots.  My employer is not requiring me to keep 24 months of snapshots.  My target cluster is big enough for this.  I updated the policies, but I know that does not update the snapshots already take.  I can via command line update the snapshot expiration date for a snapshot expiring soon, using the command below:

isi snapshot snapshots modify --snapshot=54476 --expires=2019-05-13T00:01:16

Has anyone tackled this systematically?  Scripting a way to search for soon to expire snapshots, then changing them by adding a couple of years?

Tanks much.

afowler

unread,
Jun 22, 2017, 11:17:35 AM6/22/17
to Isilon Technical User Group
Not sure if you ever got an answer to your question.  The following command would probably work:

for a in `isi snapshot snapshots list --format=csv --no-footer --no-header|cut -d ',' -f 1`; do isi snapshot snapshots modify $a --expires=2019-05-13T00:01:16; done


Granted now you probably have a handful of snapshots which won't apply to that date now, but this would work if you wanted to modify all of them.

Robert Chang

unread,
Jun 22, 2017, 1:43:35 PM6/22/17
to Isilon Technical User Group
Also maybe consider using the OneFS API if this is something you'd be doing repeatedly.


Snapshots resource

Create, modify, delete, or retrieve information about file system snapshots.

Operation
Method and URI
Get a list of all snapshots
GET <cluster-ip:port>/platform/1/snapshot/snapshots
Get a single snapshot
GET <cluster-ip:port>/platform/1/snapshot/snapshots/<id|snapshot name>
Create a snapshot
POST <cluster-ip:port>/platform/1/snapshot/snapshots
Modify a snapshot
PUT <cluster-ip:port>/platform/1/snapshot/snapshots/<id|snapshot name>
Delete all snapshots
DELETE <cluster-ip:port>/platform/1/snapshot/snapshots
Delete a snapshot
DELETE <cluster-ip:port>/platform/1/snapshot/snapshots/<id|snapshot name>
View the detailed JSON schema for this resource, which has information about query parameters and object properties.
GET <cluster-ip:port>/platform/1/snapshot/snapshots/<id|snapshot name>?describe
GET <cluster-ip:port>/platform/1/snapshot/snapshots?describe
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

afowler

unread,
Jun 22, 2017, 4:25:01 PM6/22/17
to Isilon Technical User Group
The API is a great resource for tasks like this too.  Feel free to use the script attached as a template for future scripts.  What the one attached will do is to modify all existing snapshot expirations so that they expire 2 years after their creation.  Use script at own risk, and please test first in non-prod environment.  You'll have to save it as a .ps1. 
modify_snapshot_expiration.txt
Reply all
Reply to author
Forward
0 new messages