ManageIQ / manageiq-providers-vmware

ManageIQ plugin for the VMware vSphere and vCloud providers.
Apache License 2.0
22 stars 70 forks source link

Unable to validate 'default' credentials for esxi host "uninitialized constant ManageIQ::Providers::Vmware::InfraManager::HostEsx::Handsoap" #847

Closed sharkos-dizzion closed 1 year ago

sharkos-dizzion commented 1 year ago

I logged this in the main manageiq repo also; however, I believe it is related to this provider, speficially, this method: def verify_credentials_with_ws(auth_type = nil) in file: manageiq-providers-vmware/app/models/manageiq/providers/vmware/infra_manager/host_esx.rb

It seems to the the Handsoap ge or the way it is being called.

When adding 'root' user credentials for an esxi host in Infrastructure -> Hosts, ManageIQ returns an error when validating the connection:

uninitialized constant ManageIQ::Providers::Vmware::InfraManager::HostEsx::Handsoap

The same error does NOT occur when using these credentials in the "Remote Login" tab.

Log file entries are:
[----] I, [2023-01-06T11:34:41.342042 #2510:b386c]  INFO -- evm: MIQ(ManageIQ::Providers::Vmware::InfraManager::HostEsx#with_provider_connection) Connecting through ManageIQ::Providers::Vmware::InfraManager::HostEsx: [esxi1000.local]
[----] E, [2023-01-06T11:34:41.346253 #2510:b386c] ERROR -- evm: MIQ(host_controller-update): uninitialized constant ManageIQ::Providers::Vmware::InfraManager::HostEsx::Handsoap

This is preventing proper operation of Smart State Analysis.

sharkos-dizzion commented 1 year ago

Fresh deployment of MIQ Vmware vsphere ova. From about page:

najdorf-1.3.20220715135859_39a22e6

sharkos-dizzion commented 1 year ago

Tried new OVA, same error on oparin-1.1-20230105135506_44ec8c4

vsphere 7.0.3.01100 esxi 6.7.0, 20491463

sharkos-dizzion commented 1 year ago

I applied the require 'handsoap' line as a hotfix, as noted in #848 ; however this leads to a new bug:

#<NameError: undefined local variable or method 'port' for #<ManageIQ::Providers::Vmware::InfraManager::HostEsx

Here is the evm log snippet:

Jan 10 11:00:23 manageiq.sandbox-dizzion.usp evm[6561]: DEBUG -- evm: MIQ(Rbac::Authorizer#role_allows?) Auth successful for user 'admin', role 'EvmRole-super_administrator', feature identifier 'host_edit'
Jan 10 11:00:23 manageiq.sandbox-dizzion.usp evm[6561]:  INFO -- evm: MIQ(ManageIQ::Providers::Vmware::InfraManager::HostEsx#with_provider_connection) Connecting through ManageIQ::Providers::Vmware::InfraManager::HostEsx: [esxi1000]
Jan 10 11:00:23 manageiq.sandbox-dizzion.usp evm[6561]:  WARN -- evm: MIQ(ManageIQ::Providers::Vmware::InfraManager::HostEsx#verify_credentials_with_ws) #<NameError: undefined local variable or method `port' for #<ManageIQ::Providers::Vmware::InfraManager::HostEsx id: 2, name: "esxi1000", hostname: "esxi1000", ipaddress: "<hidden>", vmm_vendor: "vmware", vmm_version: "6.7.0", vmm_product: "ESXi", vmm_buildnumber: "20491463", created_on: "2023-01-09 16:04:45.881697000 -0500", updated_on: "2023-01-10 10:55:11.549422000 -0500", guid: "173a3345-75ef-4e52-a05d-8e111ccb265a", ems_id: 3, user_assigned_os: nil, power_state: "on", smart: 1, settings: {}, last_perf_capture_on: "2023-01-10 10:55:00.000000000 -0500", uid_ems: "esxi1000", connection_state: "connected", ssh_permit_root_login: nil, admin_disabled: false, service_tag: "S291441X1219327", asset_tag: "IBM SoftLayer", ipmi_address: "", mac_address: "", type: "ManageIQ::Providers::Vmware::InfraManager::HostEsx", failover: nil, ems_ref: "host-29", hyperthreading: true, ems_cluster_id: 1, next_available_vnc_port: nil, hypervisor_hostname: nil, availability_zone_id: nil, maintenance: false, maintenance_reason: nil, physical_server_id: nil, ems_ref_type: "HostSystem">>
Jan 10 11:00:23 manageiq.sandbox-dizzion.usp evm[6561]: ERROR -- evm: MIQ(host_controller-update): Unexpected response returned from system, see log for details
agrare commented 1 year ago

Hey @sharkos-dizzion yes I ran into the same issue last night so I opened https://github.com/ManageIQ/manageiq-providers-vmware/pull/849 to resolve

sharkos-dizzion commented 1 year ago

@agrare Thank you, I will apply that fix as well and test.

sharkos-dizzion commented 1 year ago

The 'validate' step passes; however, the UI still shows the Authentication status as Error for the default credential. Smart state analysis also fails: [Provide credentials for this VM's Host to perform SmartState Analysis], aborting job

Jan 10 11:36:22 manageiq.sandbox-dizzion.usp evm[7058]:  INFO -- evm: Q-task_id([job_dispatcher]) MIQ(ManageIQ::Providers::Vmware::InfraManager::Scanning::Job#process_finished) job finished, No eligible proxies for VM :[[88888-INFRA01-NFS4IO] 88888-ADMINHOST02.88888-Sanbox.USP/88888-ADMINHOST02.88888-Sanbox.USP.vmx] - [Provide credentials for this VM's Host to perform SmartState Analysis], aborting job [756d0424-2811-48f8-9fbb-a55922e002db].
Jan 10 11:36:22 manageiq.sandbox-dizzion.usp evm[7058]:  INFO -- evm: Q-task_id([job_dispatcher]) MIQ(ManageIQ::Providers::Vmware::InfraManager::Scanning::Job#dispatch_finish) Dispatch Status is 'finished'

The VM is on a host with credentials that passed validation, but show as Authentication status error