Bug 1374231

Summary: Unable to run VM with faked vdsm
Product: [oVirt] vdsm-jsonrpc-java Reporter: Eli Mesika <emesika>
Component: CoreAssignee: Ravi Nori <rnori>
Status: CLOSED DEFERRED QA Contact: Jiri Belka <jbelka>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2.5CC: bugs, emesika, lsvaty, mgoldboi, mperina, oourfali
Target Milestone: ---Flags: rule-engine: planning_ack?
rule-engine: devel_ack?
lsvaty: testing_ack+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-05 19:20:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Engine Log none

Description Eli Mesika 2016-09-08 09:54:31 UTC
Description of problem:
When creating a VM with a bootable disk and a nic using faked-vdsm and trying to run it engine fails with an exception 
The reason is that a non-provisioned UUID which not exists in the database is returned by VDSM to the engine and that leads to NPE 


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


How reproducible:


Steps to Reproduce:
1.setup and run faked-vdsm 
2.Create DC + Cluster + Host + Storage 
3.Create a VM with bootable disk and one Nic
4.Run the VM 

Actual results:


Expected results:


Additional info:

See engine.log 

Exception is in 2016-09-06 17:06:41,455
The real VM UUID in DB is 6bc4e2bf-a8c8-4a74-b73d-55141e0f1f10 , the one passed to VdsManager is 89a9e0ca-21aa-4e8d-9271-1e2d972d39b5

Comment 1 Eli Mesika 2016-09-08 09:55:46 UTC
Created attachment 1198973 [details]
Engine Log

Comment 2 Oved Ourfali 2016-09-13 12:13:09 UTC
Eli - were you able to fix that?
I heard the env is running properly.
Anyway, putting on Ravi if a jsonrpc patch is required.

Comment 3 Eli Mesika 2016-09-15 13:43:04 UTC
Yes , Juan provides a workaround for that :

workaround:

diff --git a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainsResource.java b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainsResource.java
index 1df62b9..90f4d5a 100644
--- a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainsResource.java
+++ b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainsResource.java
@@ -90,7 +90,7 @@ public class BackendStorageDomainsResource
                             entity.getStorageType(),
                             entity.getStorageDomainType(),
                             connection);
-            if (existing != null) {
+            if (existing != null  && !Guid.isNullOrEmpty(existing.getId()))

Comment 4 Oved Ourfali 2016-10-10 05:13:10 UTC
Is it something to push to gerrit?

Comment 5 Eli Mesika 2016-10-10 09:25:55 UTC
(In reply to Oved Ourfali from comment #4)
> Is it something to push to gerrit?

There is an open thread on that if the fix should be on the API side or (more likely) on the faked-vdsm side.

Martin, can we have a discussion/decision on that?

Comment 6 Martin Perina 2016-10-25 13:30:44 UTC
Personally I'd rather fix fakevdsm to behave the same way as VDSM (if possible).