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

Bug 1132833

Summary: VDSM does not report parameters such as memUsage
Product: [Retired] oVirt Reporter: Lukas Svaty <lsvaty>
Component: vdsmAssignee: Francesco Romani <fromani>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: high Docs Contact:
Priority: medium    
Version: 3.5CC: bazulay, bugs, dfediuck, ecohen, gklein, iheim, mgoldboi, michal.skrivanek, rbalakri, vfeenstr, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.5.0   
Hardware: All   
OS: All   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:27:55 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:
Attachments:
Description Flags
vdsm log of host none

Description Lukas Svaty 2014-08-22 07:25:33 UTC
Description of problem:
When trying to get stats of VM by mom it fails on key error (see additional info)


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

How reproducible:
100%

Steps to Reproduce:
1. Run VM with guest agent running
2. change rpc port on host to 8080
3. ServerProxy("http://localhost:8080").getStatistics() on host


Actual results:
No VM in 'guests': {}, section

Expected results:
MOM should be able to load statistics of VMs

Additional info:
mom.log
2014-08-22 09:18:48,004 - mom.Monitor - INFO - GuestMonitor-VM_for_allocation starting
2014-08-22 09:18:48,004 - mom.Monitor - ERROR - GuestMonitor-VM_for_allocation crashed
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/mom/GuestMonitor.py", line 56, in run
    self.collect()
  File "/usr/lib/python2.6/site-packages/mom/Monitor.py", line 91, in collect
    collected = c.collect()
  File "/usr/lib/python2.6/site-packages/mom/Collectors/GuestMemory.py", line 49, in collect
    stat = self.hypervisor_iface.getVmMemoryStats(self.uuid)
  File "/usr/lib/python2.6/site-packages/mom/HypervisorInterfaces/vdsmInterface.py", line 93, in getVmMemoryStats
    usage = int(response['statsList'][0]['memUsage'])
KeyError: 'memUsage'

Comment 1 Lukas Svaty 2014-08-22 08:19:55 UTC
moving to vdsm component

in 3.5 vdsm is not reporting some values in getAllVmStats method:

[root@dell-r210ii-12 ~]# vdsClient -s 0 getAllVmStats


61901e42-5ccc-43da-aaa7-60ed6bfbd5f5
	Status = Up
	displayInfo = [{'tlsPort': '5901', 'ipAddress': '10.34.62.204', 'port': '5900', 'type': 'spice'}]
	hash = -5479945782673424400
	network = {}
	acpiEnable = true
	vmType = kvm
	displayIp = 10.34.62.204
	disks = {}
	pid = 13420
	monitorResponse = 0
	timeOffset = 0
	elapsedTime = 238090
	displaySecurePort = 5901
	displayPort = 5900
	kvmEnable = true
	clientIp = 
	displayType = qxl

attaching vdsm.log

Comment 2 Lukas Svaty 2014-08-22 08:21:17 UTC
Created attachment 929477 [details]
vdsm log of host

Comment 3 Michal Skrivanek 2014-08-25 11:43:58 UTC
memUsage is an optional info coming from the guest agent

Comment 4 Dan Kenigsberg 2014-08-26 12:20:33 UTC
I don't like it when Vdsm is faking values, but if up until 3.4 we reported 0, we should continue doing so. Is that the case, Vinzenz?

Comment 5 Vinzenz Feenstra [evilissimo] 2014-08-26 12:31:52 UTC
(In reply to Dan Kenigsberg from comment #4)
> I don't like it when Vdsm is faking values, but if up until 3.4 we reported
> 0, we should continue doing so. Is that the case, Vinzenz?

All the fields which were always reported are always in GuestAgent.guestInfo, those aren't marked as optional in the API IIRC

Therefore we should keep reporting them.

Comment 6 Vinzenz Feenstra [evilissimo] 2014-08-26 12:33:06 UTC
(In reply to Vinzenz Feenstra [evilissimo] from comment #5)
> All the fields which were always reported are always in
> GuestAgent.guestInfo, those aren't marked as optional in the API IIRC
Just checked it, it is not marked as optional. Therefore we have to report it, even if it is not reported by the guest agent.

Comment 7 Michal Skrivanek 2014-08-26 12:38:11 UTC
sorry, it's actually mandatory and always was.
looks like a regression introduced by http://gerrit.ovirt.org/26554
The problem exists only in 3.5 as in current master this is fixed by http://gerrit.ovirt.org/26142

Comment 8 Francesco Romani 2014-08-26 13:34:32 UTC
This issue is caused by the VM being not properly initialized:

Thread-13::INFO::2014-08-22 09:17:33,703::vm::2251::vm.Vm::(_startUnderlyingVm) vmId=`61901e42-5ccc-43da-aaa7-60ed6bfbd5f5`::Skipping errors on recovery
Traceback (most recent call last):
  File "/usr/share/vdsm/virt/vm.py", line 2235, in _startUnderlyingVm
    self._run()
  File "/usr/share/vdsm/virt/vm.py", line 3298, in _run
    self._domDependentInit()
  File "/usr/share/vdsm/virt/vm.py", line 3189, in _domDependentInit
    self._syncVolumeChain(drive)
  File "/usr/share/vdsm/virt/vm.py", line 5660, in _syncVolumeChain
    volumes = self._driveGetActualVolumeChain(drive)
  File "/usr/share/vdsm/virt/vm.py", line 5639, in _driveGetActualVolumeChain
    sourceAttr = ('file', 'dev')[drive.blockDev]
TypeError: tuple indices must be integers, not NoneType
Thread-13::DEBUG::2014-08-22 09:17:33,704::vm::2254::vm.Vm::(_startUnderlyingVm) vmId=`61901e42-5ccc-43da-aaa7-60ed6bfbd5f5`::_ongoingCreations released

Since http://gerrit.ovirt.org/30045 was merged on 3.5, next VDSM RC should not expose this behaviour. I'll prepare a patch anyway to make sure memUsage is reported.

Comment 9 Francesco Romani 2014-08-27 10:29:20 UTC
(In reply to Francesco Romani from comment #8)
> Since http://gerrit.ovirt.org/30045 was merged on 3.5, next VDSM RC should
> not expose this behaviour.

Moving to MODIFIED for this reason.

Comment 10 Lukas Svaty 2014-10-14 13:44:45 UTC
verified in vdsm-4.16.6-1.el6ev.x86_64

Comment 11 Sandro Bonazzola 2014-10-17 12:27:55 UTC
oVirt 3.5 has been released and should include the fix for this issue.