Bug 1353219 - Fail to upgrade db if storage domain with memory was removed
Summary: Fail to upgrade db if storage domain with memory was removed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.0.2
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ovirt-4.0.1
: 4.0.1.1
Assignee: Arik
QA Contact: sefi litmanovich
URL:
Whiteboard:
: 1350220 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-06 14:45 UTC by Arik
Modified: 2016-08-04 13:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Upgrade to 4.0 could fail if there were snapshot whose memory is inaccessible. That is, memory volumes that have been manually removed from the storage domain or that reside on storage domain that were removed from the data center. This fix prevents the failure by removing references to such memory volumes during the upgrade.
Clone Of:
Environment:
Last Closed: 2016-08-04 13:30:37 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
ylavi: testing_plan_complete?
ylavi: planning_ack+
ahadas: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 60443 0 master MERGED core: remove unaccessible memory during upgrade 2016-07-10 14:04:37 UTC
oVirt gerrit 60448 0 ovirt-engine-4.0 MERGED core: remove inaccessible memory during upgrade 2016-07-11 13:12:40 UTC
oVirt gerrit 60449 0 ovirt-engine-4.0.1 MERGED core: remove inaccessible memory during upgrade 2016-07-11 14:14:29 UTC

Description Arik 2016-07-06 14:45:03 UTC
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);

Comment 1 sefi litmanovich 2016-07-24 14:14:57 UTC
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.

Comment 2 Allon Mureinik 2016-07-25 12:18:20 UTC
*** Bug 1350220 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.