Shubhendu Tripathi has uploaded a new change for review.

Change subject: gluster: Gluster volume snapshot actions with georep case
......................................................................

gluster: Gluster volume snapshot actions with georep case

Enhanced the code to execute gluster volume snapshot actions
if geo replication is setup for the volume.

Change-Id: I0eccbcd4aa3e218ba0d910bd9150bdb0baa2db68
Signed-off-by: Shubhendu Tripathi <shtri...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunnersFactory.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ActivateGlusterVolumeSnapshotCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeactivateGlusterVolumeSnapshotCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteAllGlusterVolumeSnapshotsCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeSnapshotCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GeoRepSessionCommandBase.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeSnapshotCommandBase.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RestoreGlusterVolumeSnapshotCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeGeoRepCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGeoRepSessionCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
M backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/jsonrpc/JsonRpcVdsServer.java
M 
frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
20 files changed, 452 insertions(+), 77 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/73/39873/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunnersFactory.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunnersFactory.java
index 6704b20..2adf60e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunnersFactory.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunnersFactory.java
@@ -51,7 +51,8 @@
         case AddVds: // AddVds is called with multiple actions *only* in case 
of gluster clusters
         case RemoveGlusterServer:
         case EnableGlusterHook:
-        case DisableGlusterHook: {
+        case DisableGlusterHook:
+        case DeleteGlusterVolumeSnapshot: {
             runner = new GlusterMultipleActionsRunner(actionType, parameters, 
commandContext, isInternal);
             break;
         }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ActivateGlusterVolumeSnapshotCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ActivateGlusterVolumeSnapshotCommand.java
index 0ac3217..8f337a1 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ActivateGlusterVolumeSnapshotCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ActivateGlusterVolumeSnapshotCommand.java
@@ -1,5 +1,6 @@
 package org.ovirt.engine.core.bll.gluster;
 
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.common.AuditLogType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeSnapshotActionParameters;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus;
@@ -8,6 +9,7 @@
 import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
 import 
org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActivateSnapshotVDSParameters;
 
+@NonTransactiveCommandAttribute
 public class ActivateGlusterVolumeSnapshotCommand extends 
GlusterVolumeSnapshotCommandBase<GlusterVolumeSnapshotActionParameters> {
     public 
ActivateGlusterVolumeSnapshotCommand(GlusterVolumeSnapshotActionParameters 
params) {
         super(params);
@@ -42,7 +44,7 @@
         }
 
         if (getSnapshot().getStatus() == GlusterSnapshotStatus.ACTIVATED) {
-            
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_ACTIVATED,
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_ACTIVATED,
                     getSnapshot().getSnapshotName());
         }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeactivateGlusterVolumeSnapshotCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeactivateGlusterVolumeSnapshotCommand.java
index eee667b..8d7486a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeactivateGlusterVolumeSnapshotCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeactivateGlusterVolumeSnapshotCommand.java
@@ -1,5 +1,6 @@
 package org.ovirt.engine.core.bll.gluster;
 
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.common.AuditLogType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeSnapshotActionParameters;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus;
@@ -8,6 +9,7 @@
 import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
 import 
org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotActionVDSParameters;
 
+@NonTransactiveCommandAttribute
 public class DeactivateGlusterVolumeSnapshotCommand extends 
GlusterVolumeSnapshotCommandBase<GlusterVolumeSnapshotActionParameters> {
     public 
DeactivateGlusterVolumeSnapshotCommand(GlusterVolumeSnapshotActionParameters 
params) {
         super(params);
@@ -41,7 +43,7 @@
         }
 
         if (getSnapshot().getStatus() == GlusterSnapshotStatus.DEACTIVATED) {
-            
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_DEACTIVATED,
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_DEACTIVATED,
                     getSnapshot().getSnapshotName());
         }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteAllGlusterVolumeSnapshotsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteAllGlusterVolumeSnapshotsCommand.java
index b7bf086..9c8180b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteAllGlusterVolumeSnapshotsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteAllGlusterVolumeSnapshotsCommand.java
@@ -3,21 +3,32 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters;
+import org.ovirt.engine.core.common.businessentities.VDS;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity;
+import org.ovirt.engine.core.common.errors.VdcBllErrors;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.common.locks.LockingGroup;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
 import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
 import 
org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters;
 import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.utils.lock.EngineLock;
 
+@NonTransactiveCommandAttribute
 public class DeleteAllGlusterVolumeSnapshotsCommand extends 
GlusterSnapshotCommandBase<GlusterVolumeParameters> {
-    List<GlusterVolumeSnapshotEntity> snapshots;
+    private List<GlusterVolumeSnapshotEntity> snapshots;
+    private List<GlusterGeoRepSession> georepSessions;
 
     public DeleteAllGlusterVolumeSnapshotsCommand(GlusterVolumeParameters 
params) {
         super(params);
         snapshots = 
getGlusterVolumeSnapshotDao().getAllByVolumeId(getGlusterVolumeId());
+        georepSessions = 
getDbFacade().getGlusterGeoRepDao().getGeoRepSessions(getGlusterVolumeId());
     }
 
     @Override
@@ -25,22 +36,61 @@
         addCanDoActionMessage(VdcBllMessages.VAR__ACTION__REMOVE);
     }
 
-    @Override
-    public void executeCommand() {
+    private boolean deleteAllGlusterVolumeSnapshots(Guid serverId,
+            String volumeName,
+            List<GlusterVolumeSnapshotEntity> snapshotsList) {
         VDSReturnValue retVal =
                 runVdsCommand(VDSCommandType.DeleteAllGlusterVolumeSnapshots,
-                        new GlusterVolumeVDSParameters(getUpServer().getId(), 
getGlusterVolumeName()));
+                        new GlusterVolumeVDSParameters(serverId, volumeName));
         setSucceeded(retVal.getSucceeded());
 
         if (!getSucceeded()) {
-            
handleVdsError(AuditLogType.GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETE_FAILED, 
retVal.getVdsError().getMessage());
+            
handleVdsError(AuditLogType.GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETE_FAILED, 
retVal.getVdsError()
+                    .getMessage());
         } else {
             List<Guid> guids = new ArrayList<>();
-            for (GlusterVolumeSnapshotEntity snapshot : snapshots) {
+            for (GlusterVolumeSnapshotEntity snapshot : snapshotsList) {
                 guids.add(snapshot.getId());
             }
             getGlusterVolumeSnapshotDao().removeAll(guids);
         }
+
+        return true;
+    }
+
+    @Override
+    public void executeCommand() {
+        if (georepSessions != null) {
+            for (GlusterGeoRepSession session : georepSessions) {
+                GlusterVolumeEntity slaveVolume =
+                        
getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId());
+                if (slaveVolume == null) {
+                    // continue with other sessions and try to pause
+                    continue;
+                }
+
+                VDS slaveUpServer = 
ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId());
+                if (slaveUpServer == null) {
+                    
handleVdsError(AuditLogType.GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETE_FAILED,
+                            
VdcBllErrors.NoUpServerFoundInRemoteCluster.name());
+                    setSucceeded(false);
+                    return;
+                }
+
+                List<GlusterVolumeSnapshotEntity> slaveVolumeSnapshots =
+                        
getGlusterVolumeSnapshotDao().getAllByVolumeId(slaveVolume.getId());
+
+                try (EngineLock lock = 
acquireEngineLock(session.getSlaveVolumeId(), LockingGroup.GLUSTER_SNAPSHOT)) {
+                    if (!deleteAllGlusterVolumeSnapshots(slaveUpServer.getId(),
+                            slaveVolume.getName(),
+                            slaveVolumeSnapshots)) {
+                        return;
+                    }
+                }
+            }
+        }
+
+        deleteAllGlusterVolumeSnapshots(getUpServer().getId(), 
getGlusterVolumeName(), snapshots);
     }
 
     @Override
