Bug 2078946

Summary: [roles] ovirt-infra multiple datacenters template found only with admin permission
Product: Red Hat Enterprise Virtualization Manager Reporter: José Enrique <josgutie>
Component: ovirt-ansible-collectionAssignee: Eli Mesika <emesika>
Status: CLOSED DUPLICATE QA Contact: Guilherme Santos <gdeolive>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4.10CC: ahadas, bkaraore, elielslck, emesika, jbreuer, mavital, mperina
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-04 15:36:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description José Enrique 2022-04-26 14:42:36 UTC
Description of problem:
While creation of a VM from template within the cluster where the hosted engine is settled is working fine, the creation failed if another cluster will be selected also managed by the same RHVM.
The error while creation always points to the data-center of the cluster from the hosted engine.
The VM can be created for all clusters via VM-Portal UI using the same user account for creation as via the api.
The erroneous behavior just points for the creation using the api via ansible. It is also working fine if the user account becomes admin permissions for the template.


Version-Release number of selected component (if applicable):

ovirt-ansible-collection-1.6.6-1.el8ev.noarch


How reproducible:
* Multiple clusters are managed by the same RHVM
* The user account is member of a user group with permission "UserTemplateBasedVm" of the template
* The template is settled within the cluster, host, data-center, storage where the user group has permission "PowerUserRole"


Steps to Reproduce:
1. Build an ansible playbook to create a vm from a template, user only has granted PowerUserRole
2. Error
ValueError: Template with name 'rhel-8.5-update-2-x86_64-kvm-eregion-bd' and version 'None' in data center 'xxxx' was not found'
3. Enable admin, works succesfully.

Actual results:

Needed admin system permission to create vms in multiple rhv-m datacenters from a Template.

Expected results:

Only use PowerUserRole to deploy vms from a template in a multidatacenter environment.

Comment 18 Martin Perina 2022-08-04 09:23:33 UTC
As mentioned above the problem wasn't reproduced on the latest RHV 4.4 SP1 batch 1, so closing as worksforme. Feel free to reopen and attach reproducing steps if still reproduced on latest versions

Comment 20 José Enrique 2022-08-11 10:04:08 UTC
Hello customer after apply the last rhv-m update still suffering the issue, so maybe we are facing some data corruption issue, may be Eli could take a look of the database?.

Comment 50 Eli Mesika 2022-12-04 15:36:40 UTC

*** This bug has been marked as a duplicate of bug 2144346 ***