#Ontap S3 Snapmirror via ansible or REST

1 messages · Page 1 of 1 (latest)

placid jackal
#

Anybody created ansible or REST automations to create S3 Snapmirror relationships? I've been working on building an ansible playbook to provision new buckets in the production and DR side, and create/initialize the S3 Snapmirror relationship between the buckets. In the /doc/api I'm not seeing anything specific for snapmirroring buckets and the normal vol snapmirror doesn't talk about buckets either. I skimmed through the ansible netapp.ontap collection and it mostly seems like the same thing as the REST docs.

reef goblet
#

dunno about ansible and REST, but it definitely works from the CLI (even if it's undocumented). You have to use a special syntax for the SnapMirror destination. But it's not very useful since without a backup application you get no file index or selective restore or anything like that. It's basically a DR dump into S3

#

if you want to try it, create the object store config via snapmirror object-store config create -object-store-name foo ... and then use a destination-path of foo:/objstore/<subdir-name> for your SnapMirror.

placid jackal
reef goblet
#

"snapmirroring buckets" (aka "S3 SnapMirror") is something very different from "SnapMirror to cloud" (aka "SnapMirror to S3") though... yes, I know, the naming is not optimal

placid jackal
#

Got it figured out after capturing the api call that the gui was making and then digging through the api doc. Below is a curl of what I used to test. The idea is that you've already created the bucket on your production side, so the curl creates the destination side bucket and sets up the S3 Snapmirror relationship. Also I used the Ontap Automation: Getting Started with Ansible hands on lab for testing. Most of the labs don't have the S3 Snapmirror license but this one does. You do have to set up the cluster/svm peering but that is easy enough. curl -X POST "https://cluster1.demo.netapp.com/api/snapmirror/relationships?return_records=true&return_timeout=120" -H "accept: application/json" -H "authorization: Basic username:passwordbase64" -H "Content-Type: application/json" -d "{ \"create_destination\": { \"enabled\": true, \"size\": 107374182400, \"storage_service\": { \"enabled\": true, \"enforce_performance\": true, \"name\": \"value\" } }, \"destination\": { \"cluster\": { \"name\": \"cluster2\", \"uuid\": \"3665e5c2-edfb-11ed-b76b-005056b03bd8\" }, \"path\": \"s3lab-dr:/bucket/test2-dest\" }, \"policy\": { \"name\": \"Continuous\" }, \"source\": { \"path\": \"s3lab:/bucket/test2\" }, \"state\": \"snapmirrored\"}"