Search in sources :

Example 1 with AutoExtend

use of com.emc.nas.vnxfile.xmlapi.ModifyFileSystem.AutoExtend in project coprhd-controller by CoprHD.

the class VNXFileArgsCreator method doModifyFS.

public InputStream doModifyFS(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("ArgsCreator: VNX File Modify");
    InputStream iStream = null;
    try {
        // Verify that the prior command executed properly.
        verifyPreviousResults(keyMap);
        Task task = new Task();
        ModifyFileSystem modifyFS = new ModifyFileSystem();
        FileSystem fsSystem = (FileSystem) keyMap.get(VNXFileConstants.FILESYSTEM);
        String fsName = (String) keyMap.get(VNXFileConstants.FILESYSTEM_NAME);
        String fsId = (String) keyMap.get(VNXFileConstants.FILESYSTEM_ID);
        Long size = (Long) keyMap.get(VNXFileConstants.FILESYSTEM_SIZE);
        Boolean isVirtualProvisioning = (Boolean) keyMap.get(VNXFileConstants.FILESYSTEM_VIRTUAL_PROVISIONING);
        if (null == fsSystem || isInValid(fsName) || isInValid(fsId) || null == size) {
            throw new VNXFilePluginException("Prior command did not execute successfully", VNXFilePluginException.ERRORCODE_ILLEGALARGUMENTEXCEPTION);
        }
        modifyFS.setVirtualProvisioning(isVirtualProvisioning);
        if (isVirtualProvisioning) {
            AutoExtend autoExtend = new AutoExtend();
            autoExtend.setHighWaterMark(EXT_HW_MARK);
            autoExtend.setAutoExtensionMaxSize(size);
            modifyFS.setAutoExtend(autoExtend);
        }
        _logger.info("Modifying File system max size : {}, name {}", size, fsName);
        modifyFS.setFileSystem(fsSystem.getFileSystem());
        task.setModifyFileSystem(modifyFS);
        iStream = _vnxFileInputRequestBuilder.getTaskParamPacket(task, true);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while fetching fileSystem info", jaxbException.getCause());
    }
    return iStream;
}
Also used : AutoExtend(com.emc.nas.vnxfile.xmlapi.ModifyFileSystem.AutoExtend) Task(com.emc.nas.vnxfile.xmlapi.Task) InputStream(java.io.InputStream) ModifyFileSystem(com.emc.nas.vnxfile.xmlapi.ModifyFileSystem) ExtendFileSystem(com.emc.nas.vnxfile.xmlapi.ExtendFileSystem) DeleteFileSystem(com.emc.nas.vnxfile.xmlapi.DeleteFileSystem) NewFileSystem(com.emc.nas.vnxfile.xmlapi.NewFileSystem) FileSystem(com.emc.nas.vnxfile.xmlapi.FileSystem) JAXBException(javax.xml.bind.JAXBException) ModifyFileSystem(com.emc.nas.vnxfile.xmlapi.ModifyFileSystem)

Aggregations

DeleteFileSystem (com.emc.nas.vnxfile.xmlapi.DeleteFileSystem)1 ExtendFileSystem (com.emc.nas.vnxfile.xmlapi.ExtendFileSystem)1 FileSystem (com.emc.nas.vnxfile.xmlapi.FileSystem)1 ModifyFileSystem (com.emc.nas.vnxfile.xmlapi.ModifyFileSystem)1 AutoExtend (com.emc.nas.vnxfile.xmlapi.ModifyFileSystem.AutoExtend)1 NewFileSystem (com.emc.nas.vnxfile.xmlapi.NewFileSystem)1 Task (com.emc.nas.vnxfile.xmlapi.Task)1 InputStream (java.io.InputStream)1 JAXBException (javax.xml.bind.JAXBException)1