Hi,
I'm automating creating lots of cluster and vserver peers at once using Ansible and the REST API on FSx. I have an architecture whereby I provision as many primary filesystems as needed in an AWS account, but I do not necessarily provision a unique secondary cluster for every primary. I could have a scenario where I have 10 primary clusters and 1 secondary.
All of my clusters have a vserver called fsx. I'm not assigning a unique SVM name to each FSx Filesystem/ONTAP instance. Having fsx as the vserver name helps simplify the rest of my automation.
My flow works as following:
- Peer clusters based on src + dest intercluster addresses (this is always unique)
- Peer vservers (this is always a src of
fsxand a dest offsx)
Creating Vserver Peers involves a two step process. The first is the vserver/peer API which uses the cluster name (filesystem-id for FSx - always unique) AND vserver name to determine which cluster to peer with. I initiate this from each primary system, so peer-cluster is always my assigned secondary filesystem. vserver-name is always fsx. I am unable to supply a local-name at this point.
The second step is the vserver/peer/accept API which ONLY uses the vserver-name variable to authorise (specifying peer-cluster is not possible) . I can assign a local-name here (which I'm doing), but by this time it has already generated its own name (often fsx.1, fsx.2 etc. because the destination vserver is the same as the source, and I'm peering 10 at once). This makes my automation difficult as I cannot predict the name the cluster will assign (and I cannot specify), and it does not use the peer-cluster option to validate. ONTAP just appends a number to the end of the vserver (which could be anything).