NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

ONTAP Discussions

get latest snapshot using ansible or cli

rlcwv
3,463 Views

I'm trying to get the latest snapshot for a volume using ansible or cli.  I already have a powershell script that will do just that but trying to move our scripts over to ansible.  I was using the na_ontap_info with snapshot_info but trying to run through all snapshots, putting them in a list with creation date and picking the newest, is very slow.  Just trying to find another way to pull that snapshot information.

 

Thanks everyone

2 REPLIES 2

NetApp_SR
3,232 Views

Hello,

I found the below link that describes finding the most recent snapshots. I see it uses na_ontap_info too but the application may be different than your approach to the problem. Please take a look and let me know what you think.

 

https://netapp.io/2020/10/12/advanced-topic-information-gathering-and-dynamic-use-with-na_ontap_info/

 

chenguanghui
1,538 Views

hello:

In the CLI you can add the "-fields" parameter to specify the relevant parameters about time, as some of the following article will help you.

https://docs.netapp.com/us-en/ontap-cli-98/volume-snapshot-show.html#description 

I hope to help you

Public