Each conversion host should have its own associated authentication. At the moment, the authentication is associated either with the underlying resource (Redhat) or the associated provider (Openstack). The latter is most problematic because it means if users want to upload a new SSH key, it will affect the whole provider.
https://github.com/ManageIQ/manageiq/pull/18309
https://github.com/ManageIQ/manageiq/pull/18634 (for Hammer)
PR #18634 is now replaced by https://github.com/ManageIQ/manageiq/pull/18673
I don't see any authentication associated with conversion host . Please check irb(main):017:0> host = Host.find(4) => #<ManageIQ::Providers::Redhat::InfraManager::Host id: 4, name: "env-rhv43-02.cfme2.lab.eng.rdu2.redhat.com", hostname: "env-rhv43-02.cfme2.lab.eng.rdu2.redhat.com", ipaddress: "10.8.197.93", vmm_vendor: "redhat", vmm_version: "7.6", vmm_product: "rhel", vmm_buildnumber: nil, created_on: "2019-06-30 20:12:25", updated_on: "2019-07-01 11:11:49", guid: "caf21053-c45c-4409-97a5-ba8bffe4d04f", ems_id: 53, user_assigned_os: nil, power_state: "on", smart: 1, settings: {}, last_perf_capture_on: nil, uid_ems: "6d6cccb2-9db0-416b-bdfb-7727ba3ac9b5", connection_state: "connected", ssh_permit_root_login: nil, ems_ref_obj: "--- \"/api/hosts/6d6cccb2-9db0-416b-bdfb-7727ba3ac9...", admin_disabled: nil, service_tag: nil, asset_tag: nil, ipmi_address: nil, mac_address: nil, type: "ManageIQ::Providers::Redhat::InfraManager::Host", failover: nil, ems_ref: "/api/hosts/6d6cccb2-9db0-416b-bdfb-7727ba3ac9b5", hyperthreading: nil, ems_cluster_id: 14, next_available_vnc_port: nil, hypervisor_hostname: nil, availability_zone_id: nil, maintenance: false, maintenance_reason: nil, physical_server_id: nil> irb(main):018:0> host.authentications.first => nil
Your test is wrong. The class Host represents hypervisors. The class for conversion hosts is ConversionHost. Here is an example: irb> ConversionHost.first.authentications.first => #<AuthPrivateKey id: 6000000000016, name: "rhelh09.v2v.bos.redhat.com", authtype: "v2v", userid: "root", password: nil, resource_id: 6000000000006, resource_type: "ConversionHost", created_on: "2019-07-02 14:54:02", updated_on: "2019-07-02 14:57:20", last_valid_on: nil, last_invalid_on: nil, credentials_changed_on: nil, status: nil, status_details: nil, type: "AuthPrivateKey", auth_key: "v2:{FtdyXiu9zqpamjgjLj3Th7tLgvO9HeEHPekhyqCtRE4Nti...", fingerprint: nil, service_account: nil, challenge: nil, login: nil, public_key: nil, htpassd_users: [], ldap_id: [], ldap_email: [], ldap_name: [], ldap_preferred_user_name: [], ldap_bind_dn: nil, ldap_insecure: nil, ldap_url: nil, request_header_challenge_url: nil, request_header_login_url: nil, request_header_headers: [], request_header_preferred_username_headers: [], request_header_name_headers: [], request_header_email_headers: [], open_id_sub_claim: nil, open_id_user_info: nil, open_id_authorization_endpoint: nil, open_id_token_endpoint: nil, open_id_extra_scopes: [], open_id_extra_authorize_parameters: nil, certificate_authority: nil, google_hosted_domain: nil, github_organizations: [], rhsm_sku: nil, rhsm_pool_id: nil, rhsm_server: nil, manager_ref: nil, options: nil, evm_owner_id: nil, miq_group_id: 6000000000001, tenant_id: 6000000000001>
irb(main):001:0> ConversionHost.first.authentications.first PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 => #<AuthPrivateKey id: 41, name: nil, authtype: "v2v", userid: "root", password: nil, resource_id: 1, resource_type: "ConversionHost", created_on: "2019-07-26 20:14:58", updated_on: "2019-07-26 20:15:31", last_valid_on: nil, last_invalid_on: nil, credentials_changed_on: nil, status: nil, status_details: nil, type: "AuthPrivateKey", auth_key: "v2:{4krU5HF3iz7tBEOgTOK2fIEZEQnitZbRKdN1VLQuJozHVU...", fingerprint: nil, service_account: nil, challenge: nil, login: nil, public_key: nil, htpassd_users: [], ldap_id: [], ldap_email: [], ldap_name: [], ldap_preferred_user_name: [], ldap_bind_dn: nil, ldap_insecure: nil, ldap_url: nil, request_header_challenge_url: nil, request_header_login_url: nil, request_header_headers: [], request_header_preferred_username_headers: [], request_header_name_headers: [], request_header_email_headers: [], open_id_sub_claim: nil, open_id_user_info: nil, open_id_authorization_endpoint: nil, open_id_token_endpoint: nil, open_id_extra_scopes: [], open_id_extra_authorize_parameters: nil, certificate_authority: nil, google_hosted_domain: nil, github_organizations: [], rhsm_sku: nil, rhsm_pool_id: nil, rhsm_server: nil, manager_ref: nil, options: nil, evm_owner_id: nil, miq_group_id: 1, tenant_id: 1, become_username: nil, become_password: nil, auth_key_password: nil> irb(main):002:0> ConversionHost.second.authentications.first => #<AuthPrivateKey id: 42, name: nil, authtype: "v2v", userid: "root", password: nil, resource_id: 2, resource_type: "ConversionHost", created_on: "2019-07-26 20:15:40", updated_on: "2019-07-26 20:16:10", last_valid_on: nil, last_invalid_on: nil, credentials_changed_on: nil, status: nil, status_details: nil, type: "AuthPrivateKey", auth_key: "v2:{4krU5HF3iz7tBEOgTOK2fIEZEQnitZbRKdN1VLQuJozHVU...", fingerprint: nil, service_account: nil, challenge: nil, login: nil, public_key: nil, htpassd_users: [], ldap_id: [], ldap_email: [], ldap_name: [], ldap_preferred_user_name: [], ldap_bind_dn: nil, ldap_insecure: nil, ldap_url: nil, request_header_challenge_url: nil, request_header_login_url: nil, request_header_headers: [], request_header_preferred_username_headers: [], request_header_name_headers: [], request_header_email_headers: [], open_id_sub_claim: nil, open_id_user_info: nil, open_id_authorization_endpoint: nil, open_id_token_endpoint: nil, open_id_extra_scopes: [], open_id_extra_authorize_parameters: nil, certificate_authority: nil, google_hosted_domain: nil, github_organizations: [], rhsm_sku: nil, rhsm_pool_id: nil, rhsm_server: nil, manager_ref: nil, options: nil, evm_owner_id: nil, miq_group_id: 1, tenant_id: 1, become_username: nil, become_password: nil, auth_key_password: nil>