@@ -49,8 +99,15 @@
             return false;
         }
 
+        for (GlusterGeoRepSession session : georepSessions) {
+            if (session.getSlaveVolumeId() == null || 
session.getSlaveNodeUuid() == null) {
+                return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE);
+            }
+        }
+
         if (snapshots == null || snapshots.isEmpty()) {
-            
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NO_SNAPSHOTS_EXIST,
 getGlusterVolumeName());
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NO_SNAPSHOTS_EXIST,
+                    getGlusterVolumeName());
         }
 
         return true;
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeSnapshotCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeSnapshotCommand.java
index b2e25fa..6472186 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeSnapshotCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeSnapshotCommand.java
@@ -1,15 +1,30 @@
 package org.ovirt.engine.core.bll.gluster;
 
+import java.util.List;
+
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeSnapshotActionParameters;
+import org.ovirt.engine.core.common.businessentities.VDS;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
+import org.ovirt.engine.core.common.errors.VdcBllErrors;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.common.locks.LockingGroup;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
 import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
 import 
org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotActionVDSParameters;
+import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.utils.lock.EngineLock;
 
+@NonTransactiveCommandAttribute
 public class DeleteGlusterVolumeSnapshotCommand extends 
GlusterVolumeSnapshotCommandBase<GlusterVolumeSnapshotActionParameters> {
+    private List<GlusterGeoRepSession> georepSessions;
+
     public 
DeleteGlusterVolumeSnapshotCommand(GlusterVolumeSnapshotActionParameters 
params) {
         super(params);
+        georepSessions = 
getDbFacade().getGlusterGeoRepDao().getGeoRepSessions(getGlusterVolumeId());
     }
 
     @Override
@@ -17,19 +32,54 @@
         addCanDoActionMessage(VdcBllMessages.VAR__ACTION__REMOVE);
     }
 
