Oved Ourfali has uploaded a new change for review.

Change subject: core: fix attaching a cluster to a new DC
......................................................................

core: fix attaching a cluster to a new DC

This patch fixes attaching a cluster to a new DC after its original DC
was removed.

In that case if the cluster has a host it will loss its dc id settings
and will try to insert to the vds_spm_map table empty GUID as the DC id.
Code was changed to check if the host DC id is empty and if so to take
this value from the cluster.

Change-Id: I195b333d8d8fafd0b21831961862d6dc2ca42ee9
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1148301
Signed-off-by: Eli Mesika <emes...@redhat.com>
(cherry picked from commit 8ad706349de1991d96cbfb1ac0157f30c2d16c5d)
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsSpmIdCommand.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/33662/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsSpmIdCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsSpmIdCommand.java
index 18afeab..83654dc 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsSpmIdCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsSpmIdCommand.java
@@ -78,7 +78,9 @@
                 break;
             }
         }
-        vds_spm_id_map newMap = new 
vds_spm_id_map(getVds().getStoragePoolId(), getVdsId(), selectedId);
+        // get the dc id from cluster if DC was removed and cluster is 
attached to a new DC
+        Guid dcId = (getVds().getStoragePoolId().equals(Guid.Empty) ? 
getVdsGroup().getStoragePoolId() : getVds().getStoragePoolId());
+        vds_spm_id_map newMap = new vds_spm_id_map(dcId, getVdsId(), 
selectedId);
         DbFacade.getInstance().getVdsSpmIdMapDao().save(newMap);
         if (getParameters().isCompensationEnabled()) {
             getCompensationContext().snapshotNewEntity(newMap);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I195b333d8d8fafd0b21831961862d6dc2ca42ee9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to