use of com.emc.storageos.driver.dellsc.scapi.objects.ScPhysicalServer 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;
}
Aggregations