Created attachment 587243 [details] log file [Storage][Snapshots] Null pointer exception when trying to remove snapshots when VM has no disks. How to reproduce: 1.Create VM with disk or several disks. 2.Create snapshot. 3.Delete disks. 4.Try to remove snapshot. It is not clear what was the decision about what should happen to a snapshots when removing VM's disks. If we want to leave the snapshot we have to handle all the snapshot's actions like preview,commit,delete. engine.log attached.
Not a NPE but IndexOutOfBoundsException, To clarify the expected behaviour: - When a disk is deleted, the snapshot should be kept, this is the current behaviour which is fine. - A snapshot should be deleted silently when a disk is not available any longer. - Preview should restore the disk entity in RHEVM but the disk state should be 'illegal'. currently preview with a deleted disk causes another exception, I'll open another BZ for this issue.
This usecase is blocked by the UI (i.e., manipulating snapshots with no disks), with commit hash f8ba703f72737d585811bc36fc6106aa84cafe6a. Do we want to remove this block, and address the bug? What is the expected behavior?
ignore last comment - misunderstood the flow.
patch http://gerrit.ovirt.org/#/c/6119/ was MERGED. steps to reproduce are as described in Leonid's initial message.
verified on SI12 - snapshot is now removed. there is a small bug that removeSnapshot is missing from exception messages, will open a new one since i don't know if its related. 2012-07-29 20:56:49,287 WARN [org.ovirt.engine.core.dal.job.ExecutionMessageDirector] (ajp-/127.0.0.1:8009-15) [2c369c68] The message key RemoveSnapshot is missing from bundles/ExecutionMessages 2012-07-29 20:56:49,388 INFO [org.ovirt.engine.core.bll.RemoveSnapshotCommand] (ajp-/127.0.0.1:8009-15) [2c369c68] Lock Acquired to object EngineLock [exclusiveLocks= key: 9c9bc1f1-8f90-4464-bfb4-0bf73a478c74 value: VM , sharedLocks= ] 2012-07-29 20:56:49,392 INFO [org.ovirt.engine.core.vdsbroker.irsbroker.IsValidVDSCommand] (ajp-/127.0.0.1:8009-15) [2c369c68] START, IsValidVDSCommand(storagePoolId = 77887fd1-3408-44ec-8de4-153948d89cdc, ignoreFailoverLimit = false, compatabilityVersion = null), log id: 1509eea8 2012-07-29 20:56:49,393 INFO [org.ovirt.engine.core.vdsbroker.irsbroker.IsValidVDSCommand] (ajp-/127.0.0.1:8009-15) [2c369c68] FINISH, IsValidVDSCommand, return: true, log id: 1509eea8 2012-07-29 20:56:49,630 INFO [org.ovirt.engine.core.bll.RemoveSnapshotCommand] (ajp-/127.0.0.1:8009-15) [2c369c68] Running command: RemoveSnapshotCommand internal: false. Entities affected : ID: 9c9bc1f1-8f90-4464-bfb4-0bf73a478c74 Type: VM 2012-07-29 20:56:49,777 INFO [org.ovirt.engine.core.bll.RemoveSnapshotCommand] (ajp-/127.0.0.1:8009-15) [2c369c68] Lock freed to object EngineLock [exclusiveLocks= key: 9c9bc1f1-8f90-4464-bfb4-0bf73a478c74 value: VM , sharedLocks= ] 2012-07-29 20:57:51,705 INFO [org.ovirt.engine.core.bll.AsyncTaskManager] (QuartzScheduler_Worker-42) Setting new tasks map. The map contains now 0 tasks 2012-07-29 20:57:51,705 INFO [org.ovirt.engine.core.bll.AsyncTaskManager] (QuartzScheduler_Worker-42) Cleared all tasks of pool 77887fd1-3408-44ec-8de4-153948d89cdc