From aa2c285ca810bcfb7efc791dcfed48768be034bf Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Thu, 15 Dec 2022 20:12:30 +0200 Subject: [PATCH] fix #779: propagate backup mode to template disks Previously, all template disks were created with backup mode = NONE regardless of the backup mode of the disks of the VM that the template is created from. Now the backup mode would propagate from the VM disks to the template disks when their format is qcow2. If the template disks are created as raw their backup mode would be NONE. Enabing to create template disks with incremental backup enabled from VM disks that are raw is outside of the scope of this change. Signed-off-by: Arik Hadas --- .../bll/storage/disk/image/CreateImageTemplateCommand.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/CreateImageTemplateCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/CreateImageTemplateCommand.java index afa88b3426e..374a91ceaeb 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/CreateImageTemplateCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/CreateImageTemplateCommand.java @@ -107,6 +107,9 @@ protected void executeCommand() { getParameters().getStorageDomainId(), getParameters().getDestinationStorageDomainId())); + if (targetFormat == VolumeFormat.COW) { + newImage.setBackup(getDiskImage().getBackup()); + } newImage.setId(destinationImageGroupID); newImage.setDiskDescription(getParameters().getDescription() != null ? getParameters().getDescription() : getDiskImage().getDiskDescription());