Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1964496

Summary: Host-specific fields of a VM are not updated when dedicated host(s) changes
Product: [oVirt] ovirt-engine Reporter: Liran Rotenberg <lrotenbe>
Component: Frontend.WebAdminAssignee: Liran Rotenberg <lrotenbe>
Status: CLOSED CURRENTRELEASE QA Contact: Tamir <tamir>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4.6CC: ahadas, bugs, dfodor, ljelinko
Target Milestone: ovirt-4.4.8Flags: pm-rhel: ovirt-4.4+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.8.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-19 06:23:12 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 Liran Rotenberg 2021-05-25 15:51:18 UTC
While changing the default host value (under VM -> Host tab -> select hosts under `Start Running On` section) the engine should raise an event to trigger follow-up logic to be executed.
Currently, no event is raised. This harms the optional VM settings change and harms the user experience.

As an example, when changing from a host with NUMA support to one who isn't, it will keep showing it as it is possible to set NUMA configuration and the other way around.

A seems to be workaround is to change the radio selector moving from: `Specific Host(s)` to `Any Host in Cluster` and back.

Input from initial investigation:
The main problem is within ListModel::setSelectedItems.
It checks if the current value changed (selectedItems != value), but it seems that the selectedItems already changed. Therefore we always get selectedItems == value and the event is not triggered.

More info:
The flow in in debug when changing the default host list:
It goes from ListModelMultipleSelectListBox::setValue to, ListModelMultipleSelectListBox::updateCurrentValue. Then calls UiCommonEditorVisitor::setInModel and triggers the ListModel::setSelectedItems.
But apparently the selecteItems in ListModel already updated.

Comment 1 Arik 2021-08-03 10:04:41 UTC
When verifying this, please check also the multiple selection list for user roles (and not only dedicated hosts)

Comment 2 Tamir 2021-08-12 16:00:53 UTC
Verified on RHV 4.4.8-4. All looks good to me.

Env:
  - Engine instance with RHV 4.4.8-4 (ovirt-engine-4.4.8.3-0.10.el8ev) and RHEL 8.4 installed.
  - 4 hosts with RHV 4.4.8-4 and RHEL 8.4, vdsm-4.40.80.4-1.el8ev
    - 1 host without NUMA support and the other 3 have NUMA support. 
 

Tests:

- Check that the VM starts on the right Hosts and the VM settings in the modal are updated by the choice of Hosts in Start Running On.

Steps:

In Admin Portal:

1. Create a 4.5 data center and a 4.5 cluster.
2. Install all the hosts and create a new NFS storage domain.
3. Create a RHEL 8.3 VM with NIC and set it to start on a host with NUMA support and Set the NUMA node count to 2 and attach both vNUMA nodes onto a NUMA node socket.
4. Run the VM and check the host it started on.
5. Stop the VM.
6. Edit the VM - Replace the Start Running On host with a host that doesn't support NUMA.
7. Check that the NUMA count field and NUMA pinning button are disabled.
8. Save the changes.
9. Start the VM.


Results (As Expected):

1. The 4.5 data center and the 4.5 cluster were created.
2. The host was installed and the NFS storage domain was created.
3. The VM was created.
4. The VM is running and it started on the host we set.
5. The VM has stopped running.
6. The VM is set to start on a VM without NUMA support.
7. The VM NUMA count field and NUMA pinning button are disabled.
8. The changes are saved.
9. The VM has started on the right host.

- Do a regression on adding roles to groups.


Using the ovirt-aaa-jdbc-tool:

1. Create a new user.
2. Create a new group.
3. Add the user to the group.


In Admin Portal:

4. Create a 4.5 data center and a 4.5 cluster.
5. Install the host and create a new NFS storage domain.
6. In Administration -> Users -> "Group" button -> select the group you created and click Add System Permissions.
7. Select multiple permissions like "VmCreator,UserVmManager,UserVmRunTimeManager" and check the list is updated accordingly.
8. Login as the user you created.
9. Check that you can create VMs, view existing VMs and run/stop them.  


Results (As Expected):

1. The user has been created.
2. The group has been created.
3. The user is assigned to the group.
4. The 4.5 data center and the 4.5 cluster were created.
5. The host was installed and the NFS storage domain was created.
6. The Add System Permissions modal has opened.
7. The values "VmCreator,UserVmManager,UserVmRunTimeManager" were selected.
8. You are logged in as the user you created.
9. You can create VMs, View existing ones and run/stop existing VMs.

Comment 3 Sandro Bonazzola 2021-08-19 06:23:12 UTC
This bugzilla is included in oVirt 4.4.8 release, published on August 19th 2021.

Since the problem described in this bug report should be resolved in oVirt 4.4.8 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.