Description of problem: If there is a snapshot with memory that exists in the system such that the memory resides in a storage domain that was removed from the system later on (meaning it doesn't exists in the database anymore), one of the upgrade scripts fails. Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. Create a snapshot with memory in 3.6 2. Remove the storage domain that the memory resides in 3. Upgrade to 4.0 Actual results: Failure: insert or update on table "image_storage_domain_map" violates foreign key constraint "fk_image_storage_domain_map_storage_domain_static" DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) is not present in table "storage_domain_static". FATAL: Cannot execute sql command: --file=/usr/share/ovirt engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql Expected results: Upgrade should succeed Additional info: Setting priority to high as there is a workaround that was confirmed to work: use the following query to identify the exact problematic snapshots and remove them before upgrading: select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static);
Verified with rhevm-3.6.8.1-0.1.el6 upgrading to rhevm-4.0.2-0.1.rc.el7ev.noarch. Steps: 1. On the 3.6 env, create a vm with disk. 2. Start the vm. 3. Create live snapshot with memory. 4. stop vm. 5. Add another SD to the cluster. 6. Move the vm's disk to the new SD. 7. Detach and remove (no format) the original SD from the engine. 8. Backup the engine with engine-backup tool. 9. Re provision the server and install rhel 7.2 with latest rhevm-4.0 repos. 10.Install rhevm-setup. 11. restore engine withe engine-backup tool. 12. Install engine with engine-setup. setup succeeds with no errors.
*** Bug 1350220 has been marked as a duplicate of this bug. ***