Search in sources :

Example 96 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class VNXUnityFileStorageDevice method doModifyFS.

@Override
public BiosCommandResult doModifyFS(StorageSystem storage, FileDeviceInputOutput fd) throws ControllerException {
    BiosCommandResult result = new BiosCommandResult();
    result.setCommandSuccess(false);
    result.setCommandStatus(Operation.Status.error.name());
    result.setMessage("Modify FS NOT supported for VNXe.");
    return result;
}
Also used : BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult)

Example 97 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class DataDomainFileStorageDevice method doUpdateQuotaDirectory.

@Override
public BiosCommandResult doUpdateQuotaDirectory(StorageSystem storage, FileDeviceInputOutput args, QuotaDirectory qd) throws ControllerException {
    BiosCommandResult result = new BiosCommandResult();
    ServiceError serviceError = DeviceControllerErrors.datadomain.operationNotSupported();
    result = BiosCommandResult.createErrorResult(serviceError);
    return result;
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult)

Example 98 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class DataDomainFileStorageDevice method doCreateQuotaDirectory.

@Override
public BiosCommandResult doCreateQuotaDirectory(StorageSystem storage, FileDeviceInputOutput args, QuotaDirectory qd) throws ControllerException {
    BiosCommandResult result = new BiosCommandResult();
    ServiceError serviceError = DeviceControllerErrors.datadomain.operationNotSupported();
    result = BiosCommandResult.createErrorResult(serviceError);
    return result;
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult)

Example 99 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class DataDomainFileStorageDevice method doCreateFS.

@Override
public BiosCommandResult doCreateFS(StorageSystem storage, FileDeviceInputOutput args) throws ControllerException {
    _log.info("DataDomainFileStorageDevice doCreateFS {} with name {} - start", args.getFsId(), args.getFsName());
    // TODO
    try {
        _log.info("DataDomainFileStorageDevice doCreateFS {} with name {} - start", args.getFsId(), args.getFsName());
        DataDomainClient ddclient = getDataDomainClient(storage);
        if (ddclient == null) {
            _log.error("doCreateFS failed, provider unreachable");
            String op = "FS create";
            return BiosCommandResult.createErrorResult(DeviceControllerErrors.datadomain.operationFailedProviderInaccessible(op));
        }
        // Update path and mountPath
        // TODO: try to mount export
        String path = args.getFsName();
        String mountPath;
        if (!path.startsWith(DataDomainApiConstants.FS_PATH_BASE)) {
            mountPath = DataDomainApiConstants.FS_PATH_BASE + path;
        } else {
            mountPath = path;
        }
        _log.info("Mount path to mount the DataDomain File System {}", mountPath);
        args.setFsMountPath(mountPath);
        args.setFsPath(mountPath);
        // Create MTree
        // Data Domain expects capacity in Bytes
        Long mtreeCapacity = args.getFsCapacity();
        // TODO: Following two values are hard-coded for now, until they are implemented in UI
        Boolean enableRetention = false;
        String retentionMode = "compliance";
        DDMTreeInfo ddMtreeInfo = ddclient.createMTree(args.getStoragePool().getNativeId(), mountPath, mtreeCapacity, enableRetention, retentionMode);
        args.setFsNativeId(ddMtreeInfo.getId());
        String serialNumber = storage.getSerialNumber();
        if (serialNumber == null) {
            serialNumber = storage.getModel();
        }
        String fsNativeGuid = NativeGUIDGenerator.generateNativeGuid(storage.getSystemType(), serialNumber.toUpperCase(), ddMtreeInfo.getId());
        args.setFsNativeGuid(fsNativeGuid);
        args.setNewFSCapacity(args.getFsCapacity());
        if (args.getFsExtensions() == null) {
            args.initFsExtensions();
        }
        args.getFsExtensions().put(DataDomainApiConstants.TOTAL_PHYSICAL_CAPACITY, String.valueOf(args.getFsCapacity()));
        _log.info("DataDomainFileStorageDevice doCreateFS {} - complete", args.getFsId());
        return BiosCommandResult.createSuccessfulResult();
    } catch (DataDomainApiException e) {
        _log.error("doCreateFS failed, device error...attempting to delete FS to rollback.", e);
        // rollback this operation to prevent partial result of file share create
        BiosCommandResult rollbackResult = doDeleteFS(storage, args);
        if (rollbackResult.isCommandSuccess()) {
            _log.info("DataDomainFileStorageDevice doCreateFS {} - rollback completed.", args.getFsId());
        } else {
            _log.error("DataDomainFileStorageDevice doCreateFS {} - rollback failed,  message: {} .", args.getFsId(), rollbackResult.getMessage());
        }
        return BiosCommandResult.createErrorResult(e);
    }
}
Also used : DataDomainApiException(com.emc.storageos.datadomain.restapi.errorhandling.DataDomainApiException) DDMTreeInfo(com.emc.storageos.datadomain.restapi.model.DDMTreeInfo) BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult) DataDomainClient(com.emc.storageos.datadomain.restapi.DataDomainClient)

Example 100 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class DataDomainFileStorageDevice method doDeleteQuotaDirectory.

@Override
public BiosCommandResult doDeleteQuotaDirectory(StorageSystem storage, FileDeviceInputOutput args) throws ControllerException {
    BiosCommandResult result = new BiosCommandResult();
    ServiceError serviceError = DeviceControllerErrors.datadomain.operationNotSupported();
    result = BiosCommandResult.createErrorResult(serviceError);
    return result;
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult)

Aggregations

BiosCommandResult (com.emc.storageos.volumecontroller.impl.BiosCommandResult)135 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)76 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)69 ControllerException (com.emc.storageos.volumecontroller.ControllerException)64 NetAppException (com.emc.storageos.netapp.NetAppException)34 ArrayList (java.util.ArrayList)34 NetworkDeviceControllerException (com.emc.storageos.networkcontroller.exceptions.NetworkDeviceControllerException)28 NetAppCException (com.emc.storageos.netappc.NetAppCException)19 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)18 NetAppApi (com.emc.storageos.netapp.NetAppApi)18 NetAppClusterApi (com.emc.storageos.netappc.NetAppClusterApi)18 URI (java.net.URI)16 VNXException (com.emc.storageos.vnx.xmlapi.VNXException)15 XMLApiResult (com.emc.storageos.vnx.xmlapi.XMLApiResult)15 VNXFileCommApi (com.emc.storageos.volumecontroller.impl.plugins.provisioning.VNXFileCommApi)15 ApplicationContext (org.springframework.context.ApplicationContext)15 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)15 FileShare (com.emc.storageos.db.client.model.FileShare)14 SMBFileShare (com.emc.storageos.db.client.model.SMBFileShare)14 NetworkSystem (com.emc.storageos.db.client.model.NetworkSystem)11