Search in sources :

Example 1 with CancelMigrationVDSParameters

use of org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters in project ovirt-engine by oVirt.

the class MaintenanceNumberOfVdssCommand method cancelIncommingMigrations.

private void cancelIncommingMigrations() {
    for (Guid hostId : vdssToMaintenance.keySet()) {
        for (VmDynamic vm : vmDynamicDao.getAllMigratingToHost(hostId)) {
            if (vm.getStatus() == VMStatus.MigratingFrom) {
                log.info("Cancelling incoming migration of '{}' id '{}'", vm, vm.getId());
                runVdsCommand(VDSCommandType.CancelMigrate, new CancelMigrationVDSParameters(vm.getRunOnVds(), vm.getId(), true));
            }
        }
    }
}
Also used : VmDynamic(org.ovirt.engine.core.common.businessentities.VmDynamic) CancelMigrationVDSParameters(org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters) Guid(org.ovirt.engine.core.compat.Guid)

Example 2 with CancelMigrationVDSParameters

use of org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters in project ovirt-engine by oVirt.

the class CancelMigrateVmCommand method executeCommand.

@Override
protected void executeCommand() {
    VDSReturnValue retVal = runVdsCommand(VDSCommandType.CancelMigrate, new CancelMigrationVDSParameters(getVm().getRunOnVds(), getParameters().getVmId(), false));
    setSucceeded(retVal.getSucceeded());
}
Also used : CancelMigrationVDSParameters(org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

CancelMigrationVDSParameters (org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters)2 VmDynamic (org.ovirt.engine.core.common.businessentities.VmDynamic)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1 Guid (org.ovirt.engine.core.compat.Guid)1