Shubhendu Tripathi has uploaded a new change for review.

Change subject: gluster: Added additional canDoAction check
......................................................................

gluster: Added additional canDoAction check

Added additional canDoAction check while creation of
gluster volume snapshot. If one or more brick(s) are
down for the volume, snapshot creation would not be
supported

Change-Id: I2ed296a6afc4dfa5f3e7023c0dc40b7da4ad4392
Bug-Url: https://bugzilla.redhat.com/1213238
Signed-off-by: Shubhendu Tripathi <shtri...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/18/40118/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java
index a76f2ff..89ebd2c 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java
@@ -13,6 +13,7 @@
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GeoRepSessionStatus;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus;
 import org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus;
@@ -198,6 +199,13 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SNAPSHOT_ALREADY_EXISTS);
         }
 
+        List<GlusterBrickEntity> bricks = volume.getBricks();
+        for (GlusterBrickEntity brick : bricks) {
+            if (brick.getStatus() == GlusterStatus.DOWN) {
+                return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN);
+            }
+        }
+
         for (GlusterGeoRepSession session : georepSessions) {
             if (session.getSlaveNodeUuid() == null || 
session.getSlaveVolumeId() == null) {
                 // Slave cluster is not maintained by engine, so cannot pause 
geo-rep session and create snapshot for


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ed296a6afc4dfa5f3e7023c0dc40b7da4ad4392
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
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