Search in sources :

Example 1 with PrepareForMaintenanceCmd

use of org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd in project cloudstack by apache.

the class RollingMaintenanceManagerImpl method putHostIntoMaintenance.

/**
 * Puts host into maintenance and waits for its completion
 * @param host host
 * @throws InterruptedException
 * @throws AgentUnavailableException
 */
private void putHostIntoMaintenance(Host host) throws InterruptedException, AgentUnavailableException {
    s_logger.debug(String.format("Trying to set %s into maintenance", host));
    PrepareForMaintenanceCmd cmd = new PrepareForMaintenanceCmd();
    cmd.setId(host.getId());
    resourceManager.maintain(cmd);
    waitForHostInMaintenance(host.getId());
}
Also used : PrepareForMaintenanceCmd(org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd)

Aggregations

PrepareForMaintenanceCmd (org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd)1