Sahina Bose has posted comments on this change. Change subject: gluster: BLL command for volume snapshot create ......................................................................
Patch Set 16: (5 comments) http://gerrit.ovirt.org/#/c/34928/16/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java: Line 67: Line 68: // Get slave geo-rep sessions Line 69: if (geoRepSessions != null && geoRepSessions.size() > 0) { Line 70: for (GlusterGeoRepSession session : geoRepSessions) { Line 71: if (session.getStatus() == GeoRepSessionStatus.ACTIVE) { Even faulty sessions may need to be paused? Line 72: GlusterVolumeEntity slaveVolume = Line 73: getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId()); Line 74: VDS slaveUpServer = ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId()); Line 75: Line 69: if (geoRepSessions != null && geoRepSessions.size() > 0) { Line 70: for (GlusterGeoRepSession session : geoRepSessions) { Line 71: if (session.getStatus() == GeoRepSessionStatus.ACTIVE) { Line 72: GlusterVolumeEntity slaveVolume = Line 73: getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId()); what if slaveVolumeId is null? Line 74: VDS slaveUpServer = ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId()); Line 75: Line 76: // Pause the geo-rep session Line 77: VdcReturnValueBase sessionPauseRetVal = Line 70: for (GlusterGeoRepSession session : geoRepSessions) { Line 71: if (session.getStatus() == GeoRepSessionStatus.ACTIVE) { Line 72: GlusterVolumeEntity slaveVolume = Line 73: getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId()); Line 74: VDS slaveUpServer = ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId()); up server should be checked on master volume Line 75: Line 76: // Pause the geo-rep session Line 77: VdcReturnValueBase sessionPauseRetVal = Line 78: getBackend().runAction(VdcActionType.PauseGlusterVolumeGeoRepSession, Line 75: Line 76: // Pause the geo-rep session Line 77: VdcReturnValueBase sessionPauseRetVal = Line 78: getBackend().runAction(VdcActionType.PauseGlusterVolumeGeoRepSession, Line 79: new GlusterVolumeGeoRepSessionParameters(slaveVolume.getId(), to pause session, the master volume id should be passed as first parameter Line 80: session.getSlaveVolumeName(), Line 81: session.getSlaveHostName())); Line 82: if (!sessionPauseRetVal.getSucceeded()) { Line 83: handleVdsErrors(AuditLogType.GLUSTER_VOLUME_GEO_REP_PAUSE_FAILED, Line 87: } else { Line 88: // Create snapshot for slave volume Line 89: VDSReturnValue snapCreationRetVal = Line 90: runVdsCommand(VDSCommandType.CreateGlusterVolumeSnapshot, Line 91: new GlusterVolumeCreateSnapshotVDSParameters(slaveUpServer.getId(), here...you can only do this if slave is managed by oVirt. You may need to return an error message to user in this case., and invoke the command with a parameter to ignore geo-rep sessions Line 92: session.getSlaveVolumeName(), Line 93: snapshot.getSnapshotName(), Line 94: snapshot.getDescription(), Line 95: force)); -- To view, visit http://gerrit.ovirt.org/34928 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c27f9e73bac8d6de3022b0dd4e70aa0d8b1494b Gerrit-PatchSet: 16 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shubhendu Tripathi <[email protected]> Gerrit-Reviewer: Kanagaraj M <[email protected]> Gerrit-Reviewer: Omer Frenkel <[email protected]> Gerrit-Reviewer: Ramesh N <[email protected]> Gerrit-Reviewer: Sahina Bose <[email protected]> Gerrit-Reviewer: Shubhendu Tripathi <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
