use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class GlusterSyncJobTest method getFetchedVolumesList.
/**
* Returns the list of volumes as if they were fetched from glusterfs. Changes from existing volumes are:<br>
* - existingDistVol not fetched (means it was removed from gluster cli, and should be removed from db<br>
* - option 'auth.allow' removed from the existingReplVol<br>
* - new option 'auth.reject' added to existingReplVol<br>
* - value of option 'nfs.disable' changed from 'off' ot 'on' in existingReplVol<br>
* - new volume test-new-vol fetched from gluster (means it was added from gluster cli, and should be added to db<br>
*/
private Map<Guid, GlusterVolumeEntity> getFetchedVolumesList() {
Map<Guid, GlusterVolumeEntity> volumes = new HashMap<>();
GlusterVolumeEntity fetchedReplVol = createReplVol();
// option removed
fetchedReplVol.removeOption(OPTION_AUTH_ALLOW);
// added
fetchedReplVol.setOption(OPTION_AUTH_REJECT, AUTH_REJECT_IP);
// changed
fetchedReplVol.setOption(OPTION_NFS_DISABLE, OPTION_VALUE_ON);
// brick changes
removedBrickIds.add(GlusterCoreUtil.findBrick(existingReplVol.getBricks(), SERVER_ID_1, REPL_BRICK_R1D1).getId());
removedBrickIds.add(GlusterCoreUtil.findBrick(existingReplVol.getBricks(), SERVER_ID_1, REPL_BRICK_R2D1).getId());
GlusterBrickEntity brickToReplace = GlusterCoreUtil.findBrick(fetchedReplVol.getBricks(), SERVER_ID_1, REPL_BRICK_R1D1);
replaceBrick(brickToReplace, SERVER_ID_1, REPL_BRICK_R1D1_NEW);
brickToReplace = GlusterCoreUtil.findBrick(fetchedReplVol.getBricks(), SERVER_ID_1, REPL_BRICK_R2D1);
replaceBrick(brickToReplace, SERVER_ID_1, REPL_BRICK_R2D1_NEW);
volumes.put(fetchedReplVol.getId(), fetchedReplVol);
// add a new volume
newVolume = getNewVolume();
volumes.put(newVolume.getId(), newVolume);
return volumes;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class GlusterVolumeRemoveBricksCommandTest method getSingleBrickVolume.
private GlusterVolumeEntity getSingleBrickVolume(Guid volumeId) {
GlusterVolumeEntity volume = getGlusterVolume(volumeId);
volume.setStatus(GlusterStatus.UP);
volume.setBricks(getBricks(volumeId, 1));
volume.setClusterId(CLUSTER_ID);
return volume;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class GlusterVolumeRemoveBricksCommandTest method getMultiBrickVolume.
private GlusterVolumeEntity getMultiBrickVolume(Guid volumeId) {
GlusterVolumeEntity volume = getGlusterVolume(volumeId);
volume.setStatus(GlusterStatus.UP);
volume.setBricks(getBricks(volumeId, 2));
volume.setClusterId(CLUSTER_ID);
return volume;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class RefreshGlusterVolumeDetailsCommandTest method getVolume.
private GlusterVolumeEntity getVolume(Guid id) {
GlusterVolumeEntity volumeEntity = new GlusterVolumeEntity();
volumeEntity.setId(id);
volumeEntity.setName("test-vol");
volumeEntity.addAccessProtocol(AccessProtocol.GLUSTER);
volumeEntity.addTransportType(TransportType.TCP);
return volumeEntity;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class RefreshGlusterVolumeDetailsCommandTest method getDistributedVolume.
private GlusterVolumeEntity getDistributedVolume(Guid volumeId) {
GlusterVolumeEntity volume = getVolume(volumeId);
volume.setStatus((volumeId == volumeId1) ? GlusterStatus.UP : GlusterStatus.DOWN);
volume.setBricks(getBricks(volumeId, 2));
volume.setVolumeType(GlusterVolumeType.DISTRIBUTE);
volume.setClusterId(CLUSTER_ID);
return volume;
}
Aggregations