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

Bug 1618462

Summary: UpdateVmCommand raises: "Exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback" after updating VM memory
Product: [oVirt] ovirt-engine Reporter: Elad <ebenahar>
Component: BLL.VirtAssignee: Andrej Krejcir <akrejcir>
Status: CLOSED CURRENTRELEASE QA Contact: Liran Rotenberg <lrotenbe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.4CC: akrejcir, bugs, ebenahar, michal.skrivanek
Target Milestone: ovirt-4.2.7Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-02 14:35:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
logs none

Description Elad 2018-08-16 17:28:56 UTC
Created attachment 1476474 [details]
logs

Description of problem:
Tried to update VM's memory attributes (Memory Size, Maximum memory and Physical Memory Guaranteed), while the VM was running, and got an SQL exception.


Version-Release number of selected component (if applicable):
rhvm-4.2.4-0.1.el7.noarch
[root@ratamir-rhevm ~]# rpm -qa |grep ovirt
ovirt-engine-dwh-4.2.4-1.el7ev.noarch
ovirt-imageio-proxy-setup-1.3.1.2-0.el7ev.noarch
ovirt-log-collector-4.2.6-2.el7ev.noarch
ovirt-ansible-v2v-conversion-host-1.2.0-1.el7ev.noarch
ovirt-engine-tools-backup-4.2.4-0.1.el7.noarch
ovirt-engine-backend-4.2.4-0.1.el7.noarch
ovirt-engine-api-explorer-0.0.1-1.el7ev.noarch
ovirt-vmconsole-proxy-1.0.4-1.el7ev.noarch
ovirt-engine-setup-4.2.4-0.1.el7.noarch
ovirt-ansible-cluster-upgrade-1.1.7-1.el7ev.noarch
ovirt-engine-cli-3.6.8.1-1.el7ev.noarch
ovirt-engine-websocket-proxy-4.2.4-0.1.el7.noarch
ovirt-ansible-infra-1.1.5-1.el7ev.noarch
ovirt-ansible-vm-infra-1.1.7-1.el7ev.noarch
ovirt-engine-webadmin-portal-4.2.4-0.1.el7.noarch
ovirt-engine-sdk-python-3.6.9.1-1.el7ev.noarch
ovirt-host-deploy-1.7.3-1.el7ev.noarch
ovirt-provider-ovn-1.2.10-1.el7ev.noarch
ovirt-imageio-proxy-1.3.1.2-0.el7ev.noarch
ovirt-engine-extensions-api-impl-4.2.4-0.1.el7.noarch
ovirt-cockpit-sso-0.0.4-1.el7ev.noarch
ovirt-engine-tools-4.2.4-0.1.el7.noarch
ovirt-vmconsole-1.0.4-1.el7ev.noarch
ovirt-engine-lib-4.2.4-0.1.el7.noarch
ovirt-engine-setup-plugin-ovirt-engine-common-4.2.4-0.1.el7.noarch
ovirt-iso-uploader-4.2.0-1.el7ev.noarch
ovirt-ansible-manageiq-1.1.8-1.el7ev.noarch
ovirt-setup-lib-1.1.4-1.el7ev.noarch
ovirt-ansible-roles-1.1.4-2.el7ev.noarch
ovirt-engine-4.2.4-0.1.el7.noarch
python-ovirt-engine-sdk4-4.2.6-2.el7ev.x86_64
ovirt-engine-setup-base-4.2.4-0.1.el7.noarch
ovirt-engine-setup-plugin-ovirt-engine-4.2.4-0.1.el7.noarch
ovirt-host-deploy-java-1.7.3-1.el7ev.noarch
ovirt-ansible-disaster-recovery-1.1.0-1.el7ev.noarch
ovirt-engine-extension-aaa-jdbc-1.1.7-1.el7ev.noarch
ovirt-engine-dashboard-1.2.3-2.el7ev.noarch
ovirt-engine-setup-plugin-websocket-proxy-4.2.4-0.1.el7.noarch
ovirt-web-ui-1.3.9-1.el7ev.noarch
ovirt-engine-dbscripts-4.2.4-0.1.el7.noarch
ovirt-ansible-image-template-1.1.6-2.el7ev.noarch
ovirt-imageio-common-1.3.1.2-0.el7ev.noarch
ovirt-engine-vmconsole-proxy-helper-4.2.4-0.1.el7.noarch
ovirt-engine-dwh-setup-4.2.4-1.el7ev.noarch
ovirt-js-dependencies-1.2.0-3.1.el7ev.noarch
ovirt-engine-restapi-4.2.4-0.1.el7.noarch
ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.2.4-0.1.el7.noarch
ovirt-engine-metrics-1.1.5-1.el7ev.noarch
RHEL7.5
kernel - 3.10.0-862.3.2.el7.x86_64
rh-postgresql95-postgresql-libs-9.5.9-1.el7.x86_64
rh-postgresql95-postgresql-9.5.9-1.el7.x86_64
postgresql-9.2.23-3.el7_4.x86_64
rh-postgresql95-postgresql-server-9.5.9-1.el7.x86_64
rh-postgresql95-postgresql-contrib-9.5.9-1.el7.x86_64
rh-postgresql95-runtime-2.2-2.el7.x86_64
postgresql-libs-9.2.23-3.el7_4.x86_64
postgresql-jdbc-9.2.1002-6.el7_5.noarch
postgresql-server-9.2.23-3.el7_4.x86_64
collectd-postgresql-5.8.0-3.el7.x86_64

