Search in sources :

Example 21 with VNXeHostInitiator

use of com.emc.storageos.vnxe.models.VNXeHostInitiator in project coprhd-controller by CoprHD.

the class VNXUnityArrayAffinityDiscoverer method findHostURI.

/**
 * Find host URI from host initiators on array
 *
 * @param initiators
 * @param apiClient
 * @param dbClient
 * @return host URI or null
 */
private URI findHostURI(List<VNXeBase> initiators, VNXeApiClient apiClient, DbClient dbClient) {
    if (initiators != null && !initiators.isEmpty()) {
        for (VNXeBase init : initiators) {
            VNXeHostInitiator vnxeInitiator = apiClient.getHostInitiator(init.getId());
            String portwwn = vnxeInitiator.getPortWWN();
            if (HostInitiatorTypeEnum.INITIATOR_TYPE_ISCSI.equals(vnxeInitiator.getType())) {
                portwwn = vnxeInitiator.getInitiatorId();
            }
            if (portwwn == null || portwwn.isEmpty()) {
                continue;
            }
            Initiator initiator = NetworkUtil.getInitiator(portwwn, dbClient);
            if (initiator != null && !initiator.getInactive()) {
                URI hostURI = initiator.getHost();
                if (!NullColumnValueGetter.isNullURI(hostURI)) {
                    return hostURI;
                }
            }
        }
    }
    return null;
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) Initiator(com.emc.storageos.db.client.model.Initiator) VNXeHostInitiator(com.emc.storageos.vnxe.models.VNXeHostInitiator) VNXeHostInitiator(com.emc.storageos.vnxe.models.VNXeHostInitiator) URI(java.net.URI)

Example 22 with VNXeHostInitiator

use of com.emc.storageos.vnxe.models.VNXeHostInitiator in project coprhd-controller by CoprHD.

the class ApiClientTest method getHostInitiator.

// @Test
public void getHostInitiator() {
    HostInitiatorRequest req = new HostInitiatorRequest(_client);
    VNXeHostInitiator res = req.get("HostInitiator_4");
    System.out.println(res.getPortWWN());
    System.out.println(res.getNodeWWN());
}
Also used : VNXeHostInitiator(com.emc.storageos.vnxe.models.VNXeHostInitiator)

Aggregations

VNXeHostInitiator (com.emc.storageos.vnxe.models.VNXeHostInitiator)22 Initiator (com.emc.storageos.db.client.model.Initiator)13 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)11 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)9 URI (java.net.URI)9 ArrayList (java.util.ArrayList)8 HashSet (java.util.HashSet)8 ExportMask (com.emc.storageos.db.client.model.ExportMask)7 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)7 VNXeException (com.emc.storageos.vnxe.VNXeException)6 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)5 ExportOperationContext (com.emc.storageos.volumecontroller.impl.utils.ExportOperationContext)5 VNXeHost (com.emc.storageos.vnxe.models.VNXeHost)4 HashMap (java.util.HashMap)4 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)3 BlockObject (com.emc.storageos.db.client.model.BlockObject)3 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)3 StringSet (com.emc.storageos.db.client.model.StringSet)3 HostLun (com.emc.storageos.vnxe.models.HostLun)3 VNXeExportResult (com.emc.storageos.vnxe.models.VNXeExportResult)3