use of org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters in project ovirt-engine by oVirt.
the class RemoveDiskSnapshotsCommand method buildRemoveCinderSnapshotDiskParameters.
private RemoveAllVmCinderDisksParameters buildRemoveCinderSnapshotDiskParameters(List<CinderDisk> cinderDisks) {
RemoveAllVmCinderDisksParameters params = new RemoveAllVmCinderDisksParameters();
params.setCinderDisks(cinderDisks);
params.setParentCommand(getActionType());
params.setParentParameters(getParameters());
params.setSessionId(getParameters().getSessionId());
params.setInvokeEndActionOnParent(false);
params.setEndProcedure(EndProcedure.COMMAND_MANAGED);
return params;
}
use of org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters in project ovirt-engine by oVirt.
the class RemoveVmCommand method removeCinderDisks.
/**
* The following method will perform a removing of all cinder disks from vm. These is only DB operation
*/
private Collection<CinderDisk> removeCinderDisks() {
Collection<CinderDisk> failedRemoveCinderDisks = null;
if (getParameters().isRemoveDisks()) {
List<CinderDisk> cinderDisks = getCinderDisks();
if (cinderDisks.isEmpty()) {
return Collections.emptyList();
}
RemoveAllVmCinderDisksParameters param = new RemoveAllVmCinderDisksParameters(getVmId(), cinderDisks);
param.setEndProcedure(EndProcedure.COMMAND_MANAGED);
Future<ActionReturnValue> future = commandCoordinatorUtil.executeAsyncCommand(ActionType.RemoveAllVmCinderDisks, withRootCommandInfo(param), cloneContextAndDetachFromParent());
try {
failedRemoveCinderDisks = future.get().getActionReturnValue();
} catch (InterruptedException | ExecutionException e) {
failedRemoveCinderDisks = cinderDisks;
log.error("Exception", e);
}
}
return failedRemoveCinderDisks;
}
use of org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters in project ovirt-engine by oVirt.
the class RemoveVmTemplateCommand method removeCinderDisks.
/**
* The following method performs a removing of all cinder disks from vm. These is only DB operation
*/
private void removeCinderDisks(List<CinderDisk> cinderDisks) {
RemoveAllVmCinderDisksParameters removeParam = new RemoveAllVmCinderDisksParameters(getVmTemplateId(), cinderDisks);
Future<ActionReturnValue> future = commandCoordinatorUtil.executeAsyncCommand(ActionType.RemoveAllVmCinderDisks, withRootCommandInfo(removeParam), cloneContextAndDetachFromParent());
try {
future.get().getActionReturnValue();
} catch (InterruptedException | ExecutionException e) {
log.error("Exception", e);
}
}
Aggregations