Search in sources :

Example 1 with LsbootSanImagePath

use of com.emc.cloud.platform.ucs.in.model.LsbootSanImagePath in project coprhd-controller by CoprHD.

the class UCSMServiceImpl method createLsbootSanImage.

private LsbootSanImage createLsbootSanImage(Map<String, Integer> ports, String hba, Map<String, String> hbaToSwitchIdMap) throws ClientGeneralException {
    LsbootSanImage lsbootSanImage = new LsbootSanImage();
    if (SwitchId.A.name().equals(hbaToSwitchIdMap.get(hba))) {
        lsbootSanImage.setRn("san-primary");
        lsbootSanImage.setType("primary");
        lsbootSanImage.setVnicName(hba);
    } else if (SwitchId.B.name().equals(hbaToSwitchIdMap.get(hba))) {
        lsbootSanImage.setRn("san-secondary");
        lsbootSanImage.setType("secondary");
        lsbootSanImage.setVnicName(hba);
    }
    if (ports != null && ports.size() > 0) {
        Iterator<String> portIterator = ports.keySet().iterator();
        if (portIterator.hasNext()) {
            String port = portIterator.next();
            LsbootSanImagePath lsbootSanImagePath = createLsbootSanImagePath(SanImagePathType.primary, port, ports.get(port));
            lsbootSanImage.getContent().add(factory.createLsbootSanImagePath(lsbootSanImagePath));
        }
        if (portIterator.hasNext()) {
            String port = portIterator.next();
            LsbootSanImagePath lsbootSanImagePath = createLsbootSanImagePath(SanImagePathType.secondary, port, ports.get(port));
            lsbootSanImage.getContent().add(factory.createLsbootSanImagePath(lsbootSanImagePath));
        }
    } else {
        log.error("Unable to determine array targets for initiator {}", hba);
        String[] s = { "Unable to determine array targets for initiator " + hba };
        throw new ClientGeneralException(ClientMessageKeys.UNEXPECTED_FAILURE, s);
    }
    return lsbootSanImage;
}
Also used : LsbootSanImagePath(com.emc.cloud.platform.ucs.in.model.LsbootSanImagePath) LsbootSanImage(com.emc.cloud.platform.ucs.in.model.LsbootSanImage) ClientGeneralException(com.emc.cloud.platform.clientlib.ClientGeneralException)

Example 2 with LsbootSanImagePath

use of com.emc.cloud.platform.ucs.in.model.LsbootSanImagePath in project coprhd-controller by CoprHD.

the class UCSMServiceImpl method createLsbootSanImagePath.

private LsbootSanImagePath createLsbootSanImagePath(SanImagePathType sanImagePathType, String storagePort, Integer hlu) {
    LsbootSanImagePath lsbootSanImagePath = new LsbootSanImagePath();
    lsbootSanImagePath.setRn("path-" + sanImagePathType.name());
    lsbootSanImagePath.setType(sanImagePathType.name());
    lsbootSanImagePath.setLun(hlu.longValue());
    lsbootSanImagePath.setWwn(storagePort);
    return lsbootSanImagePath;
}
Also used : LsbootSanImagePath(com.emc.cloud.platform.ucs.in.model.LsbootSanImagePath)

Aggregations

LsbootSanImagePath (com.emc.cloud.platform.ucs.in.model.LsbootSanImagePath)2 ClientGeneralException (com.emc.cloud.platform.clientlib.ClientGeneralException)1 LsbootSanImage (com.emc.cloud.platform.ucs.in.model.LsbootSanImage)1