use of com.emc.cloud.platform.ucs.in.model.LsbootSanImage 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;
}
use of com.emc.cloud.platform.ucs.in.model.LsbootSanImage in project coprhd-controller by CoprHD.
the class UCSMServiceImpl method createLsbootStorage.
private LsbootStorage createLsbootStorage(String spDn, Map<String, Map<String, Integer>> hbaToStoragePortMap, LsServer lsServer) throws ClientGeneralException {
Map<String, String> hbaToSwitchIdMap = getHBAToSwitchIdMap(lsServer);
LsbootStorage lsbootStorage = new LsbootStorage();
lsbootStorage.setOrder("1");
lsbootStorage.setRn("storage");
for (String hba : hbaToStoragePortMap.keySet()) {
Map<String, Integer> ports = hbaToStoragePortMap.get(hba);
LsbootSanImage lsbootSanImage = createLsbootSanImage(ports, hba, hbaToSwitchIdMap);
lsbootStorage.getContent().add(factory.createLsbootSanImage(lsbootSanImage));
}
return lsbootStorage;
}
Aggregations