Bug 1313703

Summary: Unable to create a vm from template imported from Glance
Product: [oVirt] ovirt-engine Reporter: Nelly Credi <ncredi>
Component: BLL.StorageAssignee: Fred Rolland <frolland>
Status: CLOSED NOTABUG QA Contact: Aharon Canan <acanan>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.6.4CC: amarchuk, bugs, frolland, ncredi, nsoffer, ykaul
Target Milestone: ovirt-3.6.5Keywords: AutomationBlocker
Target Release: ---Flags: amureini: ovirt-3.6.z?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-03 14:58:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine logs
none
vdsm logs from all hosts
none
Good execution - engine logs
none
good execution - hosts log none

Description Nelly Credi 2016-03-02 09:14:24 UTC
Description of problem:
create vm from template imported from Glance fails with the below error (in actual results)

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. add dc
2. add cluster
3. add hosts
4. add sds
5. import image from glance as template
6. get status ok on imported disk
6. copy the template to all sds
7. create a vm from this template


Actual results:
Status: 409
00:24:31.398 	Reason: Conflict
00:24:31.398 	Detail: [Cannot add VM. Disk golden_mixed_virtio_template is being moved or copied.]

Expected results:
we should be able to create a vm from this tempalte

Additional info:
will attach the logs from the last execution soon

Comment 1 Anton Marchukov 2016-03-02 09:21:50 UTC
Created attachment 1132196 [details]
engine logs

Comment 2 Anton Marchukov 2016-03-02 09:22:35 UTC
Created attachment 1132197 [details]
vdsm logs from all hosts

Comment 3 Anton Marchukov 2016-03-02 09:34:51 UTC
This issue exists in the following commits of engine and vdsm:

Engine: ded51e3bcac65f194ef2c80818677891fa12d30c ovirt-engine-3.6 branch
core: Unit tests for VmDevicesMonitoring

VDSM: c2b9e0075880a175ba2b7a3c58d15a00831c73be ovirt-3.6.3 branch
oVirt 3.6.3 refresh (storage fix)
Essential we use latest vdsm-4.17.23-0.el7ev.noarch.rpm from brew

I will try to track previous versions to find when the problem started to appear and update. However it may be not easy as previously it was not consistently reproducible.

Comment 4 Allon Mureinik 2016-03-02 11:23:40 UTC
Fred, as this week's qa contact can you take a look please?

Comment 5 Nir Soffer 2016-03-03 00:22:01 UTC
(In reply to Nelly Credi from comment #0)
> Actual results:
> Status: 409
> 00:24:31.398 	Reason: Conflict
> 00:24:31.398 	Detail: [Cannot add VM. Disk golden_mixed_virtio_template is
> being moved or copied.]

It looks like you try to create a vm before copying the template finished.

How do you verify that the copy operation finished before trying to create a vm?

Comment 6 Nelly Credi 2016-03-03 08:22:54 UTC
Hi Nir,

copying the template is a sync action, so we just wait for it to finish

Please also keep in mind that this is working well in 3.6.3

Comment 7 Nir Soffer 2016-03-03 08:36:52 UTC
(In reply to Nelly Credi from comment #6)
> copying the template is a sync action, so we just wait for it to finish

Can you explain how do you perform the copy template? Python SDK? REST API?

> Please also keep in mind that this is working well in 3.6.3

Can you provide engine and vdsm logs from "good" 3.6.3 run?

Comment 8 Nelly Credi 2016-03-03 08:48:03 UTC
Created attachment 1132688 [details]
Good execution - engine logs

We are using REST

Comment 9 Nelly Credi 2016-03-03 08:48:43 UTC
Created attachment 1132689 [details]
good execution - hosts log

Comment 10 Fred Rolland 2016-03-03 14:58:23 UTC
By looking at the REST log in [1], I can see that the disk is in "locked" state right before the VM creation.

2016-03-02 20:31:51,821  ---> get on the template, disk is locked
2016-03-02 20:31:52,018  ---> create VM with failure

So it could be some timing/logic issue in the test.
The disk status should be checked to be OK before creating the VM

[1]
https://rhev-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/GE%20builder%20and%20cleaner/job/GE-builder/1772/artifact/logs/art_tests_20160302_201559.log/*view*/