How reproducible:
Seems to be consistent in case this error is raised:

2018-08-16 20:04:35,413+03 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [3b53e055] Failed in 'SetAmountOfMemoryVDS' method
2018-08-16 20:04:35,414+03 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [3b53e055] Command 'SetAmountOfMemoryVDSCommand(HostName = puma46.scl.lab.tlv.redhat.com, Params:{
hostId='a943de07-39c3-41f7-97a1-0c1544f183bb', vmId='05298100-0e82-4546-9bdf-b6e93088099d', memoryDevice='VmDevice:{id='VmDeviceId:{deviceId='55f8b945-2978-4d9f-a687-03a19b84903d', vmId='05298100-0e82-4546-9bdf-
b6e93088099d'}', device='memory', type='MEMORY', specParams='[node=0, size=3968]', address='', managed='true', plugged='true', readOnly='false', deviceAlias='', customProperties='null', snapshotId='null', logica
lName='null', hostDevice='null'}', minAllocatedMem='8192'})' execution failed: VDSGenericException: VDSErrorException: Failed to SetAmountOfMemoryVDS, error = unsupported configuration: Attaching memory device w
ith size '4063232' would exceed domain's maxMemory config, code = 70
2018-08-16 20:04:35,414+03 INFO  [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [3b53e055] FINISH, SetAmountOfMemoryVDSCommand, log id: 3c59289
2018-08-16 20:04:35,434+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [3b53e055] EVENT_ID: FAILED_HOT_SET_MEMORY(2,040), Failed to hot set memory to VM storage
-ge3-vdsm2. Underlying error message: unsupported configuration: Attaching memory device with size '4063232' would exceed domain's maxMemory config


Steps to Reproduce:
1. Update VM's memory attributes (Memory Size, Maximum memory and Physical Memory Guaranteed), while the VM is running


Actual results:
Operation fails:

2018-08-16 20:02:32,802+03 INFO  [org.ovirt.engine.core.bll.provider.network.SyncNetworkProviderCommand] (EE-ManagedThreadFactory-engineScheduled-Thread-84) [1f91c13e] Lock freed to object 'EngineLock:{exclusiveLocks='[c9469b5a-b217-4efd-b694-9da6a4558270=PROVIDER]', sha
redLocks=''}'
2018-08-16 20:04:33,339+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'maxMemorySizeMb' can not be updated when status is 'Up'
2018-08-16 20:04:33,339+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'balloonEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:33,342+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'watchdog' can not be updated when status is 'Up'
2018-08-16 20:04:33,344+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'rngDevice' can not be updated when status is 'Up'
2018-08-16 20:04:33,346+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'soundDeviceEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:33,347+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'consoleEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:33,349+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'virtioScsiEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:33,351+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-3) [5494f36b-06a4-45bb-a2a6-039f7e5883ba] Field 'graphicsDevices' can not be updated when status is 'Up'
2018-08-16 20:04:34,991+03 INFO  [org.ovirt.engine.core.bll.UpdateVmCommand] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Lock Acquired to object 'EngineLock:{exclusiveLocks='[storage-ge3-vdsm2=VM_NAME]', sharedLocks='[05298100-0e82-4546-9bdf-b6e93088099d=VM]
'}'
2018-08-16 20:04:35,119+03 INFO  [org.ovirt.engine.core.bll.UpdateVmCommand] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Running command: UpdateVmCommand internal: false. Entities affected :  ID: 05298100-0e82-4546-9bdf-b6e93088099d Type: VMAction group EDIT
_VM_PROPERTIES with role type USER
2018-08-16 20:04:35,120+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'maxMemorySizeMb' can not be updated when status is 'Up'
2018-08-16 20:04:35,120+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] ObjectIdentityChecker.isUpdateValid:: Not updatable field 'maxMemorySizeMb' was updated
2018-08-16 20:04:35,146+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'balloonEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:35,148+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'watchdog' can not be updated when status is 'Up'
2018-08-16 20:04:35,150+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'rngDevice' can not be updated when status is 'Up'
2018-08-16 20:04:35,151+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'soundDeviceEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:35,152+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'consoleEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:35,154+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'virtioScsiEnabled' can not be updated when status is 'Up'
2018-08-16 20:04:35,156+03 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] Field 'graphicsDevices' can not be updated when status is 'Up'
2018-08-16 20:04:35,191+03 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.SetDestroyOnRebootVDSCommand] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] START, SetDestroyOnRebootVDSCommand(HostName = puma46.scl.lab.tlv.redhat.com, VdsAndVmIDVDSParametersBase:{h
ostId='a943de07-39c3-41f7-97a1-0c1544f183bb', vmId='05298100-0e82-4546-9bdf-b6e93088099d'}), log id: fa6843b
2018-08-16 20:04:35,225+03 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.SetDestroyOnRebootVDSCommand] (default task-13) [158d9395-98cd-47b0-bdac-7af60303d516] FINISH, SetDestroyOnRebootVDSCommand, log id: fa6843b
2018-08-16 20:04:35,269+03 INFO  [org.ovirt.engine.core.bll.HotSetAmountOfMemoryCommand] (default task-13) [36a16109] Running command: HotSetAmountOfMemoryCommand internal: true. Entities affected :  ID: 05298100-0e82-4546-9bdf-b6e93088099d Type: VMAction group EDIT_VM_P
ROPERTIES with role type USER
2018-08-16 20:04:35,286+03 INFO  [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [36a16109] START, SetAmountOfMemoryVDSCommand(HostName = puma46.scl.lab.tlv.redhat.com, Params:{hostId='a943de07-39c3-41f7-97a1-0c1544f183bb', vmId='05298100-
0e82-4546-9bdf-b6e93088099d', memoryDevice='VmDevice:{id='VmDeviceId:{deviceId='11b35951-6002-4562-a04b-324bccdf2069', vmId='05298100-0e82-4546-9bdf-b6e93088099d'}', device='memory', type='MEMORY', specParams='[node=0, size=128]', address='', managed='true', plugged='tru
e', readOnly='false', deviceAlias='', customProperties='null', snapshotId='null', logicalName='null', hostDevice='null'}', minAllocatedMem='8192'}), log id: 5cbdf4e0
2018-08-16 20:04:35,314+03 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [36a16109] Failed in 'SetAmountOfMemoryVDS' method
2018-08-16 20:04:35,326+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [36a16109] EVENT_ID: VDS_BROKER_COMMAND_FAILURE(10,802), VDSM puma46.scl.lab.tlv.redhat.com command SetAmountOfMemoryVDS failed: unsupported configur
ation: Attaching memory device with size '131072' would exceed domain's maxMemory config
2018-08-16 20:04:35,326+03 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [36a16109] Command 'SetAmountOfMemoryVDSCommand(HostName = puma46.scl.lab.tlv.redhat.com, Params:{hostId='a943de07-39c3-41f7-97a1-0c1544f183bb', vmId='0529810
0-0e82-4546-9bdf-b6e93088099d', memoryDevice='VmDevice:{id='VmDeviceId:{deviceId='11b35951-6002-4562-a04b-324bccdf2069', vmId='05298100-0e82-4546-9bdf-b6e93088099d'}', device='memory', type='MEMORY', specParams='[node=0, size=128]', address='', managed='true', plugged='t
rue', readOnly='false', deviceAlias='', customProperties='null', snapshotId='null', logicalName='null', hostDevice='null'}', minAllocatedMem='8192'})' execution failed: VDSGenericException: VDSErrorException: Failed to SetAmountOfMemoryVDS, error = unsupported configurat
ion: Attaching memory device with size '131072' would exceed domain's maxMemory config, code = 70
2018-08-16 20:04:35,326+03 INFO  [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [36a16109] FINISH, SetAmountOfMemoryVDSCommand, log id: 5cbdf4e0
2018-08-16 20:04:35,348+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [36a16109] EVENT_ID: FAILED_HOT_SET_MEMORY(2,040), Failed to hot set memory to VM storage-ge3-vdsm2. Underlying error message: unsupported configurat
ion: Attaching memory device with size '131072' would exceed domain's maxMemory config
2018-08-16 20:04:35,387+03 INFO  [org.ovirt.engine.core.bll.HotSetAmountOfMemoryCommand] (default task-13) [3b53e055] Running command: HotSetAmountOfMemoryCommand internal: true. Entities affected :  ID: 05298100-0e82-4546-9bdf-b6e93088099d Type: VMAction group EDIT_VM_P
ROPERTIES with role type USER
2018-08-16 20:04:35,396+03 INFO  [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [3b53e055] START, SetAmountOfMemoryVDSCommand(HostName = puma46.scl.lab.tlv.redhat.com, Params:{hostId='a943de07-39c3-41f7-97a1-0c1544f183bb', vmId='05298100-
0e82-4546-9bdf-b6e93088099d', memoryDevice='VmDevice:{id='VmDeviceId:{deviceId='55f8b945-2978-4d9f-a687-03a19b84903d', vmId='05298100-0e82-4546-9bdf-b6e93088099d'}', device='memory', type='MEMORY', specParams='[node=0, size=3968]', address='', managed='true', plugged='tr
ue', readOnly='false', deviceAlias='', customProperties='null', snapshotId='null', logicalName='null', hostDevice='null'}', minAllocatedMem='8192'}), log id: 3c59289
2018-08-16 20:04:35,413+03 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [3b53e055] Failed in 'SetAmountOfMemoryVDS' method
2018-08-16 20:04:35,414+03 ERROR [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [3b53e055] Command 'SetAmountOfMemoryVDSCommand(HostName = puma46.scl.lab.tlv.redhat.com, Params:{hostId='a943de07-39c3-41f7-97a1-0c1544f183bb', vmId='0529810
0-0e82-4546-9bdf-b6e93088099d', memoryDevice='VmDevice:{id='VmDeviceId:{deviceId='55f8b945-2978-4d9f-a687-03a19b84903d', vmId='05298100-0e82-4546-9bdf-b6e93088099d'}', device='memory', type='MEMORY', specParams='[node=0, size=3968]', address='', managed='true', plugged='
true', readOnly='false', deviceAlias='', customProperties='null', snapshotId='null', logicalName='null', hostDevice='null'}', minAllocatedMem='8192'})' execution failed: VDSGenericException: VDSErrorException: Failed to SetAmountOfMemoryVDS, error = unsupported configura
tion: Attaching memory device w
ith size '4063232' would exceed domain's maxMemory config, code = 70
2018-08-16 20:04:35,414+03 INFO  [org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand] (default task-13) [3b53e055] FINISH, SetAmountOfMemoryVDSCommand, log id: 3c59289
2018-08-16 20:04:35,434+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [3b53e055] EVENT_ID: FAILED_HOT_SET_MEMORY(2,040), Failed to hot set memory to VM storage-ge3-vdsm2. Underlying error message: unsupported configuration: Attaching memory device with size '4063232' would exceed domain's maxMemory config


And then the following SQL exception is thrown:

2018-08-16 20:04:35,445+03 ERROR [org.ovirt.engine.core.bll.UpdateVmCommand] (default task-13) [3b53e055] Command 'org.ovirt.engine.core.bll.UpdateVmCommand' failed: CallableStatementCallback; SQL [{call updatevmstatic(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: new row for relation "vm_static" violates check constraint "vm_static_max_memory_size_lower_bound"
  Detail: Failing row contains (05298100-0e82-4546-9bdf-b6e93088099d, storage-ge3-vdsm2, 4224, 00000000-0000-0000-0000-000000000000, 0, , c8734ecb-5d81-4816-ac22-fb7e35cc3497, 2017-11-08 16:05:01.679+02, 1, t, f, 1, 1, 1, Etc/GMT, f, f, 2017-11-08 16:05:01.680274+02, 2018-08-16 20:04:35.132445+03, null, f, 0, 0, 13, 1, 1, , 3, null, null, null, 0, , , 8192, VM, 0, null, 6c4ffe7d-8fa6-4c37-87b7-bb322d24ff86, f, null, f, f, 16, f, f, f, 58b4738f-026e-00cf-02bd-00000000019b, null, , f, 0, null, null, null, guest_agent, 00000000-0000-0000-0000-000000000000, Blank, null, 1, null, null, null, f, interleave, t, t, c627b733-cb81-4486-b595-415826a16faa, null, null, null, null, f99a1b89-b75a-fea9-2540-5d8261907986, 817bd643-b969-ba9d-ef28-b15f0c24d001, null, 0, LOCK_SCREEN, 1, null, null, 4096, null, AUTO_RESUME).
  Where: SQL statement "UPDATE vm_static
     SET
     description = v_description,
     free_text_comment = v_free_text_comment ,
     mem_size_mb = v_mem_size_mb,
     max_memory_size_mb = v_max_memory_size_mb,
     num_of_io_threads = v_num_of_io_threads,
     os = v_os,
     cluster_id = v_cluster_id,
     vm_name = v_vm_name,
     vmt_guid = v_vmt_guid,
     creation_date = v_creation_date,
     num_of_monitors = v_num_of_monitors,
     single_qxl_pci = v_single_qxl_pci,
     allow_console_reconnect = v_allow_console_reconnect,
     is_initialized = v_is_initialized,
     num_of_sockets = v_num_of_sockets,
     cpu_per_socket = v_cpu_per_socket,
     threads_per_cpu = v_threads_per_cpu,




+ Internal engine error in webadmin


Expected results:
In case update VM is not allowed, the operation should fail nicely


Additional info:
logs attached, please contact me for accessing the environment

Comment 1 Michal Skrivanek 2018-08-16 18:44:33 UTC
this shouldn't get through backend validations

btw, Andrej, thoughts on this?:
2018-08-15 14:49:06,337+03 ERROR [org.ovirt.engine.core.bll.RunVmCommand] (EE-ManagedThreadFactory-engine-Thread-2408691) [3a91deb8-febb-4adb-98c7-67e364f2ba49] Exception: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
        at org.ovirt.engine.core.bll.RunVmCommandBase.delay(RunVmCommandBase.java:375) [bll.jar:]
        at org.ovirt.engine.core.bll.scheduling.policyunits.MemoryPolicyUnit.filter(MemoryPolicyUnit.java:123) [bll.jar:]
        at org.ovirt.engine.core.bll.scheduling.SchedulingManager.runInternalFilters(SchedulingManager.java:679) [bll.jar:]
        at org.ovirt.engine.core.bll.scheduling.SchedulingManager.runFilters(SchedulingManager.java:649) [bll.jar:]
        at org.ovirt.engine.core.bll.scheduling.SchedulingManager.schedule(SchedulingManager.java:334) [bll.jar:]
        at org.ovirt.engine.core.bll.RunVmCommand.getVdsToRunOn(RunVmCommand.java:858) [bll.jar:]
        at org.ovirt.engine.core.bll.RunVmCommand.runVm(RunVmCommand.java:260) [bll.jar:]
        at org.ovirt.engine.core.bll.RunVmCommand.perform(RunVmCommand.java:434) [bll.jar:]
        at org.ovirt.engine.core.bll.RunVmCommand.executeVmCommand(RunVmCommand.java:359) [bll.jar:]

Comment 2 Michal Skrivanek 2018-08-16 18:49:29 UTC
Elad, how did you create that VM? Is it from some template? from which time, approx?

Comment 3 Michal Skrivanek 2018-08-16 18:54:34 UTC
are you updating CPUs at the same time?

Comment 4 Andrej Krejcir 2018-08-17 07:50:30 UTC
The error with java.lang.ClassCastException is fixed in 4.2.6, Bug 1566112.
It is not related to this bug.

Comment 5 Elad 2018-08-17 08:33:31 UTC
Hi Michal, the VM was created a long time ago, at least few months, not from a template. 
For the bug to reproduce you don't have to update the CPUs.

Comment 6 Michal Skrivanek 2018-08-17 08:48:14 UTC
ok. thanks.
So how exactly do you reproduce that? With what numbers in that update? Is it API or GUI?

Comment 7 Elad 2018-08-17 08:54:53 UTC
Memory Size: 4096MB -> 8192MB
Maximum memory: 4096MB -> 64GB

Via the Webadmdin.
Michal, Sent you the environment details in the mail.

Comment 8 Michal Skrivanek 2018-08-17 09:09:37 UTC
thanks. makes sense. this VM is not hotpluggable because max is the same as current
We need to add proper validation to prevent that

Comment 9 Liran Rotenberg 2018-09-20 14:04:11 UTC
Verified on:
ovirt-engine-4.2.7-0.1.el7ev.noarch

Steps:
1. Create a VM.
2. Set a VM with memory:
Memory size: 4096 MB
Maximum memory: 4096 MB
3. Run the VM.
4. Set on the VM:
Memory size: 8192 MB
Maximum memory: 65536 MB(64GB)


Results:
Operation Canceled:
Cannot edit VM. Memory size (8196MB) cannot exceed maximum memory size (4096MB).

Comment 10 Sandro Bonazzola 2018-11-02 14:35:30 UTC
This bugzilla is included in oVirt 4.2.7 release, published on November 2nd 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.7 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.