[ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh

Arik Hadas ahadas at redhat.com
Wed Jul 6 09:27:12 UTC 2016


Hi,

This is a bit aggressive solution to remove all snapshots with the memory.

Can you confirm that a storage domain that was active while creating the snapshot with memory was removed from the system?
This is something that was not covered and could lead to the reported issue.

Until we come up with a proper solution, you can 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);

Regards,
Arik

----- Original Message -----
> Hi,
> 
> We have had a similar issue when upgrading, digging into it we found out
> that this was caused by snapshots that had the "Save memory" option
> enabled. We finally ended up deleting any snapshot that had this option
> enabled and then we tried to upgrade, this time the process went smooth.
> 
> Hope this helps.
> 
> Regards.
> 
> El 2016-07-05 18:49, Matt . escribió:
> > OK some update on this.
> > 
> > Removed the db-migrate-script package and reinstalled ovirt-engine and
> > ovirt-engine-setup.
> > 
> > I still have that error and this is the loggingpart:
> > 
> > CONTEXT:  SQL statement "DROP INDEX  IF EXISTS
> > idx_vm_static_template_version_name; CREATE INDEX
> > idx_vm_static_template_version_nam$
> > PL/pgSQL function fn_db_create_index(character varying,character
> > varying,text,text) line 12 at EXECUTE statement
> > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93:
> > ERROR:
> > 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
> > 
> > 2016-07-05 19:40:29 ERROR
> > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema
> > schema._misc:313 schema.sh: FATAL:
> > sql command:
> > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql
> > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142
> > method exception
> > Traceback (most recent call last):
> >   File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132,
> > in _executeMethod
> >     method['method']()
> >   File
> > "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/db/schema.py",
> > line 315, in _misc
> >     raise RuntimeError(_('Engine schema refresh failed'))
> > RuntimeError: Engine schema refresh failed
> > 
> > Any idea ?
> > 
> > 2016-07-05 15:25 GMT+02:00 Matt . <yamakasi.014 at gmail.com>:
> >> I just found out that the file
> >> 
> >> 04_00_0140_convert_memory_snapshots_to_disks.sql
> >> 
> >> is not located in:
> >> 
> >> /usr/share/ovirt-engine/dbscripts/upgrade/
> > _______________________________________________
> > Users mailing list
> > Users at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>



More information about the Users mailing list