use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class AddStorageDomainCommand method connectStorage.
protected Pair<Boolean, Integer> connectStorage() {
String connectionId = getStorageDomain().getStorage();
StorageServerConnections connection = storageServerConnectionDao.get(connectionId);
Map<String, String> result = (Map<String, String>) runVdsCommand(VDSCommandType.ConnectStorageServer, new StorageServerConnectionManagementVDSParameters(getParameters().getVdsId(), Guid.Empty, connection.getStorageType(), new ArrayList<>(Collections.singletonList(connection)))).getReturnValue();
return new Pair<>(storageHelperDirector.getItem(connection.getStorageType()).isConnectSucceeded(result, Collections.singletonList(connection)), Integer.parseInt(result.values().iterator().next()));
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class AddStorageDomainCommon method checkStorageConnection.
protected boolean checkStorageConnection(String storageDomainConnection) {
List<StorageDomain> domains = null;
StorageServerConnections connection = storageServerConnectionDao.get(storageDomainConnection);
if (connection == null) {
return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST);
}
if (connection.getStorageType().isFileDomain()) {
domains = getStorageDomainsByConnId(connection.getId());
if (domains.size() > 0) {
String domainNames = domains.stream().map(StorageDomain::getName).collect(Collectors.joining(","));
return prepareFailureMessageForDomains(domainNames);
}
}
return true;
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class BackendStorageDomainsResource method connectStorageToHost.
private void connectStorageToHost(Guid hostId, StorageType storageType, LogicalUnit unit) {
StorageServerConnections cnx = StorageDomainHelper.getConnection(storageType, unit.getAddress(), unit.getTarget(), unit.getUsername(), unit.getPassword(), unit.getPort());
performAction(ActionType.ConnectStorageToVds, new StorageServerConnectionParametersBase(cnx, hostId, false));
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class BackendStorageDomainsResource method mapVolumeGroupIscsi.
protected void mapVolumeGroupIscsi(StorageDomain model, org.ovirt.engine.core.common.businessentities.StorageDomain entity) {
VolumeGroup vg = model.getStorage().getVolumeGroup();
List<LUNs> luns = getLunsByVgId(vg.getId());
if (luns != null && !luns.isEmpty()) {
vg.setLogicalUnits(new LogicalUnits());
for (LUNs lun : luns) {
List<StorageServerConnections> lunConnections = lun.getLunConnections();
if (lunConnections != null) {
for (StorageServerConnections cnx : lunConnections) {
LogicalUnit unit = map(lun);
unit = map(cnx, unit);
vg.getLogicalUnits().getLogicalUnits().add(unit);
}
}
}
}
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class BackendIscsiBondStorageConnectionsResource method add.
@Override
public Response add(StorageConnection conn) {
StorageServerConnections entity = StorageDomainMapper.map(conn, null);
IscsiBond iscsiBond = getIscsiBond();
iscsiBond.getStorageConnectionIds().add(entity.getId());
return performAction(ActionType.EditIscsiBond, new EditIscsiBondParameters(iscsiBond));
}
Aggregations