Bug 993123

Summary: REST-API doesn't return statistics for VLAN tagged interfaces
Product: Red Hat Enterprise Virtualization Manager Reporter: Michael Everette <meverett>
Component: ovirt-engine-restapiAssignee: Moti Asayag <masayag>
Status: CLOSED ERRATA QA Contact: yeylon <yeylon>
Severity: high Docs Contact:
Priority: high    
Version: 3.2.0CC: acathrow, bazulay, iheim, jraju, masayag, myakove, oramraz, Rhev-m-bugs, srevivo, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: network
Fixed In Version: is17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 17:35:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1019461    

Description Michael Everette 2013-08-05 16:14:57 UTC
Description of problem:

After upgrading RHEV to version 3.2, no interface statistics for VLAN tagged interfaces (e.g. eth0.100) are available via REST-API

Statistics for eth0 are working fine:

$ curl -k -X GET -H "Accept: application/xml" -u admin@internal:password https://10.0.100.11:8443/api/hosts/4a5801d8-17b1-11e1-84ed-0025901dd0b4/nics/d9b3c447-c841-4187-a1dc-3d865f623fa0/statistics
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statistics>
....snip....
</statistics>


Getting information for interface eth0.100 (VLAN tag 100) returns:

$ curl -k -X GET -H "Accept: application/xml" -u admin@internal:password https://10.0.100.11:8443/api/hosts/4a5801d8-17b1-11e1-84ed-0025901dd0b4/nics/07735034-7948-4e96-956f-f39f10186e28/statistics
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
</fault>


Several other customers report that they are facing this as well. They can however gather these statistics with RHEV 3.0, RHEV 3.1 and also with oVirt 3.2.

Comment 1 Michael Everette 2013-08-22 16:55:47 UTC
Customer has updated that: 

I upgraded RHEV 3.2.1 to 3.2.2, which also has an updated REST-API package, but even with the newest version I get "Operation Failed" for vlan tagged interface statistics...

Comment 2 awinter 2013-10-01 12:22:00 UTC
Bug fixed.

I have created a network with vlan 100 and attached it to eth1.
Then I ran the command:

$ curl -k -X GET -H "Accept: application/xml" -u admin@internal:password https://10.35.161.18:443/api/hosts/8ccbd49d-c1ff-41e3-974a-3ad622fc8281/nics/0d092f7a-e843-48be-9b81-d0bacf80252a/statistics

and as a result I got:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statistics>
    ...... Statistics for eth1.100 ......
</statistics>

Comment 3 Moti Asayag 2013-10-10 08:46:33 UTC
*** Bug 1017257 has been marked as a duplicate of this bug. ***

Comment 4 Jaison Raju 2013-10-10 09:50:16 UTC
Hello Team,

This bug is also noticed for bond interfaces .
A java trace is noticed in engine.log .


Description of problem:
Rest API call for RHEV Host bond interface statistics fails .

========================================================================================================================================
#  curl -X GET -H "Accept: application/xml" -u admin@internal:redhat --cacert rhevm.cer https://rhevm3-2.jraju.pnq.redhat.com:443/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/25038a5e-4401-40ee-9023-e70934a00ceb/statistics
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
</fault>
========================================================================================================================================

Listing for all nics :

========================================================================================================================================
#  curl -X GET -H "Accept: application/xml" -u admin@internal:redhat --cacert rhevm.cer https://rhevm3-2.jraju.pnq.redhat.com:443/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<host_nics>
    <actions>
        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/setupnetworks" rel="setupnetworks"/>
    </actions>
    <host_nic href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/72020a1e-b666-4f77-936a-ff85130b7e26" id="72020a1e-b666-4f77-936a-ff85130b7e26">
        <actions>
            <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/72020a1e-b666-4f77-936a-ff85130b7e26/attach" rel="attach"/>
            <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/72020a1e-b666-4f77-936a-ff85130b7e26/detach" rel="detach"/>
        </actions>
        <name>eth0</name>
        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/25038a5e-4401-40ee-9023-e70934a00ceb" rel="master"/>
        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/72020a1e-b666-4f77-936a-ff85130b7e26/statistics" rel="statistics"/>
        <host href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e" id="af965dde-86a0-4517-9d53-eb58d322bb5e"/>
        <mac address="52:54:00:DD:FA:10"/>
        <ip address="" netmask=""/>
        <boot_protocol>none</boot_protocol>
        <status>
            <state>up</state>
        </status>
        <mtu>1500</mtu>
        <bridged>false</bridged>
    </host_nic>
    <host_nic href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/2a9e2dd9-d727-4399-b0c7-8ff46f54518b" id="2a9e2dd9-d727-4399-b0c7-8ff46f54518b">
        <actions>
            <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/2a9e2dd9-d727-4399-b0c7-8ff46f54518b/attach" rel="attach"/>
            <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/2a9e2dd9-d727-4399-b0c7-8ff46f54518b/detach" rel="detach"/>
        </actions>
        <name>eth1</name>
        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/25038a5e-4401-40ee-9023-e70934a00ceb" rel="master"/>
        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/2a9e2dd9-d727-4399-b0c7-8ff46f54518b/statistics" rel="statistics"/>
        <host href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e" id="af965dde-86a0-4517-9d53-eb58d322bb5e"/>
        <mac address="52:54:00:B8:DE:B2"/>
        <ip address="" netmask=""/>
        <boot_protocol>none</boot_protocol>
        <status>
            <state>up</state>
        </status>
        <mtu>1500</mtu>
        <bridged>false</bridged>
    </host_nic>
    <host_nic href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/25038a5e-4401-40ee-9023-e70934a00ceb" id="25038a5e-4401-40ee-9023-e70934a00ceb">
        <actions>
            <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/25038a5e-4401-40ee-9023-e70934a00ceb/attach" rel="attach"/>
            <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/25038a5e-4401-40ee-9023-e70934a00ceb/detach" rel="detach"/>
        </actions>
        <name>bond0</name>
        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/25038a5e-4401-40ee-9023-e70934a00ceb/statistics" rel="statistics"/>                                      <<<<<============ This api is used for bond device .
        <host href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e" id="af965dde-86a0-4517-9d53-eb58d322bb5e"/>
        <network href="/api/networks/46dc6c79-677e-46f5-b40e-ec0e62a27a52" id="46dc6c79-677e-46f5-b40e-ec0e62a27a52"/>
        <mac address="52:54:00:dd:fa:10"/>
        <ip address="192.168.100.61" netmask="255.255.255.0" gateway="192.168.100.1"/>
        <bonding>
            <options>
                <option name="mode" value="1" type="Active-Backup"/>
                <option name="miimon" value="100"/>
            </options>
            <slaves>
                <host_nic href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/72020a1e-b666-4f77-936a-ff85130b7e26" id="72020a1e-b666-4f77-936a-ff85130b7e26">
                    <actions>
                        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/72020a1e-b666-4f77-936a-ff85130b7e26/attach" rel="attach"/>
                        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/72020a1e-b666-4f77-936a-ff85130b7e26/detach" rel="detach"/>
                    </actions>
                </host_nic>
                <host_nic href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/2a9e2dd9-d727-4399-b0c7-8ff46f54518b" id="2a9e2dd9-d727-4399-b0c7-8ff46f54518b">
                    <actions>
                        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/2a9e2dd9-d727-4399-b0c7-8ff46f54518b/attach" rel="attach"/>
                        <link href="/api/hosts/af965dde-86a0-4517-9d53-eb58d322bb5e/nics/2a9e2dd9-d727-4399-b0c7-8ff46f54518b/detach" rel="detach"/>
                    </actions>
                </host_nic>
            </slaves>
        </bonding>
        <boot_protocol>dhcp</boot_protocol>
        <status>
            <state>up</state>
        </status>
        <mtu>1500</mtu>
        <bridged>true</bridged>
        <custom_configuration>false</custom_configuration>
    </host_nic>
