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
vmware_host_vmhba_facts and vmware_host_vmhba_info truncate WWN of FC HBA #63045
Comments
Files identified in the description:
If these files are inaccurate, please update the |
@Jon-Rausch, just so you are aware we have a dedicated Working Group for vmware. |
Bug is in the code that adds colons and number formatting in the module. If I remove the self.format_number I get the original decimal notation without truncation. Below is the offending code: try:
I |
The code could be fixed by converting the number to HEX in the initial pull of hba.portWorldWideName and stripping out the leading 0x and trailing L associated with the conversion, before sending it to the format_number. Below is the code modification that should be done in the module: try: |
That same code change should be done for the "node_wwn" values as well |
@Jon-Rausch Thanks for the debugging and providing this useful insights. |
The Ansible bot incorrectly marked this as depreciated version and ansible version 2.8. It's actually in the current module version vmware_host_vmhba_info and an active bug still in version 2.10. |
Found that the node WWN information for SAS onboard controllers is in hex format already and fails on an attempted conversion with a typeerror. Edited the code below to attempt a conversion and to run the formatting (adding ":") if the conversion to hex fails due to a typeerror. The portWWN was never in hex from the FiberChannel controllers, so it didn't require this check. Still waiting on someone with more programming experience to fix and update this module, which has never returned any correct WWPN data since it was created.
|
@sky-joker Can you please help here since I don't have hardware for FC HBA? Thanks. |
@Akasurde, The same phenomenon was reproduced in my lab environment. The following is the result of got node_wwn and port_wwn without using
The following is the result of got node_wwn and port_wwn using
|
@sky-joker Thanks for taking a look into this. |
resolved_by_pr #66692 |
@Jon-Rausch, Could you please check PR #66692 and let us know if it works for you ? |
Fixes ansible#63045 add flagments file
This looks a lot better now. |
SUMMARY
vmware_host_vmhba_facts module returns the decimal formatted WWN/WWPN of the FiberChannel HBA, but truncates the last digit, making it impossible to convert to hex or determine the real HBA WWPN for zoning/mapping. even the help text of the module on the https://docs.ansible.com/ansible/latest/modules/vmware_host_vmhba_facts_module.html site displays the truncated value that is useless.
ISSUE TYPE
COMPONENT NAME
vmware_host_vmhba_facts and vmware_host_vmhba_info modules
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
VMware ESXi, 6.7.0
VMWare ESXi, 6.5.0
QLogic 57840 10/20 Gigabit Ethernet Adapter "driver": "qfle3f",
CentOS7
ansible 2.8
ansible 2.10
STEPS TO REPRODUCE
gather HBA data from ESX servers using the vmware_host_vmhba_info or vmware_host_vmhba_facts modules. The output of the port_wwn and node_wwn are returned in decimal format with colon separation and truncated by one character. For Example, 11:53:10:06:16:15:36:94:72 should be 11:53:10:06:16:15:36:94:725. The colons are not needed since this is a decimal value, which may also be a module problem. They are even truncated in the example help text of the module (576496321590239521)!!! , showing this hasn't been tested properly since the beginning of module creation and has been a bug since inception! This same bug is present on the newest version of the module in ansbile 2.10 currently in development as well.
EXPECTED RESULTS
Expected the decimal number representation of the WWN returned by vmware to be returned in full so that it could be converted to HEX and to the actual WWPN/WWN for zoning/mapping/etc. port_wwn value should return enough digits to display the fiberchannel wwn in full.
ACTUAL RESULTS
The decimal formatted number is returned with a truncated last digit, making the value invalid and it cannot be converted to HEX format.
The text was updated successfully, but these errors were encountered: