Bug 1810135 - [v2v] Add a check that conversion host VM has least one IP address in the inventory
Summary: [v2v] Add a check that conversion host VM has least one IP address in the inv...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: V2V
Version: 5.11.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.5
Assignee: Fabien Dupont
QA Contact: Ilanit Stein
Red Hat CloudForms Documentation
URL:
Whiteboard:
: 1780034 1780110 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-04 15:30 UTC by Ilanit Stein
Modified: 2020-05-05 13:43 UTC (History)
3 users (show)

Fixed In Version: 5.11.5.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 13:43:32 UTC
Category: Bug
Cloudforms Team: V2V
Target Upstream Version:
Embargoed:
pm-rhel: cfme-5.11.z+


Attachments (Terms of Use)
ansible.log (807 bytes, text/plain)
2020-03-04 15:31 UTC, Ilanit Stein
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2020 0 None None None 2020-05-05 13:43:43 UTC

Description Ilanit Stein 2020-03-04 15:30:13 UTC
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.

Comment 2 Ilanit Stein 2020-03-04 15:31:31 UTC
Created attachment 1667512 [details]
ansible.log

Comment 3 Fabien Dupont 2020-03-04 15:51:30 UTC
https://github.com/ManageIQ/manageiq/pull/19927

Comment 4 Fabien Dupont 2020-03-05 16:50:53 UTC
*** Bug 1780110 has been marked as a duplicate of this bug. ***

Comment 5 Fabien Dupont 2020-03-05 16:51:46 UTC
*** Bug 1780034 has been marked as a duplicate of this bug. ***

Comment 6 CFME Bot 2020-03-20 17:30:29 UTC
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(+)

Comment 7 CFME Bot 2020-03-20 19:30:29 UTC
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(+)

Comment 8 Ilanit Stein 2020-04-20 16:00:21 UTC
@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.

Comment 10 Ilanit Stein 2020-04-23 08:22:46 UTC
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",

Comment 11 Fabien Dupont 2020-04-23 08:55:36 UTC
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.

Comment 12 Ilanit Stein 2020-04-23 10:05:22 UTC
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".

Comment 13 Fabien Dupont 2020-04-24 21:40:18 UTC
https://github.com/ManageIQ/manageiq-api/pull/815

Comment 14 Ilanit Stein 2020-04-26 10:01:45 UTC
@Fabien,

Is the PR, added in comment #13 require further testing please? 

Thanks.

Comment 15 Fabien Dupont 2020-04-26 13:18:04 UTC
No. It fixes the cross repository unit tests.

Comment 18 errata-xmlrpc 2020-05-05 13:43:32 UTC
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


Note You need to log in before you can comment on or make changes to this bug.