Bug 1509375 - Update VM from REST fails if next run spanshot exists
Summary: Update VM from REST fails if next run spanshot exists
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: future
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.2.0
: ---
Assignee: jniederm
QA Contact: Vladimir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-03 16:09 UTC by jniederm
Modified: 2018-02-22 09:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-22 09:58:34 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)
engine-log-generated-by-the-erroneous-request.txt (5.53 KB, text/plain)
2017-11-03 16:09 UTC, jniederm
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 83642 0 master MERGED core: UpdateVm from REST with next-run-snapshot fix 2017-11-08 15:16:56 UTC

Description jniederm 2017-11-03 16:09:33 UTC
Created attachment 1347437 [details]
engine-log-generated-by-the-erroneous-request.txt

Description of problem:
UpdateVmCommand fails since #areUpdatedFieldsLegal() returns false since VM instance form DB and from params differs not only in socket count but also in e.g. 'managedDeviceMap' (from params: filled, from db: empty) and 'exportDate' (from params: date of next run snapshot, from db: null).

List of all changed field according to ObjectIdentityChecker#getChangedFields(): [clusterCompatibilityVersionOrigin, dbGeneration, exportDate, managedDeviceMap, numOfSockets, ovfVersion, quotaEnforcementType, quotaName, vmInit]

Version-Release number of selected component (if applicable):
current master, commit 930bddb235

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with 2 CPU sockets
2. Run the VM
3. Set num of cpu sockets to 1 using REST with next_run=true options
   PUT api/vms/{vmId}?next_run=true
   <vm>
       <cpu>
           <topology>
               <sockets>1</sockets>
           </topology>
       </cpu>
   </vm>
4. Send the same request again

Actual results:
It fails with status code 400:
<fault>
    <detail>[There was an attempt to change VM values while the VM is not down. Please shut down the VM in order to modify these properties.]</detail>
    <reason>Operation Failed</reason>
</fault>


Expected results:
VM keeps its configuration, request passes

Additional info:

Comment 1 Vladimir 2018-02-12 15:10:56 UTC
Verified on 4.2.1.6-0.1.el7

Scenario:
1. Update sockets using next_run=true
2. Update sockets once more - PASS

Comment 2 Sandro Bonazzola 2018-02-22 09:58:34 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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


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