-    @Override
-    public void executeCommand() {
+    private boolean deleteGlusterVolumeSnapshot(Guid serverId, String 
volumeName, String snapshotName) {
         VDSReturnValue retVal =
-                runVdsCommand(VDSCommandType.DeleteGlusterVolume,
-                        new 
GlusterVolumeSnapshotActionVDSParameters(getUpServer().getId(),
-                                getGlusterVolumeName(),
-                                getParameters().getSnapshotName()));
+                runVdsCommand(VDSCommandType.DeleteGlusterVolumeSnapshot,
+                        new GlusterVolumeSnapshotActionVDSParameters(serverId,
+                                volumeName,
+                                snapshotName));
         setSucceeded(retVal.getSucceeded());
+
         if (!getSucceeded()) {
             handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_DELETE_FAILED, 
retVal.getVdsError().getMessage());
+            return false;
         } else {
             getGlusterVolumeSnapshotDao().remove(getSnapshot().getId());
         }
+
+        return true;
+    }
+
+    @Override
+    public void executeCommand() {
+        if (georepSessions != null) {
+            for (GlusterGeoRepSession session : georepSessions) {
+                GlusterVolumeEntity slaveVolume =
+                        
getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId());
+                if (slaveVolume == null) {
+                    // continue with other sessions and try to pause
+                    continue;
+                }
+
+                VDS slaveUpServer = 
ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId());
+                if (slaveUpServer == null) {
+                    
handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_DELETE_FAILED,
+                            
VdcBllErrors.NoUpServerFoundInRemoteCluster.name());
+                    setSucceeded(false);
+                    return;
+                }
+
+                try (EngineLock lock = 
acquireEngineLock(session.getSlaveVolumeId(), LockingGroup.GLUSTER_SNAPSHOT)) {
+                    if (!deleteGlusterVolumeSnapshot(slaveUpServer.getId(),
+                            slaveVolume.getName(),
+                            getSnapshot().getSnapshotName())) {
+                        return;
+                    }
+                }
+            }
+        }
+
+        deleteGlusterVolumeSnapshot(getUpServer().getId(), 
getGlusterVolumeName(), getSnapshot().getSnapshotName());
     }
 
     @Override
@@ -38,6 +88,12 @@
             return false;
         }
 
+        for (GlusterGeoRepSession session : georepSessions) {
+            if (session.getSlaveVolumeId() == null || 
session.getSlaveNodeUuid() == null) {
+                return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE);
+            }
+        }
+
         return true;
     }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GeoRepSessionCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GeoRepSessionCommandBase.java
index 4ccc823..6926827 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GeoRepSessionCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GeoRepSessionCommandBase.java
@@ -4,6 +4,7 @@
 import java.util.Map;
 
 import org.ovirt.engine.core.bll.LockMessagesMatchUtil;
+import org.ovirt.engine.core.bll.context.CommandContext;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
@@ -19,6 +20,10 @@
         super(params);
     }
 
+    public GeoRepSessionCommandBase(T params, CommandContext context) {
+        super(params, context);
+    }
+
     @Override
     protected void setActionMessageParameters() {
         
addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_GEOREP_SESSION);
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
index 68a3ac8..9678284 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
@@ -11,7 +11,10 @@
 import org.ovirt.engine.core.common.gluster.GlusterFeatureSupported;
 import org.ovirt.engine.core.common.locks.LockingGroup;
 import org.ovirt.engine.core.common.utils.Pair;
+import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDao;
+import org.ovirt.engine.core.utils.lock.EngineLock;
+import org.ovirt.engine.core.utils.lock.LockManagerFactory;
 
 public abstract class GlusterSnapshotCommandBase<T extends 
GlusterVolumeParameters> extends GlusterVolumeCommandBase<T> {
     public GlusterSnapshotCommandBase(T params) {
@@ -21,7 +24,7 @@
 
     @Override
     protected LockProperties applyLockProperties(LockProperties 
lockProperties) {
-        return lockProperties.withScope(Scope.Execution).withWait(false);
+        return lockProperties.withScope(Scope.Execution).withWait(true);
     }
 
     @Override
@@ -38,7 +41,7 @@
         }
 
         if 
(!GlusterFeatureSupported.glusterSnapshot(getVdsGroup().getcompatibility_version()))
 {
-            
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED);
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED);
         }
 
         return true;
@@ -57,4 +60,12 @@
     protected GlusterVolumeSnapshotDao getGlusterVolumeSnapshotDao() {
         return getDbFacade().getGlusterVolumeSnapshotDao();
     }
+
+    protected EngineLock acquireEngineLock(Guid id, LockingGroup group) {
+        EngineLock lock = new 
EngineLock(Collections.singletonMap(id.toString(),
+                LockMessagesMatchUtil.makeLockingPair(group,
+                        
VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_OPERATION_IN_PROGRESS)), null);
+        LockManagerFactory.getLockManager().acquireLockWait(lock);
+        return lock;
+    }
 }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeSnapshotCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeSnapshotCommandBase.java
index 2fbfeba..e33b290 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeSnapshotCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeSnapshotCommandBase.java
@@ -1,9 +1,17 @@
 package org.ovirt.engine.core.bll.gluster;
 
+import java.util.Collections;
+import java.util.Map;
+
+import org.ovirt.engine.core.bll.LockMessagesMatchUtil;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeSnapshotActionParameters;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity;
 import org.ovirt.engine.core.common.constants.gluster.GlusterConstants;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.common.locks.LockingGroup;
