Omer Frenkel has uploaded a new change for review. Change subject: core: copy vm-init data on new template version ......................................................................
core: copy vm-init data on new template version when creating new template version, the vm-init data is not copied, because the vmInit is not marked for copy. since the vm-init is saved in a different table, it need to be manually loaded. also, the is_initialized flag need to be reset so vms will do sysprep again with new data. Change-Id: Icaf1b6cad241008c8e6f392cb918e900b340d9b2 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1148379 Signed-off-by: Omer Frenkel <ofren...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmVersionCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java 2 files changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/34321/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmVersionCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmVersionCommand.java index 10724b8..a381992 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmVersionCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmVersionCommand.java @@ -110,6 +110,8 @@ @Override protected void executeVmCommand() { + // load vm init from db + VmHandler.updateVmInitFromDB(getVmTemplate(), false); if (!copyData(getVmTemplate(), getVm().getStaticData())) { return; } @@ -202,11 +204,14 @@ } addVmParams.setDiskOperatorAuthzPrincipalDbId(getParameters().getPreviousDiskOperatorAuthzPrincipalDbId()); + // reset vm to not initialized + addVmParams.getVmStaticData().setInitialized(false); + runInternalAction(action, addVmParams, ExecutionHandler.createDefaultContextForTasks(getContext(), getLock())); } - private void loadVmPayload(AddVmParameters addVmParams) { + private void loadVmPayload(VmManagementParametersBase addVmParams) { List<VmDevice> vmDevices = getVmDeviceDao() .getVmDeviceByVmIdAndType(getVmTemplateId(), VmDeviceGeneralType.DISK); diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java index cc7710d..ecdf995 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java @@ -303,6 +303,7 @@ private Guid createdByUserId; @EditableField + @CopyOnNewVersion private VmInit vmInit; @CopyOnNewVersion -- To view, visit http://gerrit.ovirt.org/34321 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icaf1b6cad241008c8e6f392cb918e900b340d9b2 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Omer Frenkel <ofren...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches