dell / ansible-powerflex

Ansible Modules for Dell PowerFlex
Other
22 stars 15 forks source link

Error when adding standby_mdm to 1-node cluster #24

Closed tperrindell closed 1 year ago

tperrindell commented 1 year ago

Hello,

I am trying to install a powerflex with a maximum of automated tasks.

I managed to initiate a one-node cluster, and then I installed and setup a gateway to interface with it.

However, when trying to add standby nodes, I'm getting the following error :

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: slaves
fatal: [cop-pflex04 -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):
  File \"/home/runner/.ansible/tmp/ansible-tmp-1674509598.2062175-319-228748645774836/AnsiballZ_mdm_cluster.py\", line 107, in <module>
    _ansiballz_main()
  File \"/home/runner/.ansible/tmp/ansible-tmp-1674509598.2062175-319-228748645774836/AnsiballZ_mdm_cluster.py\", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \"/home/runner/.ansible/tmp/ansible-tmp-1674509598.2062175-319-228748645774836/AnsiballZ_mdm_cluster.py\", line 47, in invoke_module
    runpy.run_module(mod_name=ansible_collections.dellemc.powerflex.plugins.modules.mdm_cluster, init_globals=dict(_module_fqn=ansible_collections.dellemc.powerflex.plugins.modules.mdm_cluster, _modlib_path=modlib_path),
  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code
    exec(code, run_globals)
  File \"/tmp/ansible_dellemc.powerflex.mdm_cluster_payload_331_163c/ansible_dellemc.powerflex.mdm_cluster_payload.zip/ansible_collections/dellemc/powerflex/plugins/modules/mdm_cluster.py\", line 1338, in <module>
  File \"/tmp/ansible_dellemc.powerflex.mdm_cluster_payload_331_163c/ansible_dellemc.powerflex.mdm_cluster_payload.zip/ansible_collections/dellemc/powerflex/plugins/modules/mdm_cluster.py\", line 1334, in main
  File \"/tmp/ansible_dellemc.powerflex.mdm_cluster_payload_331_163c/ansible_dellemc.powerflex.mdm_cluster_payload.zip/ansible_collections/dellemc/powerflex/plugins/modules/mdm_cluster.py\", line 1199, in perform_module_operation
  File \"/tmp/ansible_dellemc.powerflex.mdm_cluster_payload_331_163c/ansible_dellemc.powerflex.mdm_cluster_payload.zip/ansible_collections/dellemc/powerflex/plugins/modules/mdm_cluster.py\", line 872, in add_standby_mdm
  File \"/tmp/ansible_dellemc.powerflex.mdm_cluster_payload_331_163c/ansible_dellemc.powerflex.mdm_cluster_payload.zip/ansible_collections/dellemc/powerflex/plugins/modules/mdm_cluster.py\", line 1107, in check_mdm_exists
  File \"/tmp/ansible_dellemc.powerflex.mdm_cluster_payload_331_163c/ansible_dellemc.powerflex.mdm_cluster_payload.zip/ansible_collections/dellemc/powerflex/plugins/modules/mdm_cluster.py\", line 1065, in check_ip_in_secondarys
KeyError: slaves
", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}

Which seems to indicate that the module is trying to check in the current set of slaves of the cluster if the IP is already present. As I only have one node in the cluster, the slaves key is empty, and might be the reason why this is throwing an error.

Then I added manually 2 nodes as standby mdms, and created a 3-node cluster, it worked fine, which makes me think that my analysis is correct.

Let me know if anything else is needed :)

Bhavneet-Sharma commented 1 year ago

Hi @tperrindell

Thank you for reporting the issue. We're able to reproduce this issue. We'll provide the fix for this issue in our upcoming release(i.e. 1.6.0).

anupamaloke commented 1 year ago

Fixed by #26