Bug 881593

Summary: Incorrect VM count in the load column
Product: Red Hat Enterprise Virtualization Manager Reporter: Anush Shetty <ashetty>
Component: ovirt-engine-webadmin-portalAssignee: Michal Skrivanek <michal.skrivanek>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: acathrow, bdagan, ecohen, grajaiya, iheim, jkt, michal.skrivanek, ofrenkel, Rhev-m-bugs, sdharane, vbellur, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: is1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 970195    

Description Anush Shetty 2012-11-29 07:34:51 UTC
Description of problem: The vm count in the load column for hosts display the incorrect figure. We added the first host rhev-h and created a VM. Then added another rhev-h host to the same cluster. The load column now shows 1VM for both the hosts. We migrated the existing VM to another host and now the load column in host to which we migrated the VM shows 2 when there is actually only 1VM.


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


How reproducible: Saw this once 


Steps to Reproduce:
1. add rhev-h
2. create vm
3. add another rhev-h to the same cluster
4. load column shows 1 VMs each
5. migrate the vm
6. now the host should 2VMs while there are actually only one
  
Actual results:

VM count is incorrect

Expected results:

Should display the appropriate VM count

Additional info:

Comment 6 Libor Spevak 2012-12-05 08:44:13 UTC
The attached log is full of messages of type:

2012-11-28 23:37:13,844 INFO  [org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo] (QuartzScheduler_Worker-59) [5d3fbefb] VDS::UpdateVmRunTimeInfo Error: found VM on a VDS that is not in the database!

So, probably up-to-date information cannot be fetched and updated.
Could the both nodes be in inconsistent state?

E.g. installation of VDSM of the first node run with success:

...
2012-11-28 23:00:43,385 INFO  [org.ovirt.engine.core.bll.VdsInstaller] (NioProcessor-33) Installation of 10.70.36.1. Received message: <BSTRAP component='VDS Configuration' status='OK'/>. FYI. (Stage: Running second installation script on Host)
...

The was also the another installation for the second host, but with some errors:

...
2012-11-28 23:22:48,175 INFO  [org.ovirt.engine.core.bll.VdsInstaller] (NioProcessor-38) Installation of 10.70.36.6. Received message: <BSTRAP component='RHN_REGISTRATION' status='FAIL' message='Unable to fetch vdsm package. Please check if host is registered to RHN, Satellite or other yum repository'/>. FYI. (Stage: Running first installation script on Host)
...
2012-11-28 23:22:48,212 ERROR [org.ovirt.engine.core.bll.VdsInstaller] (pool-4-thread-47) [2e25840] Installation of 10.70.36.6 has failed. Failure details: SSH command failed while executing at host '10.70.36.6', refer to logs for further information. (Stage: Running first installation script on Host)
...

From this time just UpdateVmRunTimeInfo error messages follow.

Comment 7 Libor Spevak 2012-12-11 08:24:29 UTC
I tried this with the latest ovirt-engine, 2 hosts with Fedora17 and stable VDSM package installed and running - I think, the behaviour is correct. Before I continue, please answer the questions...

Do you think, the second host could be in incorrect state? Could the message

'Unable to fetch vdsm package. Please check if host is registered to RHN, Satellite or other yum repository'

be an issue?

What was the status of VDSM package on both hosts? Just clean machine, or some installation has happened before?

Can this bug be reproduced - a) clean hosts, b) hosts with performed correct setup?

Thank you.

Comment 8 Yaniv Kaul 2012-12-25 06:46:31 UTC
I'm pretty sure the load is incorrect when the VMs are in 'migrating' state.

