Gilad Chaplik has uploaded a new change for review.

Change subject: core: set Disk Profile for cloned VM from snapshot
......................................................................

core: set Disk Profile for cloned VM from snapshot

Disk Profile was missing in disk image mapping to
storage_doamin_image_map.

Also added missing error translation.

Change-Id: Iab5f79e853a1482ccabf6c287d663da87ab332fe
Bug-Url: https://bugzilla.redhat.com/1161939
Signed-off-by: Gilad Chaplik <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
4 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/35205/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 c9fd579..b8c37a6 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
@@ -72,12 +72,14 @@
             DiskImage diskImage,
             Guid srcStorageDomainId,
             Guid destStorageDomainId,
+            Guid diskProfileId,
             VdcActionType parentCommandType) {
         DiskImage newDiskImage = cloneDiskImage(getVmId(),
                 destStorageDomainId,
                 Guid.newGuid(),
                 Guid.newGuid(),
-                diskImage);
+                diskImage,
+                diskProfileId);
         ImagesHandler.setDiskAlias(newDiskImage, getVm());
         MoveOrCopyImageGroupParameters parameters = 
createCopyParameters(newDiskImage,
                 srcStorageDomainId,
@@ -182,7 +184,8 @@
                                        Guid storageDomainId,
                                        Guid newImageGroupId,
                                        Guid newImageGuid,
-                                       DiskImage srcDiskImage) {
+                                       DiskImage srcDiskImage,
+                                       Guid diskProfileId) {
 
         DiskImage clonedDiskImage = DiskImage.copyOf(srcDiskImage);
         clonedDiskImage.setImageId(newImageGuid);
@@ -196,6 +199,7 @@
         ArrayList<Guid> storageIds = new ArrayList<Guid>();
         storageIds.add(storageDomainId);
         clonedDiskImage.setStorageIds(storageIds);
+        clonedDiskImage.setDiskProfileId(diskProfileId);
 
         // If volume information was changed at client , use its volume 
information.
         // If volume information was not changed at client - use the volume 
information of the ancestral image
@@ -415,6 +419,7 @@
                         copyDiskImage(diskImage,
                                 diskImage.getStorageIds().get(0),
                                 
diskInfoDestinationMap.get(diskImage.getId()).getStorageIds().get(0),
+                                
diskInfoDestinationMap.get(diskImage.getId()).getDiskProfileId(),
                                 getActionType());
                         numberOfStartedCopyTasks++;
                     }
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
index d14e990..1d4c982 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -1165,6 +1165,7 @@
 ACTION_TYPE_FAILED_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. Profile name 
is in use.
 ACTION_TYPE_FAILED_CANNOT_CHANGE_PROFILE=Cannot ${action} ${type}. Cannot 
change profile.
 ACTION_TYPE_FAILED_PROFILE_IN_USE=Cannot ${action} ${type}. Profile is in use.
+ACTION_TYPE_DISK_PROFILE_EMPTY=Cannot ${action} ${type}. Disk Profile is empty.
 ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND=Cannot ${action} ${type}. Disk 
Profile wasn't found.
 ACTION_TYPE_DISK_PROFILE_STORAGE_DOMAIN_NOT_PROVIDED=Cannot ${action} ${type}. 
Storage Domain wasn't provided.
 ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. 
Disk Profile doesn't match provided Storage Domain.
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
index 37cde6e..6befa96 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
@@ -3143,6 +3143,9 @@
     @DefaultStringValue("Cannot ${action} ${type}. Profile is in use.")
     String ACTION_TYPE_FAILED_PROFILE_IN_USE();
 
+    @DefaultStringValue("Cannot ${action} ${type}. Disk Profile is empty.")
+    String ACTION_TYPE_DISK_PROFILE_EMPTY();
+
     @DefaultStringValue("Cannot ${action} ${type}. Disk Profile wasn't found.")
     String ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index f0071b6..7155b4f 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -1134,6 +1134,7 @@
 ACTION_TYPE_FAILED_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. Profile name 
is in use.
 ACTION_TYPE_FAILED_CANNOT_CHANGE_PROFILE=Cannot ${action} ${type}. Cannot 
change profile.
 ACTION_TYPE_FAILED_PROFILE_IN_USE=Cannot ${action} ${type}. Profile is in use.
+ACTION_TYPE_DISK_PROFILE_EMPTY=Cannot ${action} ${type}. Disk Profile is empty.
 ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND=Cannot ${action} ${type}. Disk 
Profile wasn't found.
 ACTION_TYPE_DISK_PROFILE_STORAGE_DOMAIN_NOT_PROVIDED=Cannot ${action} ${type}. 
Storage Domain wasn't provided.
 ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. 
Disk Profile doesn't match provided Storage Domain.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab5f79e853a1482ccabf6c287d663da87ab332fe
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to