Bug 1859460

Summary: Cannot create KubeVirt VM as a normal user
Product: Red Hat Enterprise Virtualization Manager Reporter: Lucia Jelinkova <ljelinko>
Component: ovirt-engineAssignee: Lucia Jelinkova <ljelinko>
Status: CLOSED ERRATA QA Contact: Pavol Brilla <pbrilla>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.4.0CC: ahadas, asocha, lleistne, mavital, mperina, mtessun, pbrilla
Target Milestone: ovirt-4.4.2   
Target Release: 4.4.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhv-4.4.2-3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-23 16:11:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lucia Jelinkova 2020-07-22 08:13:10 UTC
Description of problem:
It is not possible to create a KubeVirt VM with other than SuperUser permissions.

Steps to Reproduce:
1. create a user account and grant the following permissions: DataCenterAdmin, VmCreator, UserVmManager, UserTemplateBasedVm
2. create a new VM from a KubeVirt template

Actual results: User does not have permissions to create a VM.


Expected results: The VM should be created.


Additional info:
I think there are 2 problems here:
1. when creating a template from KubeVirt, no permissions are added to the db. For normal templates, the UserTemplateBasedVm is granted for everyone
2. when calculating the permissions for an entity, it is checked not only for the entity itself but also for the parent. However, the check for templates is based on the assumption that there is an image associated with the template. That is not the case so the template does not have any parent found (https://github.com/oVirt/ovirt-engine/blob/b502501fc127044d6cacc7363317add5e21e1092/packaging/dbscripts/create_functions.sql#L251)

Comment 6 Pavol Brilla 2020-08-27 13:05:28 UTC
Steps to Reproduce:
1. create a user account (test) and grant the following permissions: DataCenterAdmin, VmCreator, UserVmManager, UserTemplateBasedVm
2. create a new VM from a KubeVirt template ( PVC were already provided from ocp side )


Verified on Software Version:4.4.2.2-0.3.el8ev

Comment 10 errata-xmlrpc 2020-09-23 16:11:41 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 (Moderate: Red Hat Virtualization security, bug fix, and enhancement update), 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/RHSA-2020:3807