Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1375678

Summary: Template/InstanceType migration mode (placement policy affinity) value has inconsistencies between webadmin/api/DB
Product: [oVirt] ovirt-engine Reporter: sefi litmanovich <slitmano>
Component: RestAPIAssignee: Andrej Krejcir <akrejcir>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.4CC: akrejcir, bugs, dfediuck, lsvaty, lveyde, tjelinek
Target Milestone: ovirt-4.2.2Flags: dfediuck: ovirt-4.2?
rule-engine: planning_ack?
rule-engine: devel_ack+
mavital: testing_ack+
Target Release: 4.2.2.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-27 07:23:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sefi litmanovich 2016-09-13 16:36:06 UTC
Description of problem:
In the instance type or template create/edit menu in webadmin, under the host tab, the option to choose the migration mode exist and is changeable.
This option should be reflected in API with the placement_policy attribute and affinity sub-attrbiute, same as it does for vms.
In practice changing the value via webadmin affects the DB as expected, but the attribute doesn't exist in API so cannot be edited using it.
Furthermore only with templates, the value that was set in webadmin and is changes in DB doesn't reflect in webadmin when you edit the template once more and always returns back to the default mode = 'Allow manual and automatic migration'

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


How reproducible:
rhevm-4.0.4.2-0.1.el7ev.noarch

Steps to Reproduce:
1. Edit a template or an instance type.
2. Under Host tab choose 'migration mode' = Allow manual migration
3. call GET cmd via API for the template entity.

Actual results:
in DB the correct value is set (migration_support column in vm_static table is set to 1).
In webadmin - the value persists for instance type, but is reverted to 'Allow manual and automatic migration' for templates.
Via API the value isn't visible at all (tried all-content flag as well).

Expected results:
All values are aligned between webadmin-DB-API and are reflected properly.

Additional info:

Comment 1 Yaniv Kaul 2017-11-29 10:39:29 UTC
Is anyone looking at this? I assume not for 4.2.0?

Comment 2 Polina 2018-04-26 08:29:36 UTC
Verification is done on rhv-release-4.2.3-2-001.noarch

Verification steps:

In the existent template choose Host tab and change migration mode to 'Allow manual migration only'. Create the VM from thos template.
Results:
1. in postgres - 
   select migration_support from vm_static where vm_guid='aa257ee2-3594-49b8-93a3-5fca07ee7bdc';
   1
2. In UI the VM is created with 'Allow manual migration only'.
3. In get vms API - 
        <placement_policy>
            <affinity>user_migratable</affinity>
        </placement_policy>

Comment 3 Sandro Bonazzola 2018-04-27 07:23:00 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

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