Bug 1471124 - Delete a Template in RHEV that a Catalog uses, no indication in logs or UI when Catalog Ordered
Summary: Delete a Template in RHEV that a Catalog uses, no indication in logs or UI wh...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.9.0
Assignee: Moti Asayag
QA Contact: Radim Hrazdil
URL:
Whiteboard: rhev
Depends On: 1532648
Blocks: 1481845
TreeView+ depends on / blocked
 
Reported: 2017-07-14 13:03 UTC by myoder
Modified: 2020-12-14 09:07 UTC (History)
8 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1481845 (view as bug list)
Environment:
Last Closed: 2018-03-06 14:38:08 UTC
Category: Bug
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 6 CFME Bot 2017-08-15 12:01:36 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/92ed48acef771074e05c7e14c8c53a4d7401599e

commit 92ed48acef771074e05c7e14c8c53a4d7401599e
Author:     Moti Asayag <masayag>
AuthorDate: Mon Aug 14 15:39:36 2017 +0300
Commit:     Moti Asayag <masayag>
CommitDate: Tue Aug 15 14:37:59 2017 +0300

    Fail with descriptive message when no EMS
    
    When no EMS is associated with a VM or template, the provision request
    fails with a non-descriptive message. Such case might happen when the VM
    or template were removed from the provider side, but still exist as
    archived on vmdb. The purpose of the PR is to provide a clear failure
    message when there is no EMS.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1471124

 app/models/miq_provision_request.rb       | 15 +++++++++--
 spec/models/miq_provision_request_spec.rb | 45 +++++++++++++++++++------------
 2 files changed, 41 insertions(+), 19 deletions(-)

Comment 7 Moti Asayag 2017-08-15 12:12:45 UTC
(In reply to CFME Bot from comment #6)
> New commit detected on ManageIQ/manageiq/master:
> https://github.com/ManageIQ/manageiq/commit/
> 92ed48acef771074e05c7e14c8c53a4d7401599e
> 
> commit 92ed48acef771074e05c7e14c8c53a4d7401599e
> Author:     Moti Asayag <masayag>
> AuthorDate: Mon Aug 14 15:39:36 2017 +0300
> Commit:     Moti Asayag <masayag>
> CommitDate: Tue Aug 15 14:37:59 2017 +0300
> 
>     Fail with descriptive message when no EMS
>     
>     When no EMS is associated with a VM or template, the provision request
>     fails with a non-descriptive message. Such case might happen when the VM
>     or template were removed from the provider side, but still exist as
>     archived on vmdb. The purpose of the PR is to provide a clear failure
>     message when there is no EMS.
>     
>     https://bugzilla.redhat.com/show_bug.cgi?id=1471124
> 
>  app/models/miq_provision_request.rb       | 15 +++++++++--
>  spec/models/miq_provision_request_spec.rb | 45
> +++++++++++++++++++------------
>  2 files changed, 41 insertions(+), 19 deletions(-)

Satoe, note that only this PR should be backported to FINE.

The PR from comment 4 (https://github.com/ManageIQ/manageiq-providers-ovirt/pull/77) is required for 5.9 and above.

Comment 8 CFME Bot 2017-08-15 12:29:09 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/master:
https://github.com/ManageIQ/manageiq-providers-ovirt/commit/eb718552088ae50e9d5155486690530372c2e0c3

commit eb718552088ae50e9d5155486690530372c2e0c3
Author:     Moti Asayag <masayag>
AuthorDate: Mon Aug 14 14:28:19 2017 +0300
Commit:     Moti Asayag <masayag>
CommitDate: Mon Aug 14 14:28:19 2017 +0300

    Fix allowed vlans to allow no provider
    
    A template might loose its association with a provider when a template
    is being removed from the provider. In that case the template will
    become archived or orphan and its ext_management_system will return
    nil.
    
    The service catalog filters such vms or templates. However, an existing
    service doesn't produce a meaningful error in such case.
    
    Letting the service to allow nil value for EMS at dialog load will
    produce a descriptive error when trying to provision.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1471124

 .../manageiq/providers/redhat/infra_manager/provision_workflow.rb       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 10 Ilanit Stein 2018-01-03 12:56:28 UTC
Tested on CFME-5.9.0.14/RHV-4.1.8

When a template is deleted in RHV, that a Catalog is using, 
when ordering that Catalog, the Request last message is now:

[EVM] VM [rhel72_10002] Step [CheckProvisioned] Status [Error Creating VM] Message [[OvirtSDK4::NotFoundError]: HTTP response code is 404. The response body is empty.]

This message is better than before (mentioned in the bug description).
However, it indicates a problem with creating the VM, 
but not that the template no longer exist.

Moti,
Was this the intended error message please? 

Thanks.

Comment 11 Moti Asayag 2018-01-03 15:02:47 UTC
The scenario described should not happen when Bug 1511445 is fixed.
The reason for that error is only due to the fact that there was an attempt to provision a VM from a template that was just removed from RHV, without that removal being reflected to MIQ.

A full refresh and re-test the scenario will produce the expected error:

"Error: Source Template/Vm with id [9180] has no EMS, unable to provision"

Once bug 1511445 is fixed, an auto-target refresh will be triggered for the removed template which will produce the error message as above.

Comment 12 Radim Hrazdil 2018-01-26 10:04:02 UTC
Verified that Error message saying "Error: Source Template/Vm with id [116] has no EMS, unable to provision" appears in evm.log and in UI. 

CFME: 5.9.0.17
RHV 4.1.9


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