use of org.ovirt.engine.core.common.vdscommands.SnapshotVDSCommandParameters in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommand method buildLiveSnapshotParameters.
private SnapshotVDSCommandParameters buildLiveSnapshotParameters(Snapshot snapshot) {
List<Disk> pluggedDisksForVm = diskDao.getAllForVm(getVm().getId(), true);
List<DiskImage> filteredPluggedDisksForVm = DisksFilter.filterImageDisks(pluggedDisksForVm, ONLY_SNAPABLE, ONLY_ACTIVE);
// 'filteredPluggedDisks' should contain only disks from 'getDisksList()' that are plugged to the VM.
List<DiskImage> filteredPluggedDisks = ImagesHandler.imagesIntersection(filteredPluggedDisksForVm, getDisksList());
SnapshotVDSCommandParameters parameters = new SnapshotVDSCommandParameters(getVm().getRunOnVds(), getVm().getId(), filteredPluggedDisks);
if (isMemorySnapshotSupported() && snapshot.containsMemory()) {
parameters.setMemoryDump((DiskImage) diskDao.get(snapshot.getMemoryDiskId()));
parameters.setMemoryConf((DiskImage) diskDao.get(snapshot.getMetadataDiskId()));
}
// In case the snapshot is auto-generated for live storage migration,
// we do not want to issue an FS freeze thus setting vmFrozen to true
// so a freeze will not be issued by Vdsm
parameters.setVmFrozen(shouldFreezeOrThawVm() || getParameters().getParentCommand() == ActionType.LiveMigrateDisk);
return parameters;
}
Aggregations