Description of problem: We encountered this CFME bug 1810122, that caused a RHV conversion host VM have it's IP addresses not reported (VM page, IP address field empty). Due to that configure this conversion host VM will work, but looking at it's ansible downloaded log, will show that it didn't actually run (see Ansible log attached). Need to add a check at the beginning of a "Configure conversion host VM", that this VM has at least one IP address (read from CFME inventory). Version-Release number of selected component (if applicable): CFME-5.11.4.1 RHV-4.3.7 Additional info: This bug might be relevant to Openstack too.
Created attachment 1667512 [details] ansible.log
https://github.com/ManageIQ/manageiq/pull/19927
*** Bug 1780110 has been marked as a duplicate of this bug. ***
*** Bug 1780034 has been marked as a duplicate of this bug. ***
New commit detected on ManageIQ/manageiq/ivanchuk: https://github.com/ManageIQ/manageiq/commit/855a87edb61e7c412617a923d0fec8b7af178c7b commit 855a87edb61e7c412617a923d0fec8b7af178c7b Author: Adam Grare <agrare> AuthorDate: Wed Mar 4 18:24:56 2020 +0000 Commit: Adam Grare <agrare> CommitDate: Wed Mar 4 18:24:56 2020 +0000 Merge pull request #19927 from fdupont-redhat/v2v_fail_chost_config_if_no_ip Configuration of conversion host without IP should fail early (cherry picked from commit df04518558c93a4240ce69af44d178a3cb0868cc) https://bugzilla.redhat.com/show_bug.cgi?id=1810135 app/models/conversion_host.rb | 1 + spec/models/conversion_host_spec.rb | 6 + 2 files changed, 7 insertions(+)
New commit detected on ManageIQ/manageiq/jansa: https://github.com/ManageIQ/manageiq/commit/5e3ed2da35f478bd8748bfa186e5717cc1f3409d commit 5e3ed2da35f478bd8748bfa186e5717cc1f3409d Author: Adam Grare <agrare> AuthorDate: Wed Mar 4 18:24:56 2020 +0000 Commit: Adam Grare <agrare> CommitDate: Wed Mar 4 18:24:56 2020 +0000 Merge pull request #19927 from fdupont-redhat/v2v_fail_chost_config_if_no_ip Configuration of conversion host without IP should fail early (cherry picked from commit df04518558c93a4240ce69af44d178a3cb0868cc) https://bugzilla.redhat.com/show_bug.cgi?id=1810135 app/models/conversion_host.rb | 1 + spec/models/conversion_host_spec.rb | 6 + 2 files changed, 7 insertions(+)
@Fabien, I had hard time to verify this bug. I tried to add a conversion host VM to CFME-5.11.5, via rest api, but this failed the ansible playbook on: "hosts": { "<VM IP address>": { "_ansible_no_log": false, "action": "yum", "changed": false, "failed": true, "failures": [ "No package nbdkit-plugin-python2 available.", "No package v2v-conversion-host-wrapper available." ], That is, I cannot reach the point where it fails on no conversion host VM IP address exist. Can you please advise how this bug can be verified on CFME-5.11.5.
Verified on CFME-5.11.5.1, according to discussion with Fabien D.: Conversion host VM network interface, that is used to connect to the VM, was put down by: ifdown eth0 I checked the interface in RHV is reported as down, and refreshed VM on CFME side, so that CFME also will not report this interface IP address. Configured this VM as a converison host via rest api: method: POST https://<CFME FQDN>/api/conversion_hosts { "action": "create", "resource": { "name": "conversion_host_vm_7", "auth_user": "cloud-user", "conversion_host_ssh_private_key": "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----", "max_concurrent_tasks": 10, "resource_id": "2", "resource_type": "ManageIQ::Providers::Redhat::InfraManager::Vm", "vmware_vddk_package_url": "<vddk image URL>", "address": "<VM IP address>" } } It failed on: "msg": "Failed to connect to the host via ssh: ssh: connect to host 10.1.41.18 port 22: No route to host" Which means that the bug is fixed, since before the fix, conversion host enable used to pass, without running anything. "msg": "Failed to connect to the host via ssh: ssh: connect to host 10.1.41.18 port 22: No route to host",
No, it's not verified. When you call the API, you shouldn't provide the `address` attribute, because it overrides CloudForms inventory. What we try to verify is that a VM with no IP address cannot be configured. The API call should be: POST https://<CFME FQDN>/api/conversion_hosts { "action": "create", "resource": { "name": "conversion_host_vm_7", "auth_user": "cloud-user", "conversion_host_ssh_private_key": "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----", "max_concurrent_tasks": 10, "resource_id": "2", "resource_type": "ManageIQ::Providers::Redhat::InfraManager::Vm", "vmware_vddk_package_url": "<vddk image URL>" } } And the error message should be "<vm_name> doesn't have a hostname or IP address in inventory". Putting it back to ON_QA. And sorry as I should have provided the test earlier.
Verified again on CFME-5.11.5.1, using rest api request without "address" field, as requested in comment #11. All the VM NICs were disconnected and the default libvirt network was destroyed, and it reported no IP address. Configure conversion host failed with this message in the tool tip: "Message: Vm 'conversion_host_vm_7' doesn't have a hostname or IP address in inventory" This mean it do not fail "silently", in case VM has no IP address, as before the fix. The conversion host ansible playbook download was active, and it downloaded an empty log, since nothing was run. For this added Bug 1827127 - "[v2v] Disable the playbook log download when it has not run".
https://github.com/ManageIQ/manageiq-api/pull/815
@Fabien, Is the PR, added in comment #13 require further testing please? Thanks.
No. It fixes the cross repository unit tests.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2020