Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1416487 - [REST API] Hot plug max memory - failed on engine but action return success
Summary: [REST API] Hot plug max memory - failed on engine but action return success
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.1.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Tomas Jelinek
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-25 15:37 UTC by Israel Pinto
Modified: 2017-02-08 07:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-08 07:49:47 UTC
oVirt Team: Virt


Attachments (Terms of Use)
engine.log (194.62 KB, application/zip)
2017-01-25 16:08 UTC, Israel Pinto
no flags Details

Description Israel Pinto 2017-01-25 15:37:53 UTC
Description of problem:
Hot plug of max memory should not be allowed in general,
We hotplug memory to VM and also update max_memory value to more then is 
set on VM.
The action failed on engine side and it write to the logs.
About the update action via REST success.

Version-Release number of selected component (if applicable):
oVirt Engine Version: 4.1.0.3-0.0.master.20170123183440.gita89d24a.el7.centos

Steps:
1. Create VM with memory of 1GB and max_memory 2GB
2. Via REST update memory to 2 GB and max_memory to 3GB 
REST request:
<vm>
    <memory>2415919104</memory>
    <memory_policy>
         <max>3489660928</max>
     </memory_policy>
</vm>


Actual results:
Action failed on engine and REST response is 200 OK

Expected results:
REST should not allow hotplug of max_memory or at least return 
that action failed.


Additional info:
Engine log:
2017-01-25 17:06:30,064+02 INFO  [org.ovirt.engine.core.bll.UpdateVmCommand] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Running command: UpdateVmCommand internal: false. Entities affected :  ID: 1b1217db-ff0a-4e98-b408-a4f71e8af776 Type: VMAction group EDIT_VM_PROPERTIES with role type USER
2017-01-25 17:06:30,065+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Field 'maxMemorySizeMb' can not be updated when status is 'Up'
2017-01-25 17:06:30,065+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] ObjectIdentityChecker.isUpdateValid:: Not updatable field 'maxMemorySizeMb' was updated
2017-01-25 17:06:30,075+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Field 'balloonEnabled' can not be updated when status is 'Up'
2017-01-25 17:06:30,075+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Field 'rngDevice' can not be updated when status is 'Up'
2017-01-25 17:06:30,075+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Field 'soundDeviceEnabled' can not be updated when status is 'Up'
2017-01-25 17:06:30,075+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Field 'consoleEnabled' can not be updated when status is 'Up'
2017-01-25 17:06:30,077+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Field 'virtioScsiEnabled' can not be updated when status is 'Up'
2017-01-25 17:06:30,077+02 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [6d571db5-5502-4666-8a63-a33b4e0b8a8c] Field 'graphicsDevices' can not be updated when status is 'Up'
2017-01-25 17:06:30,161+02 INFO  [org.ovirt.engine.core.bll.HotSetAmountOfMemoryCommand] (default task-13) [40e0799e] Running command: HotSetAmountOfMemoryCommand internal: true. Entities affected :  ID: 1b1217db-ff0a-4e98-b408-a4f71e8af776 Type: VMAction group EDIT_VM_PROPERTIES with role type USER
2017-01-25 17:06:30,166+02 INFO  [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [40e0799e] START, SetAmountOfMemoryVDSCommand(HostName = host_mixed_2, Params:{runAsync='true', hostId='c1aff2cb-fb1b-440d-8439-2a623995672f', vmId='1b1217db-ff0a-4e98-b408-a4f71e8af776', memoryDevice='VmDevice:{id='VmDeviceId:{deviceId='8167c437-3883-4660-9e10-16a8e2c48639', vmId='1b1217db-ff0a-4e98-b408-a4f71e8af776'}', device='memory', type='MEMORY', bootOrder='0', specParams='[node=0, size=1280]', address='', managed='true', plugged='true', readOnly='false', deviceAlias='', customProperties='null', snapshotId='null', logicalName='null', hostDevice='null'}'}), log id: 19f410b1
2017-01-25 17:06:31,191+02 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [40e0799e] Failed in 'SetAmountOfMemoryVDS' method
2017-01-25 17:06:31,204+02 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [40e0799e] EVENT_ID: VDS_BROKER_COMMAND_FAILURE(10,802), Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: VDSM host_mixed_2 command SetAmountOfMemoryVDS failed: unsupported configuration: Attaching memory device with size '1310720' would exceed domain's maxMemory config
2017-01-25 17:06:31,205+02 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [40e0799e] Command 'SetAmountOfMemoryVDSCommand(HostName = host_mixed_2, Params:{runAsync='true', hostId='c1aff2cb-fb1b-440d-8439-2a623995672f', vmId='1b1217db-ff0a-4e98-b408-a4f71e8af776', memoryDevice='VmDevice:{id='VmDeviceId:{deviceId='8167c437-3883-4660-9e10-16a8e2c48639', vmId='1b1217db-ff0a-4e98-b408-a4f71e8af776'}', device='memory', type='MEMORY', bootOrder='0', specParams='[node=0, size=1280]', address='', managed='true', plugged='true', readOnly='false', deviceAlias='', customProperties='null', snapshotId='null', logicalName='null', hostDevice='null'}'})' execution failed: VDSGenericException: VDSErrorException: Failed to SetAmountOfMemoryVDS, error = unsupported configuration: Attaching memory device with size '1310720' would exceed domain's maxMemory config, code = 70
2017-01-25 17:06:31,205+02 INFO  [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [40e0799e] FINISH, SetAmountOfMemoryVDSCommand, log id: 19f410b1
2017-01-25 17:06:31,222+02 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [40e0799e] EVENT_ID: FAILED_HOT_SET_MEMORY(2,040), Correlation ID: 40e0799e, Call Stack: null, Custom Event ID: -1, Message: Failed to hot set memory to VM golden_env_mixed_virtio_0. Underlying error message: unsupported configuration: Attaching memory device with size '1310720' would exceed domain's maxMemory config

Comment 1 Israel Pinto 2017-01-25 16:08:28 UTC
Created attachment 1244297 [details]
engine.log

Comment 2 Tomas Jelinek 2017-01-30 09:13:16 UTC
This does not look like a bug - just a behavior. If you do the same from UI, the behavior should be the same. It will pass and give a message in audit log. Is it like this?

Comment 3 Israel Pinto 2017-01-30 09:40:59 UTC
From the UI you can update the max memory, in the dialog we get inform that:
Changes that require Virtual Machine restart:
maxMemorySizeMb
minAllocatedMem

No errors found in engine log, and memory is updated.

Comment 4 Tomas Jelinek 2017-01-31 08:45:20 UTC
if you want to make REST API do the NEXT_RUN than you need to add the ;next_run=true at the end.

Does this do what you expect?

Comment 5 Tomas Jelinek 2017-02-08 07:49:47 UTC
I will assume Comment 4 is the reason. Please feel free to reopen in case it was a real issue


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