Bug 806640

Summary: exception when cloning vm from a snapshot which contains illegal drive
Product: [Retired] oVirt Reporter: Avihai Shoham <ashoham>
Component: ovirt-engine-coreAssignee: Yair Zaslavsky <yzaslavs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, ashoham, dyasny, iheim, lpeer, mgoldboi, oourfali, ykaul, yzaslavs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-17 07:49:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
engine log none

Description Avihai Shoham 2012-03-25 16:37:00 UTC
when cloning vm (server type) via UI i gets "ovirt internal error'
looking in engine log there is  SQLErrorCodeSQLExceptionTranslator

http://pastebin.test.redhat.com/82844

observed by Yzaslavs

Comment 1 Avihai Shoham 2012-03-25 16:39:56 UTC
Created attachment 572545 [details]
engine log

Comment 2 Yair Zaslavsky 2012-03-25 17:48:08 UTC
This happens when the image in the configuration is illegal.
For illegal image a new disk is created.
The fix performs the following:
a. Checks that indeed illegal image was created as the disk of the image was removed after the snapshot.
b. In this case - adds the disk without vm device 
c. Vm device will be added later on during vm device copying from the vm configuration (before the fix, this was the reason for the attempt to insert the same vm device twice)

http://gerrit.ovirt.org/#change,3085

Comment 3 Yair Zaslavsky 2012-03-26 07:14:04 UTC
merged - commit hash c882ad75c82e6735960d7088d78f017039c43c00

Comment 4 Avihai Shoham 2012-03-26 11:48:24 UTC
now the cloning succeed but since the snapshot has "illegal" status ,the cloning VM created with one disk only

vm_device table is missing info of one disk



engine=# SELECT vm_guid  from vm_static  where vm_name = 'clone4';
               vm_guid                
--------------------------------------
 b2c70cca-7b8f-420e-82b0-be585986e335
(1 row)

engine=# 
engine=# SELECT * from vm_device where vm_id = 'b2c70cca-7b8f-420e-82b0-be585986e335';
              device_id               |                vm_id                 | type | device | address | boot_order |                  spec_params                  | is_managed | is_plugged | is_readonly 
--------------------------------------+--------------------------------------+------+--------+---------+------------+-----------------------------------------------+------------+------------+-------------
 fc8de9b4-493f-42ff-bccf-320068d82a81 | b2c70cca-7b8f-420e-82b0-be585986e335 | disk | disk   |         |          1 | deviceId=fc8de9b4-493f-42ff-bccf-320068d82a81 | t          | t          | f
(1 row)

Comment 5 Yair Zaslavsky 2012-03-26 14:15:13 UTC
Fixed at commit hash e47cbdced478dce1d331c5a7778fd4d1da3a084a

Comment 6 Avihai Shoham 2012-05-06 07:10:45 UTC
fixed
verified on last dev hash commit b27eef27132cd152d58b6503324a9248374864ab