Bug 1113571

Summary: Fail to update VM with any field, on missing domain name.
Product: Red Hat Enterprise Virtualization Manager Reporter: Ilanit Stein <istein>
Component: ovirt-engine-restapiAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Ilanit Stein <istein>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.4.0CC: acathrow, bazulay, eedri, iheim, istein, jraju, juan.hernandez, kabbott, mavital, oramraz, Rhev-m-bugs, sherold, yeylon
Target Milestone: ---Keywords: AutomationBlocker, Regression, ZStream
Target Release: 3.4.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: av11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-04 15:16:03 UTC 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: 1123858    

Description Ilanit Stein 2014-06-26 12:46:46 UTC
Description of problem:
Update vm description fail on:
"If Domain supplied, Domain name expected to be supplied as well."

Version-Release number of selected component (if applicable):
av9.6

How reproducible:
100% on automation test:
http://jenkins.qa.lab.tlv.redhat.com:8080/view/Compute/view/3.4-git/view/Virt/job/3.4-git-compute-virt-reg_vms-nfs/

Additional info from test:
2014-06-22 16:29:22,445 - MainThread - vms - DEBUG - UPDATE api content is --  collection :vms element:<vm>
    <description>TEST</description>
</vm>
 
2014-06-22 16:29:22,520 - MainThread - core_api - DEBUG - Request PUT response time: 0.010
2014-06-22 16:29:22,521 - MainThread - vms - ERROR - Failed to update an element, status: 400, reason: Bad Request, details: If Domain supplied, Domain name expected to be supplied as well.

Comment 2 Ilanit Stein 2014-06-29 06:07:59 UTC
It seems the problem is more general, and VM can't be updated with any field,
and not just description.

Comment 3 Juan Hernández 2014-07-11 10:19:01 UTC
I'm checking this with the latest upstream 3.5 master and it works correctly. I'm moving to MODIFIED so that QE can test it with the next downstream release.

Comment 4 Ilanit Stein 2014-07-21 15:16:34 UTC
I have it failing, on latest 3.4.1 (av10.3), all SDK update VM test cases. 
java_sdk_python_version=3.4.1.2.1

http://jenkins.qa.lab.tlv.redhat.com:8080/view/Compute/view/3.4-git/view/multi-apis/job/3.4-git-compute-virt-reg_vms-nfs/15/#showFailuresLink

Comment 5 Juan Hernández 2014-07-21 17:43:07 UTC
This happens because a blank domain name is represented in the RESTAPI as follows:

  <domain>
    <name></name>
  </domain>

But the version of generateDS.py that we use in 3.4 doesn't handle correctly these empty tags, it just removes them, so what it is sending to the server as part of the update is the following:

  <domain/>

And this is rightfully rejected by the server, because when a domain is provided the name has to be provided as well, see bug 1049080.

The SDK problem has been solved in 3.5 updating the version of generateDS.py, see bug 1091688, this could be considered a duplicate.

I think that updating the version of generateDS.py for 3.4 is too risky, as it hasn't been well tested yet.

To solve this particular case we will modify the server so that it ignores blank domains, thus avoiding the issue of the Python SDK for this particular case.

Meanwhile the issue can bet worked around changing in the database the value of the "domain" column of the "vm_init" table, so that if it is empty it will be replaced by null:

  update vm_init set doumain = null where domain=""

Comment 8 Eyal Edri 2014-08-17 07:38:23 UTC
ilanit, this bug is 3.4.2, not 3.5.0, you need to verify it with av11.
av11 != 3.5.0 rc1, please make sure this bug is verifed on engine from av11:
rhevm-3.4.2-0.1.el6ev.noarch.rpm

Comment 9 Ilanit Stein 2014-08-19 12:29:42 UTC
Sorry my mistake, this bug was verified on av11. In comment #11 'ovirt-3.5.0_rc1' is wrong.
Also you can see the verification link is for a test, run on av11.