Comment 9 Simon Grinberg 2012-12-25 10:24:18 UTC
(In reply to comment #8)
> I'm pretty sure the load is incorrect when the VMs are in 'migrating' state.

Indeed, while migration in process the VM is counted twice - one per host, since you have a VM process on both hosts. 

I was mislead by the migration description since my first understanding of the description, it looked like the complaint is after the migration is over.   

And according to the message: 
2012-11-28 23:37:13,844 INFO  [org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo] (QuartzScheduler_Worker-59) [5d3fbefb] VDS::UpdateVmRunTimeInfo Error: found VM on a VDS that is not in the database!

It looks like there is independent VM on the host. On the host load the engine reports all VMs VDSM reports, including VMs that where not started by the engine. 

Possible reason for the floating VM in a migration scenario:
Migration finished successfully but the original host thinks migration failed and does not kill the original machine. 


But!!!!
Reading again the description the extra VM appeared in the system before the migration, from comment 0: 
1. add rhev-h
2. create vm
3. add another rhev-h to the same cluster
4. load column shows 1 VMs each.

So I wander where this extra VM came. According to the log the engine it did find an extra unexpected VM on the stem.

Anush, could it be that you've missed a step?
Was the VM an HA VM? Did you had trouble with the first host prior to adding the second?

Comment 11 Yaniv Kaul 2012-12-25 10:30:56 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > I'm pretty sure the load is incorrect when the VMs are in 'migrating' state.
> 
> Indeed, while migration in process the VM is counted twice - one per host,
> since you have a VM process on both hosts. 

Yet it is seen by none of them. I just migrated 15 VMs from host A to B - they both showed 0 VMs while migrating, and when all was done, it got back to normal.

Comment 12 Libor Spevak 2013-01-18 11:24:54 UTC
My observation is the following: During migration of *one* VM the vm_count=1 for *both* host. This is correct behaviour, the VM runs on both hosts. After migration ends, the vm_count=1 is on just one host. vd.vm_active=1 just for one host always.

The GUI table is filled using e.g. this query:

select vs.vds_name,vd.vm_count, vd.vm_active from vds_static vs
join vds_dynamic vd on vd.vds_id = vs.vds_id

I do not understand:
...they both showed 0 VMs while migrating...

Can you try to run the query on your configuration during migration?

Can we close this issue?

Comment 13 Yaniv Kaul 2013-01-18 12:05:45 UTC
Here's an example: I have two hosts:
Host A: 16 VMs.
Host B: 10 Vms.
 
I migrate 4 from Host A to Host B, then switch to a different tab and go back to the hosts tab. Now I see:
Host A: 12 VMs.
Host B: 10 VMs.

Again:
Host A: 12 VMs.
Host B: 14 VMs.


There is no VM, at any point, in the host's 'Virtual Machines' subtab that shows ' migrating from' status.

Comment 15 Libor Spevak 2013-02-07 16:16:58 UTC
Current behaviour for RHEV 3.2 (sf6) is the following (target release):

Host A: 1 VM
Host B: 0 VM
 
During migration:
Host A: 1 VM
Host B: 1 VM

After migration:
Host A: 0 VM
Host B: 1 VM

In the version 3.1 it looked differently.

Please, confirm the correct behaviour and tested version.

Comment 16 Barak Dagan 2013-02-14 12:59:57 UTC
Current behavior for RHEV 3.1 (si26.1), load column in "Hosts" tab is the following:

Host A: 5 VM
Host B: 0 VM
 
During migration:
Host A: 0 VM
Host B: 0 VM

After migration:
Host A: 0 VM
Host B: 5 VM

The behavior for RHEV 3.2 (sf6) is different indeed, (Virtual Machines column, "Hosts" tab):

Host A: 1 VM
Host B: 0 VM
 
During migration:
Host A: 1 VM
Host B: 1 VM

After migration:
Host A: 0 VM
Host B: 1 VM

Note, The hosts are running RHEL 6.3, 6.4 respectively

Comment 17 Libor Spevak 2013-02-15 08:27:35 UTC
VM count during migration for 3.2 looks without problems. The VM on a target host is taking resources, so it is useful/important to have it in the statistics.

We are investigating an option to show the VM on target host in 'Migrating To' status (currently the VM is shown just on the source host Virtual Machine subtab in Migrating From status) during the migration.

Comment 18 Libor Spevak 2013-03-25 12:55:56 UTC
Merged u/s: 9ba2d45fca8726279b9bace2d2fae7beff110e4f

Comment 19 Omer Frenkel 2013-04-03 15:53:33 UTC
*** Bug 635980 has been marked as a duplicate of this bug. ***

Comment 22 Itamar Heim 2014-01-21 22:31:41 UTC
Closing - RHEV 3.3 Released

Comment 23 Itamar Heim 2014-01-21 22:31:42 UTC
Closing - RHEV 3.3 Released

Comment 24 Itamar Heim 2014-01-21 22:34:19 UTC
Closing - RHEV 3.3 Released