Bug 1202129

Summary: VM Pool is created with 0 VMs if error occured when creating VM
Product: [Retired] oVirt Reporter: Shmuel Melamud <smelamud>
Component: ovirt-engine-apiAssignee: Shmuel Melamud <smelamud>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: medium Docs Contact:
Priority: high    
Version: 3.6CC: bugs, ecohen, gklein, istein, lsurette, michal.skrivanek, rbalakri, yeylon
Target Milestone: ---   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: ovirt-engine-3.6.0-0.0.master.20150412172306.git55ba764 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-04 11:44:10 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:

Description Shmuel Melamud 2015-03-15 18:40:36 UTC
Description of problem:

If VM Pool is created via REST API and one of VM parameters is incorrect, the VM Pool is created without any VMs. In the same time, the operation fails and user gets an error message describing error that occurred while creating the VM. 

How reproducible:
100%

Steps to Reproduce:
1. Create a VM Template.
2. Create VM Pool with incorrect VM parameters. For example, make POST request to api/vmpools/ with the following body:

<vmpool>
 <name>PoolTest</name>
 <description/>
 <size>1</size>
 <cluster id="---cluster_id---"/>
 <template id="---template_id---"/>
 <vm>
  <type>server</type>
  <memory>512000000</memory>
  <memory_policy>
   <guaranteed>700000000</guaranteed>
  </memory_policy>
 </vm>
 <prestarted_vms>0</prestarted_vms>
 <max_user_vms>1</max_user_vms>
</vmpool>

Actual results:
1. Operation returns error:
<fault>
 <reason>Operation Failed</reason>
 <detail>
  [Cannot create VM-Pool. Physical Memory Guaranteed cannot exceed Memory Size.]
 </detail>
</fault>
2. VM Pool 'PoolTest' is created without any VMs.

Expected results:
1. Operation returns error:
<fault>
 <reason>Operation Failed</reason>
 <detail>
  [Cannot create VM-Pool. Physical Memory Guaranteed cannot exceed Memory Size.]
 </detail>
</fault>
2. VM Pool is not created.

Additional info:

The bug became especially visible after adding majority of VM properties to VmPools collection as result of fixing Bug 1195167.

Comment 1 sefi litmanovich 2015-07-13 15:29:49 UTC
Verified with ovirt-engine-3.6.0-0.0.master.20150627185750.git6f063c1.el6.noarch
According to the description.

Could not create the vmPool as expected.

Comment 2 Sandro Bonazzola 2015-11-04 11:44:10 UTC
oVirt 3.6.0 has been released on November 4th, 2015 and should fix this issue.
If problems still persist, please open a new BZ and reference this one.