use of com.emc.storageos.plugins.metering.isilon.IsilonCollectionException in project coprhd-controller by CoprHD.
the class IsilonFileStorageDevice method doesSnapshotExistsForFSPath.
private boolean doesSnapshotExistsForFSPath(StorageSystem storageSystem, String isilonAccessZone, String path) throws IsilonCollectionException {
URI storageSystemId = storageSystem.getId();
String resumeToken = null;
try {
_log.info("Checking snapshots for path {} on Isilon storage system: {} in access zone {} - start", path, storageSystem.getLabel(), isilonAccessZone);
IsilonApi isilonApi = getIsilonDevice(storageSystem);
do {
IsilonList<IsilonSnapshot> isilonSnapshots = isilonApi.listSnapshots(resumeToken, path);
List<IsilonSnapshot> snpashots = isilonSnapshots.getList();
for (IsilonSnapshot snapshot : snpashots) {
if (snapshot.getPath() == null || snapshot.getPath().isEmpty()) {
_log.info("Ignoring snapshot {} as it is not having any path", snapshot);
continue;
}
if (snapshot.getPath().equals(path)) {
_log.info("Found snapshot on path {} in Ision: {}", path, storageSystem.getLabel());
return true;
}
}
resumeToken = isilonSnapshots.getToken();
} while (resumeToken != null);
_log.info("Snapshots not found with path {} on Ision: {} in access zone: {}", path, storageSystem.getLabel(), isilonAccessZone);
return false;
} catch (IsilonException ie) {
_log.error("doesSnapshotExistsForFSPath failed. Storage system: {}", storageSystemId, ie);
IsilonCollectionException ice = new IsilonCollectionException("doesSnapshotExistsForFSPath failed. Storage system: " + storageSystemId);
ice.initCause(ie);
throw ice;
} catch (Exception e) {
_log.error("doesSnapshotExistsForFSPath failed. Storage system: {}", storageSystemId, e);
IsilonCollectionException ice = new IsilonCollectionException("doesSnapshotExistsForFSPath failed. Storage system: " + storageSystemId);
ice.initCause(e);
throw ice;
}
}
use of com.emc.storageos.plugins.metering.isilon.IsilonCollectionException in project coprhd-controller by CoprHD.
the class IsilonFileStorageDevice method doesCIFSShareExistsForFSPath.
private boolean doesCIFSShareExistsForFSPath(final StorageSystem storageSystem, String isilonAccessZone, String path) {
String resumeToken = null;
URI storageSystemId = storageSystem.getId();
_log.info("Checking CIFS share for path {} on Isilon storage system: {} in access zone {} - start", path, storageSystem.getLabel(), isilonAccessZone);
try {
IsilonApi isilonApi = getIsilonDevice(storageSystem);
do {
IsilonApi.IsilonList<IsilonSMBShare> isilonShares = isilonApi.listShares(resumeToken, isilonAccessZone);
List<IsilonSMBShare> isilonSMBShareList = isilonShares.getList();
for (IsilonSMBShare share : isilonSMBShareList) {
if (share.getPath().equals(path)) {
_log.info("Found CIFS share with path {} and name {} on Ision: {} in access zone: {}", path, share.getName(), storageSystem.getLabel(), isilonAccessZone);
return true;
}
}
resumeToken = isilonShares.getToken();
} while (resumeToken != null);
_log.info("CIFS share not found with path {} on Ision: {} in access zone: {}", path, storageSystem.getLabel(), isilonAccessZone);
return false;
} catch (IsilonException ie) {
_log.error("doesCIFSShareExistForFSPath failed. Storage system: {}", storageSystemId, ie);
IsilonCollectionException ice = new IsilonCollectionException("doesCIFSShareExistForFSPath failed. Storage system: " + storageSystemId);
ice.initCause(ie);
throw ice;
} catch (Exception e) {
_log.error("doesCIFSShareExistForFSPath failed. Storage system: {}", storageSystemId, e);
IsilonCollectionException ice = new IsilonCollectionException("doesCIFSShareExistForFSPath failed. Storage system: " + storageSystemId);
ice.initCause(e);
throw ice;
}
}
use of com.emc.storageos.plugins.metering.isilon.IsilonCollectionException in project coprhd-controller by CoprHD.
the class IsilonFileStorageDevice method doesNFSExportExistsForFSPath.
private boolean doesNFSExportExistsForFSPath(StorageSystem storageSystem, String isilonAccessZone, String path) throws IsilonCollectionException {
URI storageSystemId = storageSystem.getId();
String resumeToken = null;
try {
_log.info("Checking NFS export for path {} on Isilon storage system: {} in access zone {} - start", path, storageSystem.getLabel(), isilonAccessZone);
IsilonApi isilonApi = getIsilonDevice(storageSystem);
do {
IsilonApi.IsilonList<IsilonExport> isilonExports = isilonApi.listExports(resumeToken, isilonAccessZone);
List<IsilonExport> exports = isilonExports.getList();
for (IsilonExport exp : exports) {
if (exp.getPaths() == null || exp.getPaths().isEmpty()) {
_log.info("Ignoring export {} as it is not having any path", exp);
continue;
}
// Ignore Export with multiple paths
if (exp.getPaths().size() > 1) {
_log.info("Isilon Export: {} has multiple paths. So ingnore it.", exp);
continue;
}
String exportPath = exp.getPaths().get(0);
if (exportPath.equals(path)) {
_log.info("Found NFS export with path {} on Ision: {} in access zone: {}", path, storageSystem.getLabel(), isilonAccessZone);
return true;
}
}
resumeToken = isilonExports.getToken();
} while (resumeToken != null);
_log.info("NFS export not found with path {} on Ision: {} in access zone: {}", path, storageSystem.getLabel(), isilonAccessZone);
return false;
} catch (IsilonException ie) {
_log.error("doesNFSExportExistsForFSPath failed. Storage system: {}", storageSystemId, ie);
IsilonCollectionException ice = new IsilonCollectionException("doesNFSExportExistsForFSPath failed. Storage system: " + storageSystemId);
ice.initCause(ie);
throw ice;
} catch (Exception e) {
_log.error("doesNFSExportExistsForFSPath failed. Storage system: {}", storageSystemId, e);
IsilonCollectionException ice = new IsilonCollectionException("doesNFSExportExistsForFSPath failed. Storage system: " + storageSystemId);
ice.initCause(e);
throw ice;
}
}
use of com.emc.storageos.plugins.metering.isilon.IsilonCollectionException in project coprhd-controller by CoprHD.
the class IsilonCommunicationInterface method discoverAccessZoneSMBShares.
/**
* Get all SMB shares of storagesystem
*
* @param storageSystem
* @return
*/
private HashMap<String, HashSet<String>> discoverAccessZoneSMBShares(final StorageSystem storageSystem, String isilonAccessZone) {
// Discover All FileShares
String resumeToken = null;
HashMap<String, HashSet<String>> allShares = new HashMap<String, HashSet<String>>();
URI storageSystemId = storageSystem.getId();
_log.info("discoverAllShares for storage system {} - start", storageSystemId);
try {
IsilonApi isilonApi = getIsilonDevice(storageSystem);
do {
IsilonApi.IsilonList<IsilonSMBShare> isilonShares = isilonApi.listShares(resumeToken, isilonAccessZone);
List<IsilonSMBShare> isilonSMBShareList = isilonShares.getList();
HashSet<String> sharesHashSet = null;
for (IsilonSMBShare share : isilonSMBShareList) {
// get the filesystem path and shareid
String path = share.getPath();
String shareId = share.getId();
sharesHashSet = allShares.get(path);
if (null == sharesHashSet) {
sharesHashSet = new HashSet<String>();
sharesHashSet.add(shareId);
allShares.put(path, sharesHashSet);
} else {
// if shares already exist for path then add
sharesHashSet.add(shareId);
allShares.put(path, sharesHashSet);
}
_log.info("Discovered SMB Share name {} and path {}", shareId, path);
}
resumeToken = isilonShares.getToken();
} while (resumeToken != null);
_log.info("discoverd AllShares for access zone {} ", isilonAccessZone);
return allShares;
} catch (IsilonException ie) {
_log.error("discoverAllShares failed. Storage system: {}", storageSystemId, ie);
IsilonCollectionException ice = new IsilonCollectionException("discoverAllShares failed. Storage system: " + storageSystemId);
ice.initCause(ie);
throw ice;
} catch (Exception e) {
_log.error("discoverAllShares failed. Storage system: {}", storageSystemId, e);
IsilonCollectionException ice = new IsilonCollectionException("discoverAllShares failed. Storage system: " + storageSystemId);
ice.initCause(e);
throw ice;
}
}
use of com.emc.storageos.plugins.metering.isilon.IsilonCollectionException in project coprhd-controller by CoprHD.
the class IsilonCommunicationInterface method discoverCluster.
private void discoverCluster(StorageSystem storageSystem) throws IsilonCollectionException {
URI storageSystemId = storageSystem.getId();
try {
_log.info("discoverCluster information for storage system {} - start", storageSystemId);
IsilonApi isilonApi = getIsilonDevice(storageSystem);
IsilonClusterConfig clusterConfig = isilonApi.getClusterConfig();
storageSystem.setSerialNumber(clusterConfig.getGuid());
String nativeGuid = NativeGUIDGenerator.generateNativeGuid(DiscoveredDataObject.Type.isilon.toString(), clusterConfig.getGuid());
storageSystem.setNativeGuid(nativeGuid);
String clusterReleaseVersion = clusterConfig.getOnefs_version_info().getReleaseVersionNumber();
storageSystem.setFirmwareVersion(clusterReleaseVersion);
String minimumSupportedVersion = VersionChecker.getMinimumSupportedVersion(Type.valueOf(storageSystem.getSystemType()));
_log.info("Verifying version details : Minimum Supported Version {} - Discovered Cluster Version {}", minimumSupportedVersion, clusterReleaseVersion);
if (VersionChecker.verifyVersionDetails(minimumSupportedVersion, clusterReleaseVersion) < 0) {
storageSystem.setCompatibilityStatus(DiscoveredDataObject.CompatibilityStatus.INCOMPATIBLE.name());
storageSystem.setReachableStatus(false);
DiscoveryUtils.setSystemResourcesIncompatible(_dbClient, _coordinator, storageSystem.getId());
IsilonCollectionException ice = new IsilonCollectionException(String.format(" ** This version of Isilon firmware is not supported ** Should be a minimum of %s", minimumSupportedVersion));
throw ice;
}
storageSystem.setSupportSoftLimit(false);
storageSystem.setSupportNotificationLimit(false);
// Check license status for smart quota and set the support attributes as true
if (ACTIVATED.equalsIgnoreCase(isilonApi.getLicenseInfo(IsilonLicenseType.SMARTQUOTA)) || EVALUATION.equalsIgnoreCase(isilonApi.getLicenseInfo(IsilonLicenseType.SMARTQUOTA))) {
storageSystem.setSupportSoftLimit(true);
storageSystem.setSupportNotificationLimit(true);
}
storageSystem.setCompatibilityStatus(DiscoveredDataObject.CompatibilityStatus.COMPATIBLE.name());
storageSystem.setReachableStatus(true);
_log.info("discoverCluster information for storage system {} - complete", storageSystemId);
} catch (Exception e) {
storageSystem.setReachableStatus(false);
String errMsg = String.format("discoverCluster failed. %s", e.getMessage());
_log.error(errMsg, e);
IsilonCollectionException ice = new IsilonCollectionException(errMsg);
throw ice;
}
}
Aggregations