Created attachment 1281564 [details] engine.log Description of problem: Upon VM pool creation, all the VMs in the cluster get attached to the pool. An attempt to detach these VMs from the pool ends with 'User is not authorized to perform this action' error. Version-Release number of selected component (if applicable): ovirt-engine-4.2.0-0.0.master.20170517192237.git1e57f0c.el7.centos.noarch How reproducible: 100% Steps to Reproduce: 1. Have sone VMs in a cluster 2. Create a VM pool with several VMs Actual results: All VMs in the cluster get attached to the newly created pool can't detach them from the pool, hence, the pool is unremovable. Expected results: Only the VM pool should be attached to the pool. Additional info: engine.log Pool creation: 2017-05-23 16:50:14,727+03 INFO [org.ovirt.engine.core.bll.AddVmPoolCommand] (org.ovirt.thread.pool-6-thread-39) [7920e6c7-f0bd-4714-a51c-79df89d95948] Running command: AddVmPoolCommand int ernal: false. Entities affected : ID: a32b6b06-b948-491c-8e7a-20a29e56de66 Type: ClusterAction group CREATE_VM_POOL with role type USER, ID: 1c7abfd7-9633-4f81-8f14-2e616c8a9f33 Type: VmTe mplateAction group CREATE_VM with role type USER Attempt to detach the VM: 2017-05-23 16:51:19,825+03 WARN [org.ovirt.engine.core.bll.RemoveVmFromPoolCommand] (default task-31) [443fef29-24ad-4caa-bb92-4cdba0928fc8] Validation of action 'RemoveVmFromPool' failed f or user admin@internal-authz. Reasons: USER_NOT_AUTHORIZED_TO_PERFORM_ACTION
Im not sure the VMs are really attached to the pool. When checking our devel env it looks like only the VMPool->vms subtab is not filtering the VMs properly. Can you please check in DB: select vm_name, vm_pool_id from vms; what it returns?
vm_name | vm_pool_id -----------------------------+------------ golden_env_mixed_virtio_1_1 | golden_env_mixed_virtio_2_0 | golden_env_mixed_virtio_2_1 | golden_env_mixed_virtio_3_0 | golden_env_mixed_virtio_3_1 | golden_env_mixed_virtio_1_0 | (6 rows)
This is a regression in 4.2 introduced by https://gerrit.ovirt.org/#/c/69945/ The problem is that the pool subtab is using the following search query: Vms : pool = somepool Which translates into: SELECT * FROM ((SELECT distinct vms.* FROM vms WHERE (vms.vm_pool_name IS NULL OR vms.vm_pool_name LIKE 'somepool') ) ORDER BY vm_name ASC ) as T1 OFFSET (1 -1) LIMIT 100 The key issue is the: ... vms.vm_pool_name IS NULL OR ... e.g. it will return all VMs which are in no pool concatenated with VMs which are in in the requested pool. This was not the case, the query previously did not have this IS NULL OR statement so it was returning only the requested VMs. The IS NULL OR has been introduced by https://gerrit.ovirt.org/#/c/69945/ Please note that this regression is also blocking the https://bugzilla.redhat.com/show_bug.cgi?id=1454389 Changing the title of this BZ and moving to infra.
This bug report has Keywords: Regression or TestBlocker. Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.
Verified that in 4.2.0-0.0.master.20170903205106.gitb17261a.el7.centos, after creating a pool, only vms belonging into that pool are shown.
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.