Bug 1249521 - [REST API] Update vm affinity to 'vm_affinity_migratable' failed since host tag is empty
Summary: [REST API] Update vm affinity to 'vm_affinity_migratable' failed since host t...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Dudi Maroshi
QA Contact: Israel Pinto
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-03 09:02 UTC by Israel Pinto
Modified: 2016-04-20 01:10 UTC (History)
12 users (show)

Fixed In Version: 3.6.0-11
Doc Type: Bug Fix
Doc Text:
Updated the REST API code to enable a virtual machine's affinity to be updated from 'migratable' to 'pinned' when supplying an empty <hosts/> and a valid <host> tag.
Clone Of:
Environment:
Last Closed: 2016-04-20 01:10:12 UTC
oVirt Team: SLA
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 45128 0 master MERGED restapi: allow new VM with no dedicated host in migration policy Never
oVirt gerrit 45256 0 ovirt-engine-3.6 MERGED restapi: allow new VM with no dedicated host in migration policy Never

Description Israel Pinto 2015-08-03 09:02:44 UTC
Description of problem:
In automation testing we update vm affinity to migratable via rest.
It failed to update vm with error:
VmPlacementPolicy [host.id|name] required for validateAndUpdateHostsInPlacementPolicy 

Version-Release number of selected component (if applicable):
3.6.0.4
oVirt Engine Version: 3.6.0-0.0.master.20150726172446.git65db93d.el6 

How reproducible:
All the time

Actual results:
Failed to update host

Expected results:
Update succeed
 
Additional info:
Rest request:
<vm id="c8d1f344-069d-4e14-a515-b88b66195d09">
<placement_policy>
<host/>
<affinity>pinned</affinity>
</placement_policy>
</vm>

also with:
<hosts>
<host/>
</hosts>

Comment 2 Israel Pinto 2015-10-27 15:21:54 UTC
Verify with:
RHEVM 3.6: rhevm-3.6.0-0.18.el6.noarch
VDSM: vdsm-4.17.10-5.el7ev
libvirt: libvirt-1.2.17-5.el7

1. Send request via REST to pin VM host in list :
<vm id="d3f958c9-96de-4665-8d50-bbc855eb184d">
<placement_policy>
<affinity>pinned</affinity>
<hosts>
 <host >
  <name>host_1</name>      
</host>
</hosts>
</placement_policy>
</vm>

The VM affinity update to 'pinned' from 'migratable'.
But the host list did not appear in VM, only in GUI.

2. Send request back to migratable --> PASS
3. Send request to pin VM with empty host list:
<vm id="d3f958c9-96de-4665-8d50-bbc855eb184d">
<placement_policy>
<affinity>pinned</affinity>
</hosts>
</placement_policy>
</vm>

The VM affinity update to 'pinned' from 'migratable'.
But the host list did not appear in VM, only in GUI.

If we send request with element 'host' for backwards compatibility
We failed with error:
"Cannot edit VM. VM is pinned to a specific host. The required host doesn't exist"
There is opened BZ about it:
https://bugzilla.redhat.com/show_bug.cgi?id=1260732

Opening new bug:
Host list don't appear under placement_policy after update VM to pinned
https://bugzilla.redhat.com/show_bug.cgi?id=1275733


Note You need to log in before you can comment on or make changes to this bug.