Skip to content

Commit

Permalink
core: vm will be down when active snapshot does not have memory
Browse files Browse the repository at this point in the history
Previously, when trying-back/restoring a snapshot that doesn't have
memory while the client requested to restore memory, the VM would
have switched to Suspended state.

Now, the VM is set to Suspended only when the active snapshot, the
snapshot that was created by the trying-back/restore operation, is
set with memory volumes. Otherwise, the VM is set to Down.

See: oVirt/ovirt-web-ui#1629

Signed-off-by: Arik Hadas <ahadas@redhat.com>
  • Loading branch information
ahadas committed Sep 14, 2022
1 parent 5cdce04 commit 14588e5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,15 @@ private void restoreVmConfigFromSnapshot() {
activeSnapshotLeaseDomainId = getVm().getStaticData().getLeaseStorageDomainId();
}

Snapshot snapshot = snapshotDao.get(getVm().getId(), SnapshotType.ACTIVE);
getSnapshotsManager().attemptToRestoreVmConfigurationFromSnapshot(getVm(),
getDstSnapshot(),
snapshotDao.getId(getVm().getId(), SnapshotType.ACTIVE),
snapshot.getId(),
getFilteredImagesToPreview(),
getCompensationContext(),
getCurrentUser(),
new VmInterfaceManager(getMacPool()),
getParameters().isRestoreMemory());
snapshot.getMemoryDiskId() != null);

// custom preview - without leases
if (!getParameters().isRestoreLease()) {
Expand Down

0 comments on commit 14588e5

Please sign in to comment.