Search in sources :

Example 6 with ChapInfo

use of org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo in project cloudstack by apache.

the class StorageSystemDataMotionStrategy method getVolumeDetails.

private Map<String, String> getVolumeDetails(VolumeInfo volumeInfo) {
    Map<String, String> volumeDetails = new HashMap<String, String>();
    VolumeVO volumeVO = _volumeDao.findById(volumeInfo.getId());
    long storagePoolId = volumeVO.getPoolId();
    StoragePoolVO storagePoolVO = _storagePoolDao.findById(storagePoolId);
    volumeDetails.put(DiskTO.STORAGE_HOST, storagePoolVO.getHostAddress());
    volumeDetails.put(DiskTO.STORAGE_PORT, String.valueOf(storagePoolVO.getPort()));
    volumeDetails.put(DiskTO.IQN, volumeVO.get_iScsiName());
    ChapInfo chapInfo = _volumeService.getChapInfo(volumeInfo, volumeInfo.getDataStore());
    if (chapInfo != null) {
        volumeDetails.put(DiskTO.CHAP_INITIATOR_USERNAME, chapInfo.getInitiatorUsername());
        volumeDetails.put(DiskTO.CHAP_INITIATOR_SECRET, chapInfo.getInitiatorSecret());
        volumeDetails.put(DiskTO.CHAP_TARGET_USERNAME, chapInfo.getTargetUsername());
        volumeDetails.put(DiskTO.CHAP_TARGET_SECRET, chapInfo.getTargetSecret());
    }
    return volumeDetails;
}
Also used : VolumeVO(com.cloud.storage.VolumeVO) HashMap(java.util.HashMap) StoragePoolVO(org.apache.cloudstack.storage.datastore.db.StoragePoolVO) ChapInfo(org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo)

Aggregations

HashMap (java.util.HashMap)6 ChapInfo (org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo)6 StoragePoolVO (org.apache.cloudstack.storage.datastore.db.StoragePoolVO)4 VolumeVO (com.cloud.storage.VolumeVO)3 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)3 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)2 ResourceAllocationException (com.cloud.exception.ResourceAllocationException)2 CopyCommandResult (org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult)2 CreateCmdResult (org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult)2 AsyncCallFuture (org.apache.cloudstack.framework.async.AsyncCallFuture)2 DataTO (com.cloud.agent.api.to.DataTO)1 DiskTO (com.cloud.agent.api.to.DiskTO)1 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 PermissionDeniedException (com.cloud.exception.PermissionDeniedException)1 StorageUnavailableException (com.cloud.exception.StorageUnavailableException)1 HostVO (com.cloud.host.HostVO)1 VmDiskStatisticsVO (com.cloud.user.VmDiskStatisticsVO)1 TransactionCallbackWithException (com.cloud.utils.db.TransactionCallbackWithException)1 NoTransitionException (com.cloud.utils.fsm.NoTransitionException)1 JsonParseException (com.google.gson.JsonParseException)1