use of org.ovirt.engine.core.common.vdscommands.HibernateVDSCommandParameters in project ovirt-engine by oVirt.
the class HibernateVmCommand method endSuccessfully.
@Override
protected void endSuccessfully() {
if (getVm().getStatus() != VMStatus.Up) {
log.warn("VM '{}' is not up, cannot Hibernate.", getVm().getName());
endWithFailure();
return;
}
List<ActionReturnValue> addDiskReturnValues = endActionOnDisks();
DiskImage dumpDisk = getMemoryDumpDisk(addDiskReturnValues);
DiskImage metadataDisk = getMemoryMetadataDisk(addDiskReturnValues);
String hiberVol = MemoryUtils.createMemoryStateString(getStorageDomainId(), getStoragePoolId(), dumpDisk.getId(), dumpDisk.getImageId(), metadataDisk.getId(), metadataDisk.getImageId());
try {
runVdsCommand(VDSCommandType.Hibernate, new HibernateVDSCommandParameters(getVm().getRunOnVds(), getVmId(), hiberVol));
snapshotDao.updateHibernationMemory(getVmId(), dumpDisk.getId(), metadataDisk.getId());
} catch (EngineException e) {
hibernateVdsProblematic = true;
endWithFailure();
return;
}
setSucceeded(true);
}
Aggregations