#REST API produces different result than ZAPI when doing MCC stuff

1 messages · Page 1 of 1 (latest)

nova cliff
#

I will have to post code and output so i will break this up into multiple messages. Basically MCC related commands should work pre MCC but they dont when using REST. For example

This works using CLI and the Ansible na_ontap_command module which is zapi. If you try this same command via REST it complains that an MCC isnt configured
metrocluster configuration-settings dr-group create -partner-cluster Cluster_B -local-node n1 -remote-node n3

REST error: "Error: {'message': 'MetroCluster configuration has not been done. Run "metrocluster show" to verify if MetroCluster is configured', 'code': '2425840'

This command runs via CLI and ZAP but using REST generates the same error
metrocluster configuration-settings interface create -cluster-name Cluster_A -home-node n1 -home-port e1a -address 72.16.1.101 -netmask 255.255.255.0

REST error: "Error: {'message': 'MetroCluster configuration has not been done. Run "metrocluster show" to verify if MetroCluster is configured', 'code': '2425840'

#

This doesnt work since its a REST only module

    - name: Create MetroCluster DR group REST
      netapp.ontap.na_ontap_metrocluster_dr_group:
        dr_pairs:
          - node_name: "{{cluster[0].nodes[0].name }}"
            partner_node_name: "{{cluster[1].nodes[0].name}}"
        partner_cluster_name: "{{ cluster[1].name }}"
        hostname: "{{ cluster[0].cluster_mgmt }}"
        https: true
        validate_certs: false

This works since its zapi

    - name: Create DR group using CLI zapi
      netapp.ontap.na_ontap_command:
        hostname: "{{ cluster[0].cluster_mgmt }}"
        command: ['metrocluster',"configuration-settings","dr-group","create","-partner-cluster", "{{ cluster[1].name }}", "-local-node", "{{cluster[0].nodes[0].name }}","-remote-node","{{cluster[1].nodes[0].name}}"]
#

This works ZAPI

    - name: CREATE METRCLUSTER INTERCONNECT INTERFACES primary site lif 1
      netapp.ontap.na_ontap_command:
        hostname: "{{ cluster[0].cluster_mgmt }}"
        command: 
          - "metrocluster"
          - "configuration-settings"
          - "interface"
          - "create"
          - "-cluster-name"
          - "{{ cluster[0].name }}"
          - "-home-node"
          - "{{ item.name }}"
          - "-home-port"
          - "{{ item.cluster_ports[0].clus_port }}"
          - "-address"
          - "172.16.1.{{my_idx + 101}}"
          - "-netmask"
          - "255.255.255.0"
      loop: "{{cluster[0].nodes}}"
      loop_control:
        index_var: my_idx
#

This DOESNT work REST

    - name: CREATE METRCLUSTER INTERCONNECT INTERFACES cluster 1 lif 2
      netapp.ontap.na_ontap_rest_cli:
        hostname: "{{ item.mgmt_ip }}"
        command: metrocluster/configuration-settings/interface
        verb: POST
        body:
          cluster_name: "{{ cluster[0].name }}"
          home_node: "{{ item.name }}"
          home_port: "{{ item.cluster_ports[1].clus_port }}"
          address: 172.16.2.{{my_idx + 101 }}  # Assuming clus_ip is within nodes
          netmask: "255.255.255.0"
      loop: "{{cluster[0].nodes}}"
      loop_control:
        index_var: my_idx
#

Always error Metrocluster isnt configured