Bug 1695861

Summary: conversion host authentications should be associated with conversion hosts directly, not the associated resource
Product: Red Hat CloudForms Management Engine Reporter: Daniel Berger <dberger>
Component: V2VAssignee: Fabien Dupont <fdupont>
Status: CLOSED CURRENTRELEASE QA Contact: Shveta <sshveta>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.10.2CC: bthurber, fdupont, kkulkarn, mturley, ytale
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/ManageIQ/manageiq/pull/18309
Whiteboard: v2v
Fixed In Version: 5.11.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1702051 (view as bug list) Environment:
Last Closed: 2019-12-13 15:01:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: V2V Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1622728, 1702051    

Description Daniel Berger 2019-04-03 20:00:44 UTC
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.

Comment 2 Daniel Berger 2019-04-03 20:01:32 UTC
https://github.com/ManageIQ/manageiq/pull/18309

Comment 3 Daniel Berger 2019-04-16 17:33:40 UTC
https://github.com/ManageIQ/manageiq/pull/18634 (for Hammer)

Comment 5 Mike Turley 2019-04-23 15:28:14 UTC
PR #18634 is now replaced by https://github.com/ManageIQ/manageiq/pull/18673

Comment 7 Shveta 2019-07-02 21:33:44 UTC
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

Comment 8 Fabien Dupont 2019-07-04 06:11:55 UTC
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>

Comment 9 Shveta 2019-07-26 20:46:54 UTC
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>