Created attachment 1522633 [details] evm.log Description of problem: Provisioning VM from a template doesn't work for RHV 4.3 Version-Release number of selected component (if applicable): CFME 5.10.0.32.20190115185124_c957ada RHV 4.3.0-0.8.rc2.el7 How reproducible: Always Steps to Reproduce: 1. Add RHV provider 2. Go to VMs 3. Lifecycle -> Provision VMs 4. Select a template, click Continue Actual results: Unexpected error encountered undefined method `uid_ems' for nil:NilClass [miq_request/prov_edit] Expected results: Provisioning dialog is opened Additional info: When provisioning the VM from the same template directly in RHV, it works. Afterwards, I'm able to see this VM in CFME. Also, when selecting the template, CFME shows incorrect info (it shows CPUs 0, Memory 0 for this template). There are some refresh errors, see the attached logs.
Here is part of the log: [----] E, [2019-01-23T05:39:26.612639 #64944:114cf5c] ERROR -- : MIQ(ManageIQ::Providers::Redhat::InfraManager::Refresh::Strategies::Api4#refresh) EMS: [rhv_43], id: [1] Refresh failed [----] E, [2019-01-23T05:39:26.614213 #64944:114cf5c] ERROR -- : [NoMethodError]: undefined method `ems_ref' for nil:NilClass Method:[block (2 levels) in <class:LogProxy>] [----] E, [2019-01-23T05:39:26.614305 #64944:114cf5c] ERROR -- : /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/vms_dependency_collections.rb:63:in `block (2 levels) in ems_folder_children_custom_save_block' /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/vms_dependency_collections.rb:63:in `each' /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/vms_dependency_collections.rb:63:in `each_with_object' /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/vms_dependency_collections.rb:63:in `block in ems_folder_children_custom_save_block' /opt/rh/cfme-gemset/gems/inventory_refresh-0.1.2/lib/inventory_refresh/save_collection/base.rb:22:in `save_inventory_object_inventory'
(In reply to Piotr Kliczewski from comment #4) > Here is part of the log: > > [----] E, [2019-01-23T05:39:26.612639 #64944:114cf5c] ERROR -- : > MIQ(ManageIQ::Providers::Redhat::InfraManager::Refresh::Strategies:: > Api4#refresh) EMS: [rhv_43], id: [1] Refresh failed > [----] E, [2019-01-23T05:39:26.614213 #64944:114cf5c] ERROR -- : > [NoMethodError]: undefined method `ems_ref' for nil:NilClass Method:[block > (2 levels) in <class:LogProxy>] > [----] E, [2019-01-23T05:39:26.614305 #64944:114cf5c] ERROR -- : > /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/ > models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/ > vms_dependency_collections.rb:63:in `block (2 levels) in > ems_folder_children_custom_save_block' > /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/ > models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/ > vms_dependency_collections.rb:63:in `each' > /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/ > models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/ > vms_dependency_collections.rb:63:in `each_with_object' > /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-fe67891d889e/app/ > models/manageiq/providers/redhat/inventory/persister/definitions/infra_group/ > vms_dependency_collections.rb:63:in `block in > ems_folder_children_custom_save_block' > /opt/rh/cfme-gemset/gems/inventory_refresh-0.1.2/lib/inventory_refresh/ > save_collection/base.rb:22:in `save_inventory_object_inventory' This reproduces also to me on development setup. The cluster-id is no longer saved for VMs or templates during the refresh.
*** Bug 1683285 has been marked as a duplicate of this bug. ***
It looks like the format of the cluster href is different than what we see from the vm: ManageIQ::Providers::Redhat::InfraManager.make_ems_ref(cluster.href) "/api/datacenters/95f329c1-3361-420a-b04e-d4c81a84adda/clusters/1b842295-6812-4cd7-87c3-dd268b9bf5f9" ManageIQ::Providers::Redhat::InfraManager.make_ems_ref(vm.cluster.href) "/api/clusters/1b842295-6812-4cd7-87c3-dd268b9bf5f9"
https://github.com/ManageIQ/manageiq-providers-ovirt/pull/343 ^ Fixes the exception but doesn't fix the fact that the VMs don't have an ems_cluster due to the format of the ID changing.
I checked several RHV-4.3 (with & without OVN), that are not Hosted Engine - and these DO NOT have the refresh failure. Seems the problem is specific to RHV-4.3 Hosted-Engine configuration.
Okay I updated https://github.com/ManageIQ/manageiq-providers-ovirt/pull/343 to reference clusters by id instead of href from vms and hosts.
We have a fix for this already on RHV side: oliel explains on the change in cluster href seen in RHV-4.3, compared to RHV-4.2, and the RHV fix he added, in order to return it back to as it was in RHV-4.2: Get all clusters under root: http://localhost:8080/ovirt-engine/api/clusters Get one specific cluster under root: http://localhost:8080/ovirt-engine/api/clusters/xxx Get all clusters under datacenters: http://localhost:8080/ovirt-engine/api/datacenters/yyy/clusters Those all return the cluster with an href directing to the cluster under the api root: <cluster href=".../api/clusters/xxx> However this one: Get one specific cluster under datacenters: http://localhost:8080/ovirt-engine/api/datacenters/yyy/clusters/xxx Returns the cluster with an href directing to the cluster under the datacenter: <cluster href=".../api/datacenters/yyy/clusters/xxx> I've posted a (RHV) patch making this last one direct to the cluster under the API root as well: https://gerrit.ovirt.org/#/c/98201/
*** Bug 1680521 has been marked as a duplicate of this bug. ***
changed bug component to RHV as this issue is caused by a change done on RHV-4.3
Fixed and verified for CFME 5.10.1.2.20190219165527_7a4a22b RHV 4.3.2-0.1.el7
Moving bug to assigned since for Hosted Engine RHV-4.3.2, cluster href is still from shape: /ovirt-engine/api/datacenters/xxx/clusters/yyy and this fails the RHV refresh in CFME.
Ondra's fix verified: I installed the ovirt-engine-restapi rpm built with Ondra's fix, on my engine. and now Links under /api/clusters: no longer have such path: /ovirt-engine/api/datacenters/<id>/clusters/<id> but rather: /ovirt-engine/api/clusters/<id> as it was on RHV-4.2. For all the clusters in my RHV-4.3.
Moving to verified as is works for my HE as well as for Ilanit's. My versions: CFME 5.10.3.3.20190415203225_deb61ff RHV 4.3.3.3-0.1.el7
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/RHEA-2019:1085