#vserver/peer/accept API - Peering Many Vservers with the same name is very clunky

1 messages · Page 1 of 1 (latest)

flint cosmos
#

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:

  1. Peer clusters based on src + dest intercluster addresses (this is always unique)
  2. Peer vservers (this is always a src of fsx and a dest of fsx)

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).

#

Could this process/API be fixed please so that users can peer sources with the same name to a destination with the same named vserver? Using the name only (which it generates!!) seems like a bad decision when you have UUID and peer-cluster to ensure the correct two vservers peer.

dark rampart
#

What specific API are you using? Does it not have the option to specific UUID? I thought more did than did not.

flint cosmos
#

This is all the svm/peers API. I'm using Ansible to interact with the API. Specifically, I'm using the rest_cli module (as the vserver peer module cannot handle two svms with the same name - I plan on raising this with the Ansible team once the API has these options).

Part 1 - Initiating the peer

      body: {vserver: "{{ vserver_name }}", peer-vserver: "{{backup_vserver_name}}", applications: [snapmirror], peer-cluster: "{{backup_cluster_info.ontap_info.cluster.name}}", local-name: "{{ netapp_backup_cluster }}"}
      verb: 'POST'```
Part 2 - Accepting the peer
```      command: vserver/peer/accept
      body: {vserver: "{{ backup_vserver_name }}", peer-vserver: "{{vserver_name}}.1", local-name: "{{ item }}"}
      verb: 'POST'```
The only options accepted in the body of the accept are `vserver` and `peer-vserver`  (plus obviously local name which "corrects" the incorrect name). I cannot specify `peer-cluster` in the accept.
#

The API documentation is a little lacking for this, or I'm doing something wrong...

#

You can see my "{{vserver_name}}.1" variable in "Part 2", this is because the cluster appends .1 to the end if the source/dest names are both the same. Problem is, I'm doing this in parallel lots of times, so it creates .2, then .3, then .4 etc. Right now I have to serialise all of this so I can guarantee that each vserver peer gets a .1 every time (then gets renamed during the accept with local-name)

#

Look at the options available. If I run "vserver peer create" 10 times (with 10 svms called "fsx" in the source, and 10 svms called "fsx" in the destination), then try to run "vserver peer accept" 10 times, I wouldn't have any way determine what I'm peering because the cluster creates it's own name instead of using peer-cluster as part of the accept.

#

The Netapp documentation I linked to even has a description of the exact scenario I'm describing. It states "peer Vserver name is locally refered by unique system generated name" - how can I code around something like this?