Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: powerstore.host cannot manage state #29

Open
jason-technology opened this issue May 31, 2023 · 2 comments
Open

[BUG]: powerstore.host cannot manage state #29

jason-technology opened this issue May 31, 2023 · 2 comments
Labels
needs-triage Triage required type/bug Something isn't working

Comments

@jason-technology
Copy link

Describe the bug
powerstore.host works fine to create hosts. If the playbook is run a second time to confirm / validate state, it errors out that the port name is already in use.

To Reproduce
Steps to reproduce the behavior:

  1. Step 1 run playbook to configure a new host
  2. Step 2 run playbook again to verify state
  3. Step 3 observe error
    ...
    n. Step n See error

Expected behavior
I expect that if the host exists as described that the module would return "OK" rather than error out.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
If applicable, submit logs or stack traces from the affected services

System Information (please complete the following information):

  • OS/Version: Ubuntu 20
  • Ansible Version 2.13
  • Python Version 3.8.10
  • Powerstore SDK and Galaxy Collection: Latest

Additional context
Actual Error:
Bad request: One of ther provided poret names is already registered with another host

@jason-technology jason-technology added needs-triage Triage required type/bug Something isn't working labels May 31, 2023
@Jennifer-John
Copy link
Collaborator

Hi @jason-technology ,

I tried to reproduce the issue and idempotency seems to work for the ports registered to the host, the error seems to be displayed only when the port is already registered to a different host. Could you please share the playbook and the log trace from ansible_powerstore.log, generated in same location as playbook for us to debug further?

Thanks,
Jennifer

@glin-s6
Copy link

glin-s6 commented Mar 28, 2024

Hey! I'm running into this as well. I've noticed that it's not host creation but rather when adding initiators to a host. I've tried adding the initiator in the same block that I'm creating the host and also tried adding the initiator after the host has been created. The host creation is idempotent but the initiator adding isn't.

This is an example of the latter.

- name: Create host
  delegate_to: 127.0.0.1
  register: iscsi_host
  dellemc.powerstore.host:
    array_ip: "{{powerstore_ip}}"
    validate_certs: false
    user: "{{powerstore_username}}"
    password: "{{powerstore_password}}"
    host_name: "{{inventory_hostname}}"
    os_type: "Windows"
    state: "present"

- name: Attach iSCSI initiator to host
  delegate_to: 127.0.0.1
  dellemc.powerstore.host:
    array_ip: "{{powerstore_ip}}"
    validate_certs: false
    user: "{{powerstore_username}}"
    password: "{{powerstore_password}}"
    host_name: "{{inventory_hostname}}"
    os_type: "Windows"
    initiators:
      - "iqn.1991-05.com.microsoft:{{inventory_hostname}}"
    initiator_state: "present-in-host"
    state: "present"

I get the following error message

"msg": "Adding initiators ['iqn.1991-05.com.microsoft:colo-HOST2-compile-executor-0'] to host colo-HOST2-compile-executor-0 failed with error HTTP code: 400, Bad Request [{'messages': [{'code': '0xE0A01001002D', 'severity': 'Error', 'message_l10n': 'One of the provided port names is already registered with another host. Please use port names unique to all hosts.'}]}]", "status_code": "400".

I'm confirmed that the initiator I'm attempting to add is the same initiator that's already added to the host. In fact, the ansible output from the create host shows that the initiator is the same.

"initiators": [
            {
                "active_sessions": [
                    {
                        "appliance_id": "A1",
                        "bond_id": null,
                        "eth_port_id": "bbf150c4220b4ca0b268ec61a420fca2",
                        "fc_port_id": null,
                        "node_id": "446869f28a9b40038bb54f4c49c67bf8",
                        "nvme_transport_addresses": null,
                        "nvme_transport_type": null,
                        "port_name": "iqn.2015-10.com.dell:dellemc-powerstore-apx00234306700-a-2a9eb685",
                        "veth_id": null
                    }
                ],
                "chap_mutual_username": null,
                "chap_single_username": null,
                "id": "fd4b8ced-542c-4fa2-9475-2cd4d5d5646d",
                "port_name": "iqn.1991-05.com.microsoft:colo-host2-compile-executor-0",
                "port_type": "iSCSI"
            }
        ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Triage required type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants