Search in sources :

Example 1 with LsbootSanCatSanImagePath

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

the class UCSMServiceImpl method createLsbootSanCatSanImagePath.

private LsbootSanCatSanImagePath createLsbootSanCatSanImagePath(SanImagePathType sanImagePathType, String storagePort, Integer hlu) {
    LsbootSanCatSanImagePath lsbootSanCatSanImagePath = new LsbootSanCatSanImagePath();
    lsbootSanCatSanImagePath.setRn("sanimgpath-" + sanImagePathType.toString());
    lsbootSanCatSanImagePath.setType(sanImagePathType.toString());
    lsbootSanCatSanImagePath.setLun(hlu.longValue());
    lsbootSanCatSanImagePath.setWwn(storagePort);
    return lsbootSanCatSanImagePath;
}
Also used : LsbootSanCatSanImagePath(com.emc.cloud.platform.ucs.in.model.LsbootSanCatSanImagePath)

Example 2 with LsbootSanCatSanImagePath

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

the class UCSMServiceImpl method createLsbootSanCatSanImage.

private LsbootSanCatSanImage createLsbootSanCatSanImage(Map<String, Integer> ports, String hba, Map<String, String> hbaToSwitchIdMap) throws ClientGeneralException {
    LsbootSanCatSanImage lsbootSanCatSanImage = new LsbootSanCatSanImage();
    lsbootSanCatSanImage.setType(BootType.SAN.toString().toLowerCase());
    if (SwitchId.A.name().equals(hbaToSwitchIdMap.get(hba))) {
        lsbootSanCatSanImage.setRn("sanimg-" + SanImagePathType.primary.toString());
        lsbootSanCatSanImage.setType(SanImagePathType.primary.toString());
        lsbootSanCatSanImage.setVnicName(hba);
    } else if (SwitchId.B.name().equals(hbaToSwitchIdMap.get(hba))) {
        lsbootSanCatSanImage.setRn("sanimg-" + SanImagePathType.secondary.toString());
        lsbootSanCatSanImage.setType(SanImagePathType.secondary.toString());
        lsbootSanCatSanImage.setVnicName(hba);
    } else {
        log.error("Unable to determine fabric A or B for initiator {}", hba);
        String[] s = { "Unable to determine fabric A or B for initiator " + hba };
        throw new ClientGeneralException(ClientMessageKeys.UNEXPECTED_FAILURE, s);
    }
    if (ports != null && ports.size() > 0) {
        Iterator<String> portIterator = ports.keySet().iterator();
        if (portIterator.hasNext()) {
            String port = portIterator.next();
            LsbootSanCatSanImagePath lsbootSanImagePath = createLsbootSanCatSanImagePath(SanImagePathType.primary, port, ports.get(port));
            lsbootSanCatSanImage.getContent().add(factory.createLsbootSanCatSanImagePath(lsbootSanImagePath));
        }
        if (portIterator.hasNext()) {
            String port = portIterator.next();
            LsbootSanCatSanImagePath lsbootSanImagePath = createLsbootSanCatSanImagePath(SanImagePathType.secondary, port, ports.get(port));
            lsbootSanCatSanImage.getContent().add(factory.createLsbootSanCatSanImagePath(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 lsbootSanCatSanImage;
}
Also used : LsbootSanCatSanImage(com.emc.cloud.platform.ucs.in.model.LsbootSanCatSanImage) LsbootSanCatSanImagePath(com.emc.cloud.platform.ucs.in.model.LsbootSanCatSanImagePath) ClientGeneralException(com.emc.cloud.platform.clientlib.ClientGeneralException)

Aggregations

LsbootSanCatSanImagePath (com.emc.cloud.platform.ucs.in.model.LsbootSanCatSanImagePath)2 ClientGeneralException (com.emc.cloud.platform.clientlib.ClientGeneralException)1 LsbootSanCatSanImage (com.emc.cloud.platform.ucs.in.model.LsbootSanCatSanImage)1