use of com.emc.storageos.model.compute.OsInstallParam in project coprhd-controller by CoprHD.
the class AddHostToClusterService method installOSForHosts.
private void installOSForHosts(Map<String, String> hostToIps, Map<String, URI> hostNameToBootVolumeMap, List<Host> createdHosts) {
Map<Host, OsInstallParam> osInstallParamMap = new HashMap<Host, OsInstallParam>();
for (Host host : createdHosts) {
if ((host != null) && ((host.getType() == null) || host.getType().isEmpty() || host.getType().equals(Host.HostType.No_OS.name()))) {
OsInstallParam param = new OsInstallParam();
String hostIp = hostToIps.get(host.getHostName());
param.setComputeImage(computeImage);
param.setHostName(host.getHostName());
param.setDnsServers(dnsServers);
param.setGateway(gateway);
param.setNetmask(netmask);
param.setHostIp(hostIp);
param.setVolume(hostNameToBootVolumeMap.get(host.getHostName()));
param.setManagementNetwork(managementNetwork);
param.setNtpServer(ntpServer);
param.setRootPassword(rootPassword);
osInstallParamMap.put(host, param);
} else {
osInstallParamMap.put(host, null);
}
}
try {
// Attempt an OS Install only on the list of hosts that are a part of the order
// This does check if the hosts already have a OS before attempting the install
ComputeUtils.installOsOnHosts(osInstallParamMap);
} catch (Exception e) {
logError(e.getMessage());
}
}
use of com.emc.storageos.model.compute.OsInstallParam in project coprhd-controller by CoprHD.
the class CreateComputeClusterService method installOSForHosts.
private void installOSForHosts(Map<String, String> hostToIps, Map<String, URI> hostNameToBootVolumeMap, List<Host> createdHosts) {
Map<Host, OsInstallParam> osInstallParamMap = new HashMap<Host, OsInstallParam>();
for (Host host : createdHosts) {
if ((host != null) && ((host.getType() == null) || host.getType().isEmpty() || host.getType().equals(Host.HostType.No_OS.name()))) {
OsInstallParam param = new OsInstallParam();
String hostIp = hostToIps.get(host.getHostName());
param.setComputeImage(computeImage);
param.setHostName(host.getHostName());
param.setDnsServers(dnsServers);
param.setGateway(gateway);
param.setNetmask(netmask);
param.setHostIp(hostIp);
param.setVolume(hostNameToBootVolumeMap.get(host.getHostName()));
param.setManagementNetwork(managementNetwork);
param.setNtpServer(ntpServer);
param.setRootPassword(rootPassword);
osInstallParamMap.put(host, param);
} else {
osInstallParamMap.put(host, null);
}
}
try {
ComputeUtils.installOsOnHosts(osInstallParamMap);
} catch (Exception e) {
logError(e.getMessage());
}
}
use of com.emc.storageos.model.compute.OsInstallParam in project coprhd-controller by CoprHD.
the class InstallOsHelper method installOs.
public void installOs() {
ExecutionContext context = ExecutionUtils.currentContext();
List<ViPRTaskMonitor<HostRestRep>> tasks = new ArrayList<>();
for (HostRestRep host : hostToOsInstall.keySet()) {
OsInstallParam osInstall = hostToOsInstall.get(host);
if (osInstall != null) {
try {
// tasks.add(ExecutionUtils.startViprTask(new InstallOs(host, osInstall)));
} catch (ExecutionException e) {
context.logError("computeutils.installOs.failure", host.getId(), e.getMessage());
}
}
}
if (!ExecutionUtils.waitForTask(tasks, this)) {
// TODO: Re-throw the error?
// ExecutionUtils.checkForError(tasks);
}
}
Aggregations