use of org.ovirt.engine.core.common.vdscommands.VmReplicateDiskParameters in project ovirt-engine by oVirt.
the class LiveMigrateDiskCommand method replicateDiskStart.
private void replicateDiskStart() {
if (Guid.Empty.equals(getParameters().getVdsId())) {
throw new EngineException(EngineError.down, "VM " + getParameters().getVmId() + " is not running on any VDS");
}
StorageType targetType = getDstStorageDomain().getStorageStaticData().getStorageType();
Optional<String> diskType = vmInfoBuildUtils.getNetworkDiskType(getVm(), targetType);
// Start disk migration
VmReplicateDiskParameters migrationStartParams = new VmReplicateDiskParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStoragePoolId(), getParameters().getSourceStorageDomainId(), getParameters().getTargetStorageDomainId(), getParameters().getImageGroupID(), getParameters().getDestinationImageId(), diskType.orElse(null));
VDSReturnValue ret = resourceManager.runVdsCommand(VDSCommandType.VmReplicateDiskStart, migrationStartParams);
if (!ret.getSucceeded()) {
log.error("Failed VmReplicateDiskStart (Disk '{}' , VM '{}')", getParameters().getImageGroupID(), getParameters().getVmId());
throw new EngineException(ret.getVdsError().getCode(), ret.getVdsError().getMessage());
}
}
use of org.ovirt.engine.core.common.vdscommands.VmReplicateDiskParameters in project ovirt-engine by oVirt.
the class LiveMigrateDiskCommand method replicateDiskFinish.
private void replicateDiskFinish(Guid srcDomain, Guid dstDomain) {
VmReplicateDiskParameters migrationStartParams = new VmReplicateDiskParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStoragePoolId(), srcDomain, dstDomain, getParameters().getImageGroupID(), getParameters().getDestinationImageId(), null);
VDSReturnValue ret = resourceManager.runVdsCommand(VDSCommandType.VmReplicateDiskFinish, migrationStartParams);
if (!ret.getSucceeded()) {
throw new EngineException(ret.getVdsError().getCode(), ret.getVdsError().getMessage());
}
}
Aggregations