Tomas Jelinek has uploaded a new change for review.

Change subject: core: on clone vm the thin provisioned become clone provisioned
......................................................................

core: on clone vm the thin provisioned become clone provisioned

Having a VM created from a template as thin (dependent), after cloning the VM
the new VM become clone (independent).

The problem was that the parent of the CloneVmCommand
(AddVmAndCloneImageCommand) did reset the vmtGuid of the newly created VM thus
forgetting the information about the template we are depending on.

Fixed by turning this off since the information about the template is correct
on the VM we are cloning so no need to do any resets like this.

Change-Id: Ib9634450b1b3ddf3534a6b26d535ff071de2c97a
Bug-Url: https://bugzilla.redhat.com/1128150
Signed-off-by: Tomas Jelinek <tjeli...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CloneVmCommand.java
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/12/32112/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java
index ae9e442..cb712d4 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java
@@ -335,10 +335,14 @@
     protected void executeVmCommand() {
         super.executeVmCommand();
         setVm(null);
-        getVm().setVmtGuid(VmTemplateHandler.BLANK_VM_TEMPLATE_ID);
+        resetVmtGuid();
         getVmStaticDao().update(getVm().getStaticData());
     }
 
+    protected void resetVmtGuid() {
+        getVm().setVmtGuid(VmTemplateHandler.BLANK_VM_TEMPLATE_ID);
+    }
+
     @Override
     protected boolean checkTemplateImages(List<String> reasons) {
         return true;
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CloneVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CloneVmCommand.java
index e269b3a..d90d708 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CloneVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CloneVmCommand.java
@@ -254,4 +254,9 @@
         vmStatic.setOriginalTemplateGuid(getVm().getOriginalTemplateGuid());
         vmStatic.setOriginalTemplateName(getVm().getOriginalTemplateName());
     }
+
+    @Override
+    protected void resetVmtGuid() {
+        // no need to reset it - the guid is already properly set from the 
original VM
+    }
 }


-- 
To view, visit http://gerrit.ovirt.org/32112
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9634450b1b3ddf3534a6b26d535ff071de2c97a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjeli...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to