Search in sources :

Example 1 with SnapshotVDSCommandParameters

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;
}
Also used : SnapshotVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.SnapshotVDSCommandParameters) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) BaseDisk(org.ovirt.engine.core.common.businessentities.storage.BaseDisk) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Aggregations

BaseDisk (org.ovirt.engine.core.common.businessentities.storage.BaseDisk)1 CinderDisk (org.ovirt.engine.core.common.businessentities.storage.CinderDisk)1 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)1 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)1 SnapshotVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.SnapshotVDSCommandParameters)1