+import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.utils.lock.EngineLock;
+import org.ovirt.engine.core.utils.lock.LockManagerFactory;
 
 public abstract class GlusterVolumeSnapshotCommandBase<T extends 
GlusterVolumeSnapshotActionParameters> extends GlusterSnapshotCommandBase<T> {
     private GlusterVolumeSnapshotEntity snapshot;
@@ -14,8 +22,9 @@
     }
 
     @Override
-    protected void setActionMessageParameters() {
+    public Map<String, String> getCustomValues() {
         addCustomValue(GlusterConstants.VOLUME_SNAPSHOT_NAME, 
getParameters().getSnapshotName());
+        return super.getCustomValues();
     }
 
     @Override
@@ -35,4 +44,20 @@
     protected GlusterVolumeSnapshotEntity getSnapshot() {
         return this.snapshot;
     }
+
+    protected EngineLock acquireGeoRepSessionLock(Guid id) {
+        EngineLock lock = new 
EngineLock(Collections.singletonMap(id.toString(),
+                
LockMessagesMatchUtil.makeLockingPair(LockingGroup.GLUSTER_GEOREP,
+                        
VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_LOCKED)), null);
+        LockManagerFactory.getLockManager().acquireLockWait(lock);
+        return lock;
+    }
+
+    protected EngineLock acquireVolumeSnapshotLock(Guid id) {
+        EngineLock lock = new 
EngineLock(Collections.singletonMap(id.toString(),
+                
LockMessagesMatchUtil.makeLockingPair(LockingGroup.GLUSTER_SNAPSHOT,
+                        
VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_LOCKED)), null);
+        LockManagerFactory.getLockManager().acquireLockWait(lock);
+        return lock;
+    }
 }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RestoreGlusterVolumeSnapshotCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RestoreGlusterVolumeSnapshotCommand.java
index 260218d..678c3d6 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RestoreGlusterVolumeSnapshotCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RestoreGlusterVolumeSnapshotCommand.java
@@ -2,22 +2,30 @@
 
 import java.util.List;
 
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.action.VdcReturnValueBase;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters;
+import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeSnapshotActionParameters;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession;
 import org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
-import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity;
+import org.ovirt.engine.core.common.errors.VdcBllErrors;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.common.locks.LockingGroup;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
 import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
 import 
org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotActionVDSParameters;
+import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.utils.lock.EngineLock;
+import org.ovirt.engine.core.utils.transaction.TransactionMethod;
+import org.ovirt.engine.core.utils.transaction.TransactionSupport;
 
+@NonTransactiveCommandAttribute
 public class RestoreGlusterVolumeSnapshotCommand extends 
GlusterVolumeSnapshotCommandBase<GlusterVolumeSnapshotActionParameters> {
     private List<GlusterGeoRepSession> georepSessions;
 
@@ -31,73 +39,251 @@
         addCanDoActionMessage(VdcBllMessages.VAR__ACTION__RESTORE);
     }
 
