Search in sources :

Example 1 with Protocol

use of com.emc.storageos.storagedriver.model.Initiator.Protocol in project coprhd-controller by CoprHD.

the class DellSCProvisioning method getInitiatorInfo.

/**
 * Gets Initiator details from servers and ports.
 *
 * @param api The Storage Center API connection.
 * @param server The ScServer.
 * @param hba The server HBA.
 * @return The initiator.
 */
private Initiator getInitiatorInfo(StorageCenterAPI api, ScServer server, ScServerHba hba) {
    Initiator result = new Initiator();
    ScServer cluster = null;
    if (server.type.contains("Physical")) {
        ScPhysicalServer physicalServer = api.getPhysicalServerDefinition(server.instanceId);
        if (physicalServer != null && physicalServer.parent != null && physicalServer.parent.instanceId != null) {
            cluster = api.getServerDefinition(physicalServer.parent.instanceId);
        }
    }
    result.setHostName(server.name);
    result.setInitiatorType(Type.Host);
    if (cluster != null) {
        result.setClusterName(cluster.name);
        result.setInitiatorType(Type.Cluster);
    }
    result.setNativeId(hba.instanceId);
    result.setPort(hba.instanceId);
    Protocol protocol = Protocol.iSCSI;
    if ("FibreChannel".equals(hba.portType)) {
        protocol = Protocol.FC;
    }
    result.setProtocol(protocol);
    return result;
}
Also used : ScServer(com.emc.storageos.driver.dellsc.scapi.objects.ScServer) Initiator(com.emc.storageos.storagedriver.model.Initiator) ScPhysicalServer(com.emc.storageos.driver.dellsc.scapi.objects.ScPhysicalServer) Protocol(com.emc.storageos.storagedriver.model.Initiator.Protocol)

Aggregations

ScPhysicalServer (com.emc.storageos.driver.dellsc.scapi.objects.ScPhysicalServer)1 ScServer (com.emc.storageos.driver.dellsc.scapi.objects.ScServer)1 Initiator (com.emc.storageos.storagedriver.model.Initiator)1 Protocol (com.emc.storageos.storagedriver.model.Initiator.Protocol)1