use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class RemoveHostFromClusterService method validateBootVolumes.
/**
* Validate the boot volume associated with the hosts we wish to remove.
*
* @param hostIdToNameMap
* map of host ID to hostname. We are only using the host ID key.
* @return false if we can reach the host and determine the boot volume is no longer there.
*/
private boolean validateBootVolumes(Map<URI, String> hostIdToNameMap) {
// the references are fixed.
if (cluster == null || cluster.getInactive()) {
logError("computeutils.removebootvolumes.failure.cluster");
return false;
}
// Get all of the hosts for the cluster, create a list of hosts we are interested in removing ONLY.
List<HostRestRep> allClusterHosts = ComputeUtils.getHostsInCluster(clusterId);
List<HostRestRep> hostsToValidate = new ArrayList<>();
for (HostRestRep clusterHost : allClusterHosts) {
if (hostIdToNameMap.containsKey(clusterHost.getId())) {
hostsToValidate.add(clusterHost);
}
}
return ComputeUtils.validateBootVolumes(cluster, hostsToValidate);
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class AddHostToCluster method doExecute.
@Override
public Task<HostRestRep> doExecute() throws Exception {
HostUpdateParam hostUpdateParam = new HostUpdateParam();
hostUpdateParam.setCluster(cluster);
Task<HostRestRep> task = getClient().hosts().update(host, hostUpdateParam);
return task;
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class CreateHosts method executeTask.
@Override
public Tasks<HostRestRep> executeTask() throws Exception {
ProvisionBareMetalHostsParam create = new ProvisionBareMetalHostsParam();
create.setCluster(cluster);
create.setComputeVpool(vcp);
create.setTenant(getOrderTenant());
create.setVarray(varray);
for (String hostName : hostNames) {
if (hostName != null) {
create.getHostNames().add(hostName);
}
}
Tasks<HostRestRep> tasks = getClient().hosts().provisionBareMetalHosts(create);
for (Task<HostRestRep> task : tasks.getTasks()) {
addOrderIdTag(task.getTaskResource().getId());
}
return tasks;
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class SetBootVolume method executeTask.
@Override
public Task<HostRestRep> executeTask() throws Exception {
HostUpdateParam update = new HostUpdateParam();
update.setBootVolume(volumeId);
update.setUpdateSanBootTargets(updateSanBootTargets);
Task<HostRestRep> task = getClient().hosts().updateBootVolume(hostId, update);
addOrderIdTag(task.getTaskResource().getId());
return task;
}
use of com.emc.storageos.model.host.HostRestRep in project coprhd-controller by CoprHD.
the class ClusterAutoExportTest method test4.
public void test4() throws Exception {
// Set auto-export to true on one cluster to trigger synchronization
List<HostRestRep> cluster1Hosts = getHosts(cluster1);
List<HostRestRep> cluster2Hosts = getHosts(cluster2);
setClusterAutoExport(cluster1, true);
Thread.sleep(LONG_SLEEP);
for (HostRestRep host : cluster1Hosts) {
verifyHostInClusterExport(host, export1);
verifyHostNotInClusterExport(host, export2);
}
for (HostRestRep host : cluster2Hosts) {
verifyHostInClusterExport(host, export2);
verifyHostNotInClusterExport(host, export1);
}
}
Aggregations