[ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
Matt .
yamakasi.014 at gmail.com
Wed Jul 6 21:14:56 UTC 2016
OK, due some not having done PgSQL for a long time I didn't select the
engine DB that well.
Thanks, this is a good fix where I already noticed the same snapshot
ID already by searching through the tables and looking what's going on
there.
2016-07-06 14:41 GMT+02:00 Matt . <yamakasi.014 at gmail.com>:
> HI,
>
> Thanks for the solution, I actually get:
>
> postgres=# 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);
> ERROR: relation "snapshots" does not exist
> LINE 1: ...ts.description as snapshot_name, snapshot_id from snapshots ..
>
> 2016-07-06 12:11 GMT+02:00 <nicolas at devels.es>:
>> Hi Arik,
>>
>> El 2016-07-06 10:27, Arik Hadas escribió:
>>>
>>> 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.
>>>
>>
>> Some of them were available when we did remove a storage backend, indeed.
>> Some were newer, the problem is that I don't know which one actually failed
>> since when this happened we were in a hurry and needed to upgrade ASAP.
>>
>>> 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);
>>>
>>
>> Thanks. We have another oVirt infrastructure and I see this query is
>> returning one row. I'll report back when we upgrade this second
>> infrastructure and provide some details.
>>
>> Regards.
>>
>>
>>> 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