Giter VIP home page Giter VIP logo

Comments (6)

rawstorage avatar rawstorage commented on June 3, 2024

Hi, the error doesn't appear to be one with idempotency but that the initiator is already in a host. Have you verified that the initiator is not part of a host with a different name.?

from ansible-powermax.

rawstorage avatar rawstorage commented on June 3, 2024

run1

run2
error

I'm able to reproduce this issue easily but it's not an idempotency issue, the error is due to initiator being in another host. See images.

from ansible-powermax.

rawstorage avatar rawstorage commented on June 3, 2024

Hi @remkolodder, can you confirm that this was your issue and close the issue?

from ansible-powermax.

remkolodder avatar remkolodder commented on June 3, 2024

Hi Paul,

I will be checking this today. Cannot confirm this yet.

from ansible-powermax.

remkolodder avatar remkolodder commented on June 3, 2024

Hi Paul,

We figured out the issues, we are re-using existing machines with a different name in the current powermax setup. they are prefixed with a prefix, and when redeploying such a machine we expected the hosts part to rename the host(s).

That doesn't happen so we work around it by sniffing the log message, if the machine is already there, we do a different task and rename it.

That looks like this:

- name: "Create PowerMax host"
  when: (host.split('.')[0]) not in powermax_host_facts.Hosts
  dellemc.powermax.dellemc_powermax_host:
    unispherehost: "{{ host }}"
    universion: "{{ version }}"
    verifycert: "{{ verifycert }}"
    serial_no: "{{ serial }}"
    user: "{{ username }}"
    password: "{{ password }}"
    host_name: "{{ host.split('.')[0] }}"
    host_type: "default"
    state: "present"
    initiator_state: "present-in-host"
    initiators: "{{ initiators }}"
  register: host_add
  failed_when: >
    (host_add.msg is defined) and
    'is already part of a host' not in host_add.msg

- name: Rename host
  when: >
    (host_add.msg is defined) and
    'is already part of a host' in host_add.msg
  dellemc.powermax.dellemc_powermax_host:
    unispherehost: "{{ host }}"
    universion: "{{ version }}"
    verifycert: "{{ verifycert }}"
    serial_no: "{{ serial }}"
    user: "{{ username }}"
    password: "{{ password }}"
    host_name: "ig_{{ (host.split('.')[0] | replace('-', '_')) }}"
    new_name: "{{ host.split('.')[0] }}"
    state: "present"

Thanks for your efforts, it would be great when we can auto rename something but we can work around it like this as well :)

from ansible-powermax.

rawstorage avatar rawstorage commented on June 3, 2024

from ansible-powermax.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.