Red Hat Bugzilla – Bug 1278738
The "virtio_scsi" element isn't populated when a VM is requested
Last modified: 2016-08-17 10:37:40 EDT
When a VM is requested using the RESTAPI the "virtio_scsi" element isn't populated. The expected result should be the following:
As a side effect, when using the Python SDK the following code used to disable VirtIO SCSI will fail:
vm = api.vms.get(name="myvm")
It will fail because "vm.get_virtio_scsi()" returns "None".
As a workaround Python SDK users can do the following:
The reason for this missing information is that computing it is expensive, as it requires an additional query per VM, so it has been made optional, it will only be returned when the "All-Content" header is "true":
Note also that "enabled" is an attribute, not an inner element as in the description of the bug.
In the Python SDK the "All-Content" header can be activated using the "all_content" parameter of the operation that retrieves the VM:
vm = api.vms.get(name="myvm", all_content=True)
As this was a design decision and there are workarounds I think that we aren't going to change it.
I agree with comment #1. I guess the bug can be closed, right
Honesly I cannot believe that either RHEV or Python SDK will not be fixed. How can I as a mere user know that this workaround is necessary?
Speaking as a regular SDK user, I would like something which acts consistently and does not blow up in unexpected ways.
I this kind of situation we can change the server so that it returns always all the information by default. That hurts performance, so we aren't doing it.
We can improve things for users documenting it. That is what the proposed patch does.
In version 4.0 the documentation will be available from the server, and will look like this:
This documentation will eventually also added to the SDK itself.
But other than documenting it I don't see how we can make the system more consistent in these regards, unless we always return all the information.
verified on :
Red Hat Virtualization Manager Version: 126.96.36.199-0.1.el7ev
in REST API: