Search in sources :

Example 1 with GetBlockVirtualPool

use of com.emc.sa.service.vipr.block.tasks.GetBlockVirtualPool in project coprhd-controller by CoprHD.

the class BlockStorageUtils method isVMAXUsePortGroupEnabled.

public static boolean isVMAXUsePortGroupEnabled(URI resourceId) {
    SimpleValueRep value = execute(new GetVMAXUsePortGroupEnabledConfig());
    if (value.getValue().equalsIgnoreCase("true")) {
        if (ResourceType.isType(ResourceType.VOLUME, resourceId)) {
            BlockObjectRestRep obj = getVolume(resourceId);
            if (obj instanceof VolumeRestRep) {
                VolumeRestRep volume = (VolumeRestRep) obj;
                boolean isVMAX = StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax3.name());
                boolean isRPOrVPlex = isVplexOrRPVolume(volume);
                if (isVMAX && !isRPOrVPlex) {
                    return true;
                }
            }
            if (obj instanceof BlockSnapshotRestRep) {
                BlockSnapshotRestRep snapshot = (BlockSnapshotRestRep) obj;
                BlockObjectRestRep parent = getVolume(snapshot.getParent().getId());
                if (parent instanceof VolumeRestRep) {
                    VolumeRestRep volume = (VolumeRestRep) obj;
                    if (StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax3.name())) {
                        return true;
                    }
                }
                if (parent instanceof BlockMirrorRestRep) {
                    BlockMirrorRestRep mirror = (BlockMirrorRestRep) obj;
                    if (StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax3.name())) {
                        return true;
                    }
                }
            }
            if (obj instanceof BlockMirrorRestRep) {
                BlockMirrorRestRep mirror = (BlockMirrorRestRep) obj;
                if (StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax3.name())) {
                    return true;
                }
            }
        }
        if (ResourceType.isType(ResourceType.VIRTUAL_POOL, resourceId)) {
            BlockVirtualPoolRestRep virtualPool = execute(new GetBlockVirtualPool(resourceId));
            boolean isVMAX = StringUtils.equalsIgnoreCase(virtualPool.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(virtualPool.getSystemType(), DiscoveredDataObject.Type.vmax3.name());
            boolean isVPLEX = virtualPool.getHighAvailability() != null;
            if (isVMAX && !isVPLEX) {
                return true;
            }
        }
    }
    return false;
}
Also used : SimpleValueRep(com.emc.storageos.model.customconfig.SimpleValueRep) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) BlockMirrorRestRep(com.emc.storageos.model.block.BlockMirrorRestRep) GetBlockVirtualPool(com.emc.sa.service.vipr.block.tasks.GetBlockVirtualPool) BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) GetVMAXUsePortGroupEnabledConfig(com.emc.sa.service.vipr.block.tasks.GetVMAXUsePortGroupEnabledConfig) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep)

Aggregations

GetBlockVirtualPool (com.emc.sa.service.vipr.block.tasks.GetBlockVirtualPool)1 GetVMAXUsePortGroupEnabledConfig (com.emc.sa.service.vipr.block.tasks.GetVMAXUsePortGroupEnabledConfig)1 BlockMirrorRestRep (com.emc.storageos.model.block.BlockMirrorRestRep)1 BlockObjectRestRep (com.emc.storageos.model.block.BlockObjectRestRep)1 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)1 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)1 SimpleValueRep (com.emc.storageos.model.customconfig.SimpleValueRep)1 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)1