dell / ansible-unity

Ansible Modules for Dell Unity
GNU General Public License v3.0
26 stars 21 forks source link

dellemc_unity_host Adding new host with new initiators fails #8

Open nurseandthenerd opened 3 years ago

nurseandthenerd commented 3 years ago

I'm trying to create a new host with initiators that have not been logged into the array yet. I keep getting error - Invalid initiator passed. I am able to create the host manually through the GUI using the same initiators.

It looks like line 629 of dellemc_unity_host.py gets a list of initiators from the array and if the initiator supplied to the module is not in the list it errors out. I know for a fact the the initiators haven't been logged into the array yet because the hosts are boot from san. i'm trying to add the hosts to the array first so i can get the boot luns ready to go at first boot of the host. I tried changing log.error on that lookup to log.warn and comment out the failure. after that the module continued.

I then got an error that the "Initiator 'id' mapped to another host". This looks to be coming from the get_list_unmapped_initiators() function. i did verify on the array that the initiators i'm using do not exists anywhere on the array.

Any help would be greatly appreciated.

Thanks, Patrick

nurseandthenerd commented 3 years ago

I also fully zoned the host to the array and the initiators showed up in the initator path list in the gui. they were listed as not being connected to a host. i still got the initiator mapped to another host error.

nurseandthenerd commented 3 years ago

Upon further review it looks like the array needs to see the initiators before it will let you add them to a host. Our hosts have 4 hbas. two for boot, and two for data. when all 4 hbas are zoned to the unity array and powered on only the boot hbas log into the array. i was able to add the host with only the boot initiators after the host was powered on.

I still need to be able to add initiators regardless if the array has them logged in or not.

rajendraindukuri commented 3 years ago

Hi @nurseandthenerd ,

Thanks for writing to us. As you mentioned, we use the api in line no 629 to fetch the list of initiators (which is a SDK method) and that returns only the initiators which are logged in which is a prerequisite as per our design.

Also as per our design , when a customer passes a list of components and some of them are invalid, we fail the operation and give a error message. Customer needs to identify and remove the invalid entries and retry the operation. Basically we do not process partially valid inputs.

Let us know if you need more details.

Thanks Rajendra

nurseandthenerd commented 3 years ago

Ok. I just knew that both the web UI, and the API would allow you to create an initiator regardless of if the initiator has been logged into the array. I was hoping the module would support that as well. Right now i'm using the ansible URI module and the the API directly. There is just a lot of logic involved with that way of doing things that i was hoping this module would handle. I only create the initiator if it doesn't exist and associate it to the host/update it if it does.

If that isn't in the design of this module we can go ahead and close out this issue, and i will keep using the API directly.

Thanks, Patrick

okostadinov-hs commented 2 years ago

Hi,

I am having the same issue. My automation workflow requires the Host to be set up on the Unisphere side, along with the Initiator before the actual host can connect to the target, which does not work with this module. Please fix this.

smitty-dell commented 2 years ago

I ran into this problem, and would love for the feature to not check against known initiators. For now, I use the shell command and run the uemcli command to add the initiator instead. Not the best solution for sure.

anupamaloke commented 2 years ago

@nurseandthenerd, @smitty-dell, this issue has been fixed in the latest 1.3.0 release. Could you please try it out with the new collection version and let us know whether you are still running into this issue?

Version 1.3.0 - released on 25/03/22 Enhanced host module to support listing of network addresses, FC initiators, ISCSI initiators and allocated volumes of a host Enhance host module to support add/remove network address to/from a host. Enhanced host module to support both mapping and un-mapping of non-logged-in initiators to host.

nurseandthenerd commented 2 years ago

just tested everything out and only found one bug. I had a host that had previously been created, but with out a description. I used the module on the existing host but with a description this time. I did update the description on the host, but the module returned back green with a status of OK to the console instead of Yellow and changed when it did make a change to the host.