-    @Override
-    public void executeCommand() {
-        for (GlusterGeoRepSession session : georepSessions) {
+    private boolean stopGeoReplicationSessions(List<GlusterGeoRepSession> 
geoRepSessions) {
+        for (GlusterGeoRepSession session : geoRepSessions) {
+            try (EngineLock lock = acquireGeoRepSessionLock(session.getId())) {
+                VdcReturnValueBase retVal = 
runInternalAction(VdcActionType.StopGeoRepSession,
+                        new 
GlusterVolumeGeoRepSessionParameters(getGlusterVolumeId(), session.getId()));
+
+                if (!retVal.getSucceeded()) {
+                    handleVdsError(AuditLogType.GEOREP_SESSION_STOP_FAILED, 
retVal.getExecuteFailedMessages()
+                            .toString());
+                    setSucceeded(false);
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    private boolean stopVolume(GlusterVolumeEntity volume) {
+        if (volume != null && volume.getStatus() == GlusterStatus.UP) {
+            VdcReturnValueBase retVal =
+                    runInternalAction(VdcActionType.StopGlusterVolume,
+                            new GlusterVolumeActionParameters(volume.getId(), 
true));
+            if (!retVal.getSucceeded()) {
+                handleVdsError(AuditLogType.GLUSTER_VOLUME_STOP_FAILED, 
retVal.getExecuteFailedMessages()
+                        .toString());
+                setSucceeded(false);
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    private boolean stopSlaveVolumes(List<GlusterGeoRepSession> 
geoRepSessions) {
+        for (GlusterGeoRepSession session : geoRepSessions) {
             GlusterVolumeEntity slaveVolume = 
getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId());
             if (slaveVolume == null) {
-                // continue with other sessions and restore the volumes
+                // continue with other sessions and try to stop
+                continue;
+            }
+
+            try (EngineLock lock = 
acquireEngineLock(session.getSlaveVolumeId(), LockingGroup.GLUSTER)) {
+                if (!stopVolume(slaveVolume)) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    private boolean restoreVolumeToSnapshot(Guid upServerId, 
GlusterVolumeEntity volume, String snapshotName) {
+        if (volume != null) {
+            VDSReturnValue retVal =
+                    runVdsCommand(VDSCommandType.RestoreGlusterVolumeSnapshot,
+                            new 
GlusterVolumeSnapshotActionVDSParameters(upServerId, volume.getName(), 
snapshotName));
+            if (!retVal.getSucceeded()) {
+                
handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED, 
retVal.getVdsError()
+                        .getMessage());
+                setSucceeded(false);
+                return false;
+            } else {
+                getGlusterVolumeSnapshotDao().removeByName(volume.getId(), 
snapshotName);
+            }
+        }
+
+        return true;
+    }
+
+    private boolean restoreSlaveVolumesToSnapshot(List<GlusterGeoRepSession> 
geoRepSessions, String snapshotName) {
+        for (GlusterGeoRepSession session : geoRepSessions) {
+            GlusterVolumeEntity slaveVolume = 
getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId());
+            if (slaveVolume == null) {
+                // continue with other sessions and try to pause
                 continue;
             }
 
             VDS slaveUpServer = 
ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId());
             if (slaveUpServer == null) {
                 
handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED,
-                        "No up server found in slave cluster of geo-rep 
session");
+                        VdcBllErrors.NoUpServerFoundInRemoteCluster.name());
                 setSucceeded(false);
-                return;
+                return false;
             }
 
-            // Bring down the remote volume and restore snapshot
-            if (slaveVolume.getStatus() == GlusterStatus.UP) {
-                VdcReturnValueBase volumeDownRetVal =
-                        runInternalAction(VdcActionType.StopGlusterVolume,
-                                new 
GlusterVolumeActionParameters(slaveVolume.getId(), true));
-                if (!volumeDownRetVal.getSucceeded()) {
-                    handleVdsError(AuditLogType.GLUSTER_VOLUME_STOP_FAILED, 
slaveVolume.getName());
-                    setSucceeded(false);
-                    return;
-                } else {
-                    GlusterVolumeSnapshotEntity slaveVolumeSnapshot =
-                            
getGlusterVolumeSnapshotDao().getByName(slaveVolume.getId(),
-                                    getParameters().getSnapshotName());
-                    if (slaveVolumeSnapshot == null) {
-                        
handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED,
-                                "Unable to find snapshot for slave volume");
-                        setSucceeded(false);
-                        return;
-                    }
-
-                    VDSReturnValue slaveRestoreRetVal =
-                            
runVdsCommand(VDSCommandType.RestoreGlusterVolumeSnapshot,
-                                    new 
GlusterVolumeSnapshotActionVDSParameters(slaveUpServer.getId(),
-                                            slaveVolume.getName(),
-                                            
slaveVolumeSnapshot.getSnapshotName()));
-                    if (!slaveRestoreRetVal.getSucceeded()) {
-                        
handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED,
-                                slaveRestoreRetVal.getVdsError().getMessage());
-                        setSucceeded(false);
-                        return;
-                    } else {
-                        
getGlusterVolumeSnapshotDao().remove(slaveVolumeSnapshot.getId());
-                    }
+            try (EngineLock lock = 
acquireEngineLock(session.getSlaveVolumeId(), LockingGroup.GLUSTER_SNAPSHOT)) {
+                if (!restoreVolumeToSnapshot(slaveUpServer.getId(), 
slaveVolume, getSnapshot().getSnapshotName())) {
+                    return false;
                 }
             }
         }
 
-        VDSReturnValue retVal =
-                runVdsCommand(VDSCommandType.RestoreGlusterVolumeSnapshot,
-                        new 
GlusterVolumeSnapshotActionVDSParameters(getUpServer().getId(),
-                                getGlusterVolumeName(),
-                                getParameters().getSnapshotName()));
-        setSucceeded(retVal.getSucceeded());
+        return true;
+    }
 
-        if (!getSucceeded()) {
-            
handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED, 
retVal.getVdsError().getMessage());
-        } else {
-            getGlusterVolumeSnapshotDao().remove(getSnapshot().getId());
-            // TODO: Was discussed to mark the snapshot as restored and still 
maintain in engine
+    private boolean startVolume(Guid clusterId, Guid volumeId) {
+        VdcReturnValueBase retVal =
+                runInternalAction(VdcActionType.StartGlusterVolume, new 
GlusterVolumeActionParameters(volumeId,
+                        true));
+
+        if (!retVal.getSucceeded()) {
+            handleVdsError(AuditLogType.GLUSTER_VOLUME_START_FAILED, 
retVal.getExecuteFailedMessages().toString());
+            setSucceeded(false);
+            return false;
         }
+
+        return true;
+    }
+
+    private boolean startSlaveVolumes(List<GlusterGeoRepSession> 
geoRepSessions) {
+        for (GlusterGeoRepSession session : geoRepSessions) {
+            GlusterVolumeEntity slaveVolume = 
getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId());
+            if (slaveVolume == null) {
+                // continue with other sessions and try to stop
+                continue;
+            }
+
+            try (EngineLock lock = 
acquireEngineLock(slaveVolume.getClusterId(), LockingGroup.GLUSTER)) {
+                if (!startVolume(slaveVolume.getClusterId(), 
slaveVolume.getId())) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    private boolean resumeGeoRepSessions(List<GlusterGeoRepSession> 
geoRepSessions) {
+        for (GlusterGeoRepSession session : geoRepSessions) {
+            GlusterVolumeEntity slaveVolume = 
getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId());
+            if (slaveVolume == null) {
+                // continue with other sessions and try to pause
+                continue;
+            }
+
+            try (EngineLock lock = acquireGeoRepSessionLock(session.getId())) {
+                VdcReturnValueBase retVal = 
runInternalAction(VdcActionType.ResumeGeoRepSession,
+                        new 
GlusterVolumeGeoRepSessionParameters(getGlusterVolumeId(), session.getId()));
+
+                if (!retVal.getSucceeded()) {
+                    
handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_RESUME_FAILED, 
retVal.getExecuteFailedMessages()
+                            .toString());
+                    setSucceeded(false);
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    private boolean startGeoRepSessions(List<GlusterGeoRepSession> 
geoRepSessions) {
+        for (GlusterGeoRepSession session : geoRepSessions) {
+            try (EngineLock lock = acquireGeoRepSessionLock(session.getId())) {
+                VdcReturnValueBase retVal = 
runInternalAction(VdcActionType.StartGlusterVolumeGeoRep,
+                        new 
GlusterVolumeGeoRepSessionParameters(getGlusterVolumeId(), session.getId()));
+
+                if (!retVal.getSucceeded()) {
+                    
handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_START_FAILED_EXCEPTION,
+                            retVal.getExecuteFailedMessages()
+                                    .toString());
+                    setSucceeded(false);
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    @Override
+    public void executeCommand() {
+        Boolean tranRetVal = TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Boolean>() {
+            @Override
+            public Boolean runInTransaction() {
+                if (georepSessions != null) {
+                    // Pause the geo-replication session
+                    if (!stopGeoReplicationSessions(georepSessions)) {
+                        return false;
+                    }
+
+                    // Stop the slave volumes
+                    if (!stopSlaveVolumes(georepSessions)) {
+                        return false;
+                    }
+
+                    // Restore the slave volumes to said the snapshot
+                    if (!restoreSlaveVolumesToSnapshot(georepSessions, 
getParameters().getSnapshotName())) {
+                        return false;
+                    }
+                }
+
+                return true;
+            }
+        });
+
+        if (!tranRetVal) {
+            return;
+        }
+
+        // Stop the master volume
+        if (!stopVolume(getGlusterVolume())) {
+            if (!georepSessions.isEmpty()) {
+                
handleVdsError(AuditLogType.GLUSTER_MASTER_VOLUME_STOP_FAILED_DURING_SNAPSHOT_RESTORE,
+                        
VdcBllErrors.FailedToStopMasterVolumeDuringVolumeSnapshotRestore.name());
+            }
+            return;
+        }
+
+        // Restore the master volume to the said snapshot
+        if (!restoreVolumeToSnapshot(upServer.getId(), getGlusterVolume(), 
getParameters().getSnapshotName())) {
+            if (!georepSessions.isEmpty()) {
+                
handleVdsError(AuditLogType.GLUSTER_MASTER_VOLUME_SNAPSHOT_RESTORE_FAILED,
+                        
VdcBllErrors.FailedToRestoreMasterVolumeDuringVolumeSnapshotRestore.name());
+            }
+            return;
+        }
+
+        List<GlusterGeoRepSession> updatedGeoRepSessions =
+                
getDbFacade().getGlusterGeoRepDao().getGeoRepSessions(getGlusterVolumeId());
+
+        // Start the slave volumes
+        if (updatedGeoRepSessions != null && 
!startSlaveVolumes(updatedGeoRepSessions)) {
+            return;
+        }
+
+        // Start the master volume
+        if (!startVolume(getGlusterVolume().getClusterId(), 
getGlusterVolumeId())) {
+            return;
+        }
+
+        if (updatedGeoRepSessions != null) {
+            // Start the geo-replication sessions
+            if (!startGeoRepSessions(updatedGeoRepSessions)) {
+                return;
+            }
+
+            // Resume the geo-replication sessions
+            if (!resumeGeoRepSessions(updatedGeoRepSessions)) {
+                return;
+            }
+        }
+
+        setSucceeded(true);
     }
 
     @Override
@@ -106,13 +292,9 @@
             return false;
         }
 
-        if (getGlusterVolume().getStatus() != GlusterStatus.DOWN) {
-            
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_UP, 
getGlusterVolumeName());
-        }
-
         for (GlusterGeoRepSession session : georepSessions) {
             if (session.getSlaveVolumeId() == null || 
session.getSlaveNodeUuid() == null) {
-                
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE);
+                return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE);
             }
         }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
index 4f0936a..2b50232 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.core.bll.gluster;
 
 import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
+import org.ovirt.engine.core.bll.context.CommandContext;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.LockProperties;
 import org.ovirt.engine.core.common.action.LockProperties.Scope;
@@ -23,6 +24,10 @@
         super(params);
     }
 
+    public StartGlusterVolumeCommand(GlusterVolumeActionParameters params, 
CommandContext context) {
+        super(params, context);
+    }
+
     @Override
     protected LockProperties applyLockProperties(LockProperties 
lockProperties) {
         return lockProperties.withScope(Scope.Execution).withWait(true);
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeGeoRepCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeGeoRepCommand.java
index 9ce8098..1480003 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeGeoRepCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeGeoRepCommand.java
@@ -1,5 +1,6 @@
 package org.ovirt.engine.core.bll.gluster;
 
+import org.ovirt.engine.core.bll.context.CommandContext;
 import org.ovirt.engine.core.common.AuditLogType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GeoRepSessionStatus;
@@ -15,6 +16,10 @@
         super(params);
     }
 
+    public 
StartGlusterVolumeGeoRepCommand(GlusterVolumeGeoRepSessionParameters params, 
CommandContext context) {
+        super(params, context);
+    }
+
     @Override
     protected void setActionMessageParameters() {
         super.setActionMessageParameters();
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGeoRepSessionCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGeoRepSessionCommand.java
index 7fe7615..40a4b6f 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGeoRepSessionCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGeoRepSessionCommand.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.core.bll.gluster;
 
 import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
+import org.ovirt.engine.core.bll.context.CommandContext;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.LockProperties;
 import org.ovirt.engine.core.common.action.LockProperties.Scope;
@@ -21,6 +22,10 @@
         super(params);
     }
 
+    public StopGeoRepSessionCommand(GlusterVolumeGeoRepSessionParameters 
params, CommandContext context) {
+        super(params, context);
+    }
+
     @Override
     protected LockProperties applyLockProperties(LockProperties 
lockProperties) {
         return lockProperties.withScope(Scope.Execution).withWait(false);
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
index b51e3a4..402d05c 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.core.bll.gluster;
 
 import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
+import org.ovirt.engine.core.bll.context.CommandContext;
 import org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.LockProperties;
@@ -26,6 +27,10 @@
         super(params);
     }
 
+    public StopGlusterVolumeCommand(GlusterVolumeActionParameters params, 
CommandContext context) {
+        super(params, context);
+    }
+
     @Override
     protected LockProperties applyLockProperties(LockProperties 
lockProperties) {
         return lockProperties.withScope(Scope.Execution).withWait(true);
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
index 20c2170..c5f2af0 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
@@ -419,7 +419,8 @@
     STORAGE_DEVICE_REMOVED_FROM_THE_HOST(4125),
     SYNC_STORAGE_DEVICES_IN_HOST(4126),
     SYNC_STORAGE_DEVICES_IN_HOST_FAILED(4127),
-
+    GLUSTER_MASTER_VOLUME_STOP_FAILED_DURING_SNAPSHOT_RESTORE(4130, 
AuditLogSeverity.ERROR),
+    GLUSTER_MASTER_VOLUME_SNAPSHOT_RESTORE_FAILED(4131, 
AuditLogSeverity.ERROR),
     USER_FORCE_SELECTED_SPM(159),
     USER_VDS_RESTART(41),
     USER_FAILED_VDS_RESTART(107, AuditLogSeverity.ERROR),
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
index 9810992..2e33ad9 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
@@ -332,6 +332,9 @@
     InvalidResourceName(853),
     ResourceReferenceInvalid(854),
     ResourceAcqusitionFailed(855),
+    NoUpServerFoundInRemoteCluster(856),
+    FailedToStopMasterVolumeDuringVolumeSnapshotRestore(857),
+    FailedToRestoreMasterVolumeDuringVolumeSnapshotRestore(858),
     InvalidParameterException(1000),
     InvalidDefaultExceptionException(1001),
     NotImplementedException(2000),
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
index 266129e..e3e6fc8 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -841,6 +841,8 @@
 STORAGE_DEVICE_REMOVED_FROM_THE_HOST=Detected deletion of storage device 
${storageDevice} on host ${VdsName}, and deleting it from engine DB."
 SYNC_STORAGE_DEVICES_IN_HOST=Manually synced the storage devices from host 
${VdsName}
 SYNC_STORAGE_DEVICES_IN_HOST_FAILED=Failed to synced storage devices from host 
${VdsName}
+GLUSTER_MASTER_VOLUME_STOP_FAILED_DURING_SNAPSHOT_RESTORE=Could not stop 
master volume ${glusterVolumeName} during snapshot restore.
+GLUSTER_MASTER_VOLUME_SNAPSHOT_RESTORE_FAILED=Could not restore master volume 
${glusterVolumeName}.
 VDS_UNTRUSTED=Host ${VdsName} was set to non-operational. Host is not trusted 
by the attestation service.
 USER_ADDED_NETWORK_QOS=Network QoS ${QosName} was added. (User: ${UserName})
 USER_FAILED_TO_ADD_NETWORK_QOS=Failed to add Network QoS ${QosName}. (User: 
${UserName})
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
index 366c6d7..0031696 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
@@ -296,6 +296,9 @@
 MergeVolumeRollbackError=Cannot rollback merge volume
 ResourceReferenceInvalid=Cannot perform operation. This resource has been 
released or expired
 ResourceAcqusitionFailed=Could not acquire resource. Probably resource factory 
threw an exception
+NoUpServerFoundInSlaveCluster=Cannot perform volume snapshot operation. No up 
server found in slave cluster of geo-replication session
+FailedToStopMasterVolumeDuringVolumeSnapshotRestore=Failed to stop the master 
volume while restoring the snapshot, whereas slave volume(s) are restored to 
older state. Admin should manually inetrevene and set the stime in master to 
proper value and resume the geo-replication session
+FailedToRestoreMasterVolumeDuringVolumeSnapshotRestore=Failed to restore the 
master volume, whereas slave volume(s) are restored to older state. Admin 
should manually inetrevene and set the stime in master to proper value and 
resume the geo-replication session
 ENGINE_ERROR_CREATING_STORAGE_POOL=Cannot create Storage Pool, please check 
all hosts can connect to the storage domains.
 unavail=Resource unavailable
 FAILED_CHANGE_CD_IS_MOUNTED=Failed to perform "Change CD" operation, CD might 
be still in use by the VM.\nPlease try to manually detach the CD from withing 
the VM:\n  1. Log in to the VM\n  2  For Linux VMs, un-mount the CD using 
umount command;\n     For Windows VMs, right click on the CD drive and click 
'Eject';
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/jsonrpc/JsonRpcVdsServer.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/jsonrpc/JsonRpcVdsServer.java
index 1768f66..4aee335 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/jsonrpc/JsonRpcVdsServer.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/jsonrpc/JsonRpcVdsServer.java
@@ -1649,7 +1649,7 @@
     @Override
     public StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete(String 
volumeName) {
         JsonRpcRequest request =
-                new 
RequestBuilder("GlusterVolume.snapshotDelete").withParameter("volumeName", 
volumeName)
+                new 
RequestBuilder("GlusterVolume.snapshotDeleteAll").withParameter("volumeName", 
volumeName)
                     .build();
         Map<String, Object> response = new FutureMap(this.client, request);
         return new StatusOnlyReturnForXmlRpc(response);
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
index 4c11a9f..4b9ee4b 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
+++ 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
@@ -243,6 +243,8 @@
 AuditLogType___GLUSTER_VOLUME_SNAPSHOT_CONFIG_UPDATED=Gluster volume snapshot 
configuration updated
 AuditLogType___GLUSTER_VOLUME_SNAPSHOT_CONFIG_UPDATE_FAILED=Failed to update 
gluster volume snapshot configuration
 AuditLogType___GLUSTER_VOLUME_SNAPSHOT_CONFIG_UPDATE_FAILED_PARTIALLY=Failed 
to update some gluster volume snapshot configuration
+AuditLogType___GLUSTER_MASTER_VOLUME_STOP_FAILED_DURING_SNAPSHOT_RESTORE=Could 
not stop master volume ${glusterVolumeName} during snapshot restore.
+AuditLogType___GLUSTER_MASTER_VOLUME_SNAPSHOT_RESTORE_FAILED=Could not restore 
master volume ${glusterVolumeName}.
 
 VdcActionType___ActivateVds=Activate Host
 VdcActionType___RecoveryStoragePool=Reinitialize Data Center
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
index aabb6fe..4000118 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
@@ -285,6 +285,9 @@
 MergeVolumeRollbackError=Cannot rollback merge volume
 ResourceReferenceInvalid=Cannot perform operation. This resource has been 
released or expired
 ResourceAcqusitionFailed=Could not acquire resource. Probably resource factory 
threw an exception
+NoUpServerFoundInSlaveCluster=Cannot perform volume snapshot operation. No up 
server found in slave cluster of geo-replication session
+FailedToStopMasterVolumeDuringVolumeSnapshotRestore=Failed to stop the master 
volume while restoring the snapshot, whereas slave volume(s) are restored to 
older state. Admin should manually inetrevene and set the stime in master to 
proper value and resume the geo-replication session
+FailedToRestoreMasterVolumeDuringVolumeSnapshotRestore=Failed to restore the 
master volume, whereas slave volume(s) are restored to older state. Admin 
should manually inetrevene and set the stime in master to proper value and 
resume the geo-replication session
 ENGINE_ERROR_CREATING_STORAGE_POOL=Cannot create Storage Pool, please check 
all hosts can connect to the storage domains.
 unavail=Resource unavailable
 FAILED_CHANGE_CD_IS_MOUNTED=Failed to perform "Change CD" operation, CD might 
be still in use by the VM.\nPlease try to manually detach the CD from withing 
the VM:\n  1. Log in to the VM\n  2  For Linux VMs, un-mount the CD using 
umount command;\n     For Windows VMs, right click on the CD drive and click 
'Eject';


-- 
To view, visit https://gerrit.ovirt.org/39873
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0eccbcd4aa3e218ba0d910bd9150bdb0baa2db68
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5-gluster
Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to