Description of problem: Cannot create with wrong memory size. Log says that Vms name already in use and its wrong. There is no such VM on the system. Log should be fixed as well. 2013-10-28T16:14:04.723000Z 2013-10-28 18:14:04,027 WARN [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (ajp-/127.0.0.1:8702-5) [1b825962] CanDoAction of action AddVmFromScratch failed. Reasons:VAR__ACTION__ADD,VAR__TYPE__VM,ACTION_TYPE_FAILED_NAME_ALREADY_USED 2013-10-28T16:14:04.723000Z , sharedLocks= ] 2013-10-28T16:14:04.723000Z 2013-10-28 18:14:04,021 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (ajp-/127.0.0.1:8702-5) [1b825962] Lock Acquired to object EngineLock [exclusiveLocks= key: restvm0 value: VM_NAME 2013-10-28T16:14:04.724000Z 2013-10-28 18:14:04,714 WARN [org.ovirt.engine.core.bll.VmHandler] (ajp-/127.0.0.1:8702-4) [21b358c] RAM value 0mb for novm is exceeding the recommended values 256mb - 64,000mb for Other OS 2013-10-28T16:14:04.724000Z 2013-10-28 18:14:04,713 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (ajp-/127.0.0.1:8702-4) [21b358c] Running command: AddVmFromScratchCommand internal: false. Entities affected : ID: 1ba17f3a-45a2-4538-b12c-f183296e6264 Type: VdsGroups 2013-10-28T16:14:04.724000Z 2013-10-28 18:14:04,701 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (ajp-/127.0.0.1:8702-4) [21b358c] Lock Acquired to object EngineLock [exclusiveLocks= key: novm value: VM_NAME 2013-10-28T16:14:04.724000Z , sharedLocks= ] 2013-10-28T16:14:04.724000Z 2013-10-28 18:14:04,031 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-5) Operation Failed: [Cannot add VM. The VM name is already in use, please choose a unique name and try again.] 2013-10-28T16:14:04.724000Z , sharedLocks= ] 2013-10-28T16:14:04.724000Z 2013-10-28 18:14:04,027 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (ajp-/127.0.0.1:8702-5) [1b825962] Lock freed to object EngineLock [exclusiveLocks= key: restvm0 value: VM_NAME Version-Release number of selected component (if applicable): 08ba337398994a7a90c7b4287e74f2249c04bc5d How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Created attachment 817052 [details] logs
unable to reproduce. Has used the following VM with SERT API POST on the vms collections (api/vms) <vm> <name>vm2</name> <type>server</type> <status> <state>down</state> </status> <memory>68157440000</memory> <cpu> <topology sockets="1" cores="1"/> </cpu> <cpu_shares>0</cpu_shares> <os type="other"> <boot dev="hd"/> </os> <high_availability> <enabled>false</enabled> <priority>1</priority> </high_availability> <display> <type>spice</type> <monitors>1</monitors> <single_qxl_pci>false</single_qxl_pci> <allow_override>true</allow_override> <smartcard_enabled>false</smartcard_enabled> </display> <cluster href= "/api/clusters/369cf110-b792-42ba-ba3f-393f2b51d87b" id="369cf110-b792-42ba-ba3f-393f2b51d87b"/> <template href= "/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/> <origin>ovirt</origin> <stateless>false</stateless> <delete_protected>false</delete_protected> <placement_policy> <affinity>migratable</affinity> </placement_policy> <memory_policy> <guaranteed>1073741824</guaranteed> <ballooning>true</ballooning> </memory_policy> <usb> <enabled>false</enabled> </usb> </vm> Result: VM was created event tough when you try to do it from UI you will get an error that memory can not exceeda 64000 MB In this case I had defined a VM with 65000MB (68157440000 Bytes) and got no error. (A BZ for that shoulg be opened separately IMHO) Please add a simple REST API code that reproduces the reported problem.
Hello Eli, I provided a link to the test case in Comment #1 with all info. Note: You should create a VM with the following parameters: 2013-10-29 12:04:41,913 - MainThread - plmanagement.matrix-test-composer - INFO - Running command: addVm(False, name='novm', memory=214748, cluster='RestCluster1') - Kiril
Still unable to reproduce the bug please provide the AddVm REST API call that caused the problem The 'novm' VM in the test appears twice in the test , once with positive memory size and once with a zero memory size , both was created successfully ... Setting info on Elena as Kiril recomended ...
Adding Elena's email, explaining the problem: "If you are looking for REST request, see it below (can be found also at Jenkins log if you search for 'CREATE'). Afaiu, the test tries to create vm with wrong memory size and instead of error it gets success (with 0 memory in response). Hope it's helpful." 2013-10-29 12:04:42,364 - MainThread - vms - DEBUG - CREATE request content is -- url:https://jenkins-automation-rpm-vm47.eng.lab.tlv.redhat.com/api/vms body:<vm> <name>novm</name> <memory>214748</memory> <cluster href="/api/clusters/b954f172-f87c-4b4f-9b00-a277c9e43d7d" id="b954f172-f87c-4b4f-9b00-a277c9e43d7d"> <name>RestCluster1</name> <link href="/api/clusters/b954f172-f87c-4b4f-9b00-a277c9e43d7d/networks" rel="networks"/> <link href="/api/clusters/b954f172-f87c-4b4f-9b00-a277c9e43d7d/permissions" rel="permissions"/> <link href="/api/clusters/b954f172-f87c-4b4f-9b00-a277c9e43d7d/glustervolumes" rel="glustervolumes"/> <link href="/api/clusters/b954f172-f87c-4b4f-9b00-a277c9e43d7d/glusterhooks" rel="glusterhooks"/> <cpu id="Intel Conroe Family"/> <data_center href="/api/datacenters/177073fb-92ea-43d1-a8eb-5a63e58f3ecf" id="177073fb-92ea-43d1-a8eb-5a63e58f3ecf"/> <memory_policy> <overcommit percent="200"/> <transparent_hugepages> <enabled>true</enabled> </transparent_hugepages> </memory_policy> <scheduling_policy> <policy>none</policy> </scheduling_policy> <version major="3" minor="3"/> <error_handling> <on_error>migrate</on_error> </error_handling> <virt_service>true</virt_service> <gluster_service>false</gluster_service> <threads_as_cores>false</threads_as_cores> <tunnel_migration>false</tunnel_migration> <trusted_service>false</trusted_service> <ballooning_enabled>false</ballooning_enabled> </cluster> <template id="00000000-0000-0000-0000-000000000000"/> </vm> 2013-10-29 12:04:43,205 - MainThread - vms - ERROR - Response code is not valid, expected is: [400, 409, 500, 404], actual is: 201
Michal, The bug is that a VM creation with wrong memory succeed, though it should fail. It fails our regression VMs test. Can you please move this bug to target release 3.3? Otherwise it will continue to fail, till 3.4.
Change causing that was done by Roy G in http://gerrit.ovirt.org/#/c/20178/ while resolving https://bugzilla.redhat.com/show_bug.cgi?id=1014952 This actually moved the memory check from the canDoAction to the execute method and generates only a warning for invalid memory Assigning to Roy
all values are permitted now. I have disagreed with that before. anyhow the VM was create with 28k which is effectively 0Mb in the DB.
the test should be refactored according the change in bug 1014952 - you *can* create a VM with any positive value of mem and you'll get an event back instead of a cando if the value is below the min memory for that OS