use of org.ovirt.engine.core.common.businessentities.VDSStatus in project ovirt-engine by oVirt.
the class StopVdsCommand method setStatus.
@Override
protected void setStatus() {
VDSStatus newStatus = VDSStatus.Down;
if (getParameters().getParentCommand() == ActionType.RestartVds) {
// In case the stop was issued as a result of VDS command , we
// cannot set the VDS to down -
// According to bug fix #605215 it can be that backend will crash
// during restart, and upon restart, all down VDS are not
// monitored. Instead, we will set the status to rebooting
newStatus = VDSStatus.Reboot;
}
setStatus(newStatus);
}
use of org.ovirt.engine.core.common.businessentities.VDSStatus in project ovirt-engine by oVirt.
the class HostStatusCell method render.
@Override
public void render(Context context, VDS vds, SafeHtmlBuilder sb, String id) {
// Nothing to render if no host is provided:
if (vds == null) {
return;
}
// Find the image corresponding to the status of the host:
VDSStatus status = vds.getStatus();
ImageResource statusImage;
switch(status) {
case Unassigned:
case NonResponsive:
case InstallFailed:
case Connecting:
case Down:
statusImage = resources.downImage();
break;
case PreparingForMaintenance:
statusImage = resources.prepareImage();
break;
case Maintenance:
statusImage = resources.maintenanceImage();
break;
case Up:
statusImage = resources.upImage();
break;
case Error:
statusImage = resources.errorImage();
break;
case Installing:
statusImage = resources.hostInstallingImage();
break;
case Reboot:
statusImage = resources.waitImage();
break;
case NonOperational:
statusImage = resources.nonOperationalImage();
break;
case PendingApproval:
case InstallingOS:
statusImage = resources.unconfiguredImage();
break;
case Initializing:
statusImage = resources.waitImage();
break;
case Kdumping:
statusImage = resources.waitImage();
break;
default:
statusImage = resources.downImage();
}
// Find the image corresponding to the alert:
ImageResource alertImage = resources.alertImage();
// Generate the HTML for the images:
SafeHtml statusImageHtml = AbstractImagePrototype.create(statusImage).getSafeHtml();
SafeHtml alertImageHtml = AbstractImagePrototype.create(alertImage).getSafeHtml();
// Generate the HTML for the cell, wrapped inside <div> element:
// $NON-NLS-1$ //$NON-NLS-2$
sb.appendHtmlConstant("<div id=\"" + id + "\" style=\"text-align: center;\">");
// Append status image:
sb.append(statusImageHtml);
// - host reinstall is required
if (hasPMAlert(vds) || hasNetconfigDirty(vds) || hasGlusterAlert(vds) || vds.getStaticData().isReinstallRequired() || hasDefaultRouteAlert(vds)) {
sb.append(alertImageHtml);
}
// $NON-NLS-1$
sb.appendHtmlConstant("</div>");
}
use of org.ovirt.engine.core.common.businessentities.VDSStatus in project ovirt-engine by oVirt.
the class FenceProxyLocatorTest method findProxyHostExcludesUnreachableHosts.
/**
* Checks if the locator excludes specified host as a proxy host, because it's unreachable by network. And because
* specified host is the only existing host, no proxy is selected.
*
* Special case when host has NonOperational status and reason NETWORK_UNREACHABLE is tested in different test case!
*/
@Test
public void findProxyHostExcludesUnreachableHosts() {
FenceProxyLocator locator = setupLocator();
for (VDSStatus status : VDSStatus.values()) {
mockExistingHosts(createHost(status));
assertEquals(shouldHostBeUnreachable(status), locator.findProxyHost(false) == null);
}
}
use of org.ovirt.engine.core.common.businessentities.VDSStatus in project ovirt-engine by oVirt.
the class HostValidator method hostStatusLegalForSetupNetworks.
private ValidationResult hostStatusLegalForSetupNetworks() {
VDSStatus hostStatus = host.getStatus();
boolean hostStatusLegalForSetupNetworks = LEGAL_STATUSES.contains(hostStatus) || hostStatus == VDSStatus.Installing && internalExecution;
if (!hostStatusLegalForSetupNetworks) {
logger.error("Unable to setup network: operation can only be done when Host status is one of: {};" + " current status is {}", LEGAL_STATUSES_STR, hostStatus);
return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL, ReplacementUtils.replaceWith(VAR_HOST_STATUS, LEGAL_STATUSES, ",", LEGAL_STATUSES.size()));
}
return ValidationResult.VALID;
}
use of org.ovirt.engine.core.common.businessentities.VDSStatus in project ovirt-engine by oVirt.
the class UpgradeHostCommand method executeCommand.
@Override
protected void executeCommand() {
VDSStatus statusBeforeUpgrade = getVds().getStatus();
if (statusBeforeUpgrade != VDSStatus.Maintenance) {
commandCoordinatorUtil.executeAsyncCommand(ActionType.MaintenanceNumberOfVdss, createMaintenanceParams(), cloneContext());
}
setSucceeded(true);
}
Aggregations