use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method listSVM.
public List<StorageVirtualMachineInfo> listSVM() {
List<StorageVirtualMachineInfo> svms = null;
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https);
svms = netAppClusterFacade.listSVM();
} catch (Exception e) {
_logger.info("No vSevrers discovered.");
}
return svms;
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method createQtree.
// New QTree methods
public void createQtree(String qtreeName, String volumeName, Boolean opLocks, String securityStyle, Long size, String vfilerName) throws NetAppCException {
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
netAppClusterFacade.createQtree(qtreeName, volumeName, opLocks, securityStyle);
String qtreePath = constructQtreePath(volumeName, qtreeName);
// Set the size - Quota
if (size > 0) {
netAppClusterFacade.addDiskLimitTreeQuota(volumeName, qtreePath, size / SIZE_KB, 0);
// especially, when we create quota on multi-store environment.
try {
QuotaStatus quotaStatus = netAppClusterFacade.getQuotaStatus(volumeName);
if (quotaStatus.OFF == quotaStatus) {
netAppClusterFacade.turnQuotaOn(volumeName);
} else {
// Resizing only works for certain types of changes to the quotas file.
// For other changes, you need to reinitialize quotas.
netAppClusterFacade.reintializeQuota(volumeName);
}
_logger.info("Quota status on volume {} is {}. ", volumeName, quotaStatus.toString());
} catch (Exception e) {
_logger.warn("Quota status on volume {} is not stable. ", volumeName);
}
}
} catch (Exception e) {
_logger.info("NetAppClusterApi::createQtree -> e.getMessage() = {}", e.getMessage());
throw NetAppCException.exceptions.createQtreeFailed(qtreeName, e.getMessage());
}
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method modifyShare.
public void modifyShare(String shareName, Map<String, String> attrs) throws NetAppCException {
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
netAppClusterFacade.changeCIFSShare(shareName, attrs);
} catch (Exception e) {
throw NetAppCException.exceptions.modifyShareNameFailed(shareName, _ipAddress, e.getMessage());
}
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method createVolume.
public Boolean createVolume(String volName, String aggregate, String path, String size, Boolean isThin) {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
String spaceReserve = "";
if (isThin) {
spaceReserve = "none";
}
Boolean status = netAppClusterFacade.createFlexibleVolume(volName, aggregate, path, size, spaceReserve, VOL_PERMISSION);
if (status) {
Collection<String> attrs = new ArrayList<String>();
attrs.add(VOL_ATTR_NAME);
for (int i = 0; i <= 3; i++) {
List<Map<String, String>> fileSystemCharacterics = netAppClusterFacade.listVolumeInfo(volName, attrs);
Map<String, String> fileSystemChar = fileSystemCharacterics.get(0);
String fsName = fileSystemChar.get(VOL_ATTR_RESULT_NAME);
if (volName.equals(fsName)) {
_logger.info("FS {} has been created successfully on the array", fsName);
status = true;
break;
} else {
_logger.info("FS not seen on the array yet, check back in few seconds");
status = false;
try {
Thread.sleep(3);
} catch (InterruptedException e) {
_logger.info("Failed to sleep after FS creation");
}
continue;
}
}
} else {
_logger.info("FS creation failed");
status = false;
}
return status;
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method setVolumeSize.
public Boolean setVolumeSize(String volume, String newSize) throws NetAppCException {
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
String cmdResult = netAppClusterFacade.setVolumeSize(volume, newSize);
// Return value is a empty string if the operation is not success
if (cmdResult == null || cmdResult.equalsIgnoreCase("")) {
return false;
} else {
return true;
}
} catch (Exception e) {
throw NetAppCException.exceptions.setVolumeSizeFailed(volume, newSize);
}
}
Aggregations