Bug 1022942 - Creating VM from Foreman fails with oVirt 3.3.1 beta.
Creating VM from Foreman fails with oVirt 3.3.1 beta.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.3.0
Unspecified Unspecified
urgent Severity urgent
: ---
: 3.3.0
Assigned To: Gilad Chaplik
Lukas Svaty
sla
: Triaged
Depends On: 1021393
Blocks: 1019391 3.3snap2
  Show dependency treegraph
 
Reported: 2013-10-24 06:11 EDT by Gilad Chaplik
Modified: 2016-02-10 15:18 EST (History)
11 users (show)

See Also:
Fixed In Version: is22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1021393
Environment:
Last Closed: 2014-01-21 17:12:57 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 20466 None None None Never
oVirt gerrit 20499 None None None Never

  None (edit)
Description Gilad Chaplik 2013-10-24 06:11:05 EDT
+++ This bug was initially created as a clone of Bug #1021393 +++

Description of problem:
This is fresh install of 3.3.1 beta engine running on CentOS 6.4. Trying to create VM from Foreman 1.2/1.3 fails and shows following error message in engine.log "ERROR: insert or update on table "images" violates foreign key constraint "fk_images_quota". Full log attached.


Version-Release number of selected component (if applicable):
oVirt 3.3.1-0.1.beta.el6


Steps to Reproduce:
1. Create new VM from Foreman

Actual results:
Creating of VM fails and Foreman displays error: 
Unable to save
Failed to create a compute dev-el6 (oVirt) instance gg6.domain.tld

Expected results:
VM is created successfully into oVirt.

--- Additional comment from Samuli Heinonen on 2013-10-21 04:45:42 EDT ---



--- Additional comment from Eli Mesika on 2013-10-22 03:20:54 EDT ---

The following upgrade script 
03_03_0900_quota_id_foreign_key.sql added this FK constraint :

ALTER TABLE images ADD CONSTRAINT fk_images_quota FOREIGN KEY (quota_id) REFERENCES quota(id) ON DELETE SET NULL;

So, it seems that there is an attempt to create a VM with an invalid QUOTA ID

--- Additional comment from Samuli Heinonen on 2013-10-22 04:04:46 EDT ---

Some additional information about my setup if needed:
Quota is disabled on this datacenter and Foreman is using admin@internal to 
connect oVirt.

I tried enabling quota and problem still exists. Also it seems that it's not possible to set quota for admin.

--- Additional comment from Gilad Chaplik on 2013-10-23 03:33:11 EDT ---

Can you see if you have quota definition in foreman compute resource definition?

--- Additional comment from Samuli Heinonen on 2013-10-23 03:55:04 EDT ---

(In reply to Gilad Chaplik from comment #4)
> Can you see if you have quota definition in foreman compute resource
> definition?

It shows Quota ID field but there are no variables. Quota is currently disabled in datacenter.

I just tried enabling quota in datacenter and made quota definition for it. It shows in compute resource definition and selecting it it's possible to create VM's from foreman.

So this seems to be problem only if quota is disabled and there is no quota defined in oVirt.

--- Additional comment from Gilad Chaplik on 2013-10-23 08:03:34 EDT ---

The problem is that foreman is sending empty string for disk's quota (not for vm btw), then the engine subs empty string with empty UUID (000...). prior to the fix mentioned in comment 2, it was possible to save empty UUID as quota id.

--- Additional comment from Itamar Heim on 2013-10-23 14:13:40 EDT ---

do we treat this as a regression to backward compatibility, or a change due to a bug which must be fixed and foreman needs to be changed?

--- Additional comment from Gilad Chaplik on 2013-10-24 03:19:08 EDT ---

(In reply to Itamar Heim from comment #7)
> do we treat this as a regression to backward compatibility, or a change due
> to a bug which must be fixed and foreman needs to be changed?

I don't think it's a backward compatibility issue, since foreman didn't send a empty UUID, just an empty string and the REST treat it as empty UUID.
Since quota is not supported in the REST, I guess we can simply ignore empty UUID
in the engine, and fix it in foreman ovirt component (sent patches for both).

Samuli (the bug reporter) verified that the problem is solved (by fixing rbovirt).
Comment 2 Lukas Svaty 2013-11-28 09:32:18 EST
tested in is25
Comment 3 Itamar Heim 2014-01-21 17:12:57 EST
Closing - RHEV 3.3 Released
Comment 4 Itamar Heim 2014-01-21 17:21:00 EST
Closing - RHEV 3.3 Released

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