+++ This bug is a downstream clone. The original bug is: +++ +++ bug 1718141 +++ ====================================================================== Description of problem: A GET on api/hosts/host:id/nics/nic:id should return a HostNic struct. One of the attributes of this struct is virtual_functions_configuration of type HostNicVirtualFunctionsConfiguration. However, this is not returned, even if the NIC is SR-IOV capable or already configured with several VFs: # curl -X GET -H "Accept: application/xml" -u admin@internal:redhat --cacert /etc/pki/ovirt-engine/apache-ca.pem https://FQDN/ovirt-engine/api/hosts/878c17db-b9b3-4bb7-8569-f6249159e74d/nics/8fdbac61-7c14-443a-94e5-1a90a223c535 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <host_nic href="/ovirt-engine/api/hosts/878c17db-b9b3-4bb7-8569-f6249159e74d/nics/8fdbac61-7c14-443a-94e5-1a90a223c535" id="8fdbac61-7c14-443a-94e5-1a90a223c535"> <actions/> <name>eno3</name> <link href="/ovirt-engine/api/hosts/878c17db-b9b3-4bb7-8569-f6249159e74d/nics/8fdbac61-7c14-443a-94e5-1a90a223c535/networklabels" rel="networklabels"/> <link href="/ovirt-engine/api/hosts/878c17db-b9b3-4bb7-8569-f6249159e74d/nics/8fdbac61-7c14-443a-94e5-1a90a223c535/networkattachments" rel="networkattachments"/> <link href="/ovirt-engine/api/hosts/878c17db-b9b3-4bb7-8569-f6249159e74d/nics/8fdbac61-7c14-443a-94e5-1a90a223c535/linklayerdiscoveryprotocolelements" rel="linklayerdiscoveryprotocolelements"/> <link href="/ovirt-engine/api/hosts/878c17db-b9b3-4bb7-8569-f6249159e74d/nics/8fdbac61-7c14-443a-94e5-1a90a223c535/statistics" rel="statistics"/> <boot_protocol>none</boot_protocol> <bridged>false</bridged> <ip> <address></address> <netmask></netmask> <version>v4</version> </ip> <ipv6_boot_protocol>autoconf</ipv6_boot_protocol> <mac> <address>40:f2:e9:08:96:d4</address> </mac> <mtu>1500</mtu> <status>down</status> <host href="/ovirt-engine/api/hosts/878c17db-b9b3-4bb7-8569-f6249159e74d" id="878c17db-b9b3-4bb7-8569-f6249159e74d"/> </host_nic> I might be wrong, but it looks like that to include vdsConfig this the GET on HostNic would need to call lookupNic[1] with the second parameter as `true`, so that it runs doPopulate which apparently makes it include vfsConfig[2]. [1] https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostNicResource.java#L44 [2] https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostNicsResource.java#L174 Version-Release number of selected component (if applicable): rhvm-4.2.8.7-0.1.el7ev.noarch (don't see a related code change on 4.3 or master) How reproducible: Always Steps to Reproduce: 1. curl -X GET -H "Accept: application/xml" https://<FQDN>/ovirt-engine/api/hosts/host:id/nics/nic:id Actual results: Missing virtual_functions_configuration Expected results: With virtual_functions_configuration Additional info: HostNic struct: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/rest_api_guide/types#types-host_nic (Originally by Germano Veit Michel)
We need to add this to module documentation. It should be populated in case you send header 'All-content: true'. (Originally by Ondra Machacek)
Actually I see customer reported it on SDK, usually if it defined in model, and documented, you can use all_content as follows: my_service.list(search='name=myentity', all_content=True) but it's not for the host nics service. So you can workaround it using: my_service.list(search='name=myentity', headers={'All-content': True}) (Originally by Ondra Machacek)
Hi Ondra, Thanks for the quick response, the workaround works for the customer. Cheers, Amar (Originally by Amar Shah)
(In reply to Ondra Machacek from comment #3) > but it's not for the host nics service. So you can workaround it using: > > my_service.list(search='name=myentity', headers={'All-content': True}) Its only for vms_service() right? I did try on nics_service and it indeed is not implemented there. I think you had a few bugs from me where the problem is all_content. Maybe we should review everything that might be missing it? Thanks (Originally by Germano Veit Michel)
(In reply to Germano Veit Michel from comment #5) > > Maybe we should review everything that might be missing it? > Yeah, in order to not have similar bugs in future, it would be good to review all places and fix them if needed. (Originally by Ondra Machacek)
Dominik, is this a bug in REST-API or in SDK? (Originally by Dominik Holler)
(In reply to Dominik Holler from comment #7) > Dominik, is this a bug in REST-API or in SDK? REST-API. If this bug is fixed, the virtual_functions_configuration will be included, if the HTTP request contains the header "All-Content: True". Please note that the query string ?all_content=true is ignored because of bug 1383746. (Originally by Dominik Holler)
Michael, can you please formally ack the bug? (Originally by Dominik Holler)
Is this on wrong component? Or does this require a sdk rebuild? I found reference to this bug in ovirt-engine-4.3.5.4 code commits but not in SDK.
This needs SDK rebuild. I've added appropriate fixed-in-version.
Verified on ovirt version 4.3.5.4-0.1.el7. If a request contains a header "All-Content: True", a result contains <virtual_functions_configuration> ... </virtual_functions_configuration>
The doc_text field said: "The all_content parameter is added to the documentation of the HostNicService" Which documentation? The REST API Guide? It's not published yet, will the model be updated for RHV 4.3.5? _______________ > Cause: The documentation did not include the all_content attribute of the HostNicService. > Consequence: The ovirt-engine-sdk-pyton did not offer this parameter to the user. _______________ I don't understand. Are you saying that because the documentation (again, not sure which document) didn't include the all_content parameter (and the HostNicService?), the Python SDK didn't offer this parameter? Do you mean that the parameter existed, but because it wasn't documented, the user had no way of knowing that this parameter existed? I updated the doc_text field according to my understanding based on what appears in this bug and in the upstream version, but I can't find it mentioned in any published guide, neither upstream nor downstream. If it is published, please include a URL to the document.
(In reply to Steve Goodman from comment #17) > The doc_text field said: > > "The all_content parameter is added to the documentation of the > HostNicService" > > Which documentation? The REST API Guide? Yes. > It's not published yet, will the > model be updated for RHV 4.3.5? > Yes, the REST API Guide should be updated. > _______________ > > > Cause: The documentation did not include the all_content attribute of the HostNicService. > > > Consequence: The ovirt-engine-sdk-pyton did not offer this parameter to the user. > _______________ > > I don't understand. Are you saying that because the documentation (again, > not sure which document) didn't include the all_content parameter (and the > HostNicService?), the Python SDK didn't offer this parameter? Parts of the REST API Guide and the SDK are generated from the same source, the ovirt-engine-api-model. > Do you mean > that the parameter existed, but because it wasn't documented, the user had > no way of knowing that this parameter existed? > The plain REST API user could have guess this, but the parameter was not available to Python SDK users. > I updated the doc_text field according to my understanding based on what Both, the REST API Guide and the ovirt-engine-sdk-python are both generated, so the change in the doc is not the reason why ovirt-engine-sdk-python is updated. The reason is the update of the ovirt-engine-api-model, but I think this is not relevant to the user. Maybe it is enough to mention that both is updated. Maybe: The Red Hat Virtualization REST API Guide did not include the all_content attribute of the HostNicService. Consequently, it was not possible to use this parameter with ovirt-engine-sdk-python. -> The Red Hat Virtualization REST API Guide did not include the all_content attribute of the HostNicService. And it was not possible to use this parameter with ovirt-engine-sdk-python. > appears in this bug and in the upstream version, but I can't find it > mentioned in any published guide, neither upstream nor downstream. If it is > published, please include a URL to the document. http://ovirt.github.io/ovirt-engine-api-model/4.3/#services/host_nic/methods/get
OK, thanks Dominik. So I believe that the doc_text is correct. Correct?
I think the "Consequently" should be replaced by "And".
Thanks Steve!
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. https://access.redhat.com/errata/RHBA-2019:2447
sync2jira