</host_nics>
========================================================================================================================================

Version-Release number of selected component (if applicable):
resteasy-2.3.6-1.Final_redhat_1.ep6.el6.noarch
rhevm-restapi-3.2.3-0.43.el6ev.noarch

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Java Trace noticed in engine.log .
========================================================================================================================================

2013-10-09 19:04:45,719 INFO  [org.ovirt.engine.core.bll.LoginUserCommand] (ajp-/127.0.0.1:8702-10) Running command: LoginUserCommand internal: false.
2013-10-09 19:04:45,730 WARN  [org.ovirt.engine.core.compat.backendcompat.PropertyInfo] (ajp-/127.0.0.1:8702-10) Unable to get value of property: glusterVolume for class org.ovirt.engine.core.bll.LoginUserCommand
2013-10-09 19:04:45,730 WARN  [org.ovirt.engine.core.compat.backendcompat.PropertyInfo] (ajp-/127.0.0.1:8702-10) Unable to get value of property: vds for class org.ovirt.engine.core.bll.LoginUserCommand
2013-10-09 19:04:45,746 WARN  [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-10) calling GetConfigurationValueQuery (ApplicationMode) with null version, using default general for version
2013-10-09 19:04:45,755 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-10) Operation Failed: null: java.lang.NullPointerException
	at org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery.getStatistics(HostNicStatisticalQuery.java:33) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery.getStatistics(HostNicStatisticalQuery.java:13) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.BackendStatisticsResource.list(BackendStatisticsResource.java:47) [restapi-jaxrs.jar:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09-icedtea]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09-icedtea]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]
	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09-icedtea]
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:159) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:107) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:154) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:107) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:154) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:107) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:154) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec.jar:1.0.2.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:499) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web.jar:7.2.1.Final-redhat-10]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.jboss.web.rewrite.RewriteValve.invoke(RewriteValve.java:466) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:488) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420) [jbossweb.jar:7.2.2.Final-redhat-1]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb.jar:7.2.2.Final-redhat-1]
	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]

2013-10-09 19:04:45,760 INFO  [org.ovirt.engine.core.bll.LogoutUserCommand] (ajp-/127.0.0.1:8702-10) [6b618ead] Running command: LogoutUserCommand internal: false.
2013-10-09 19:04:45,761 WARN  [org.ovirt.engine.core.compat.backendcompat.PropertyInfo] (ajp-/127.0.0.1:8702-10) Unable to get value of property: glusterVolume for class org.ovirt.engine.core.bll.LogoutUserCommand
2013-10-09 19:04:45,761 WARN  [org.ovirt.engine.core.compat.backendcompat.PropertyInfo] (ajp-/127.0.0.1:8702-10) Unable to get value of property: vds for class org.ovirt.engine.core.bll.LogoutUserCommand
========================================================================================================================================

Comment 5 Moti Asayag 2013-10-10 10:35:12 UTC
Please verify statistics are well presented for bonds as well (for both bonds which a network is assigned to or the a bond without a network).

Comment 6 Meni Yakove 2013-10-10 11:39:22 UTC
Verified on bond and bond+vlan

Comment 7 Charlie 2013-11-28 00:22:21 UTC
This bug is currently attached to errata RHEA-2013:15231. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 9 errata-xmlrpc 2014-01-21 17:35:13 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHSA-2014-0038.html