On two environments upgrading from Kilo to Liberty, I've seen the case where `nova-manage db migrate_flavor_data` says "0 instances matched query", but the db migration to validate in Liberty fails.
This is the query run in Liberty to ensure that the flavor migration has already happened in Kilo:
SELECT COUNT(*) FROM nova.instance_system_metadata sysmeta, nova.instances inst
WHERE inst.uuid = sysmeta.instance_uuid
AND sysmeta.key = 'instance_type_id'
AND sysmeta.deleted != sysmeta.id
AND inst.deleted != inst.id;
Haven't been able to track down exactly what's causing this, maybe a VM delete that didn't completely propagate everything it needed to.
Fixed by setting nova.instance_system_metadata.deleted to the same value as nova.instances.id.
On two environments upgrading from Kilo to Liberty, I've seen the case where `nova-manage db migrate_ flavor_ data` says "0 instances matched query", but the db migration to validate in Liberty fails.
This is the query run in Liberty to ensure that the flavor migration has already happened in Kilo:
SELECT COUNT(*) FROM nova.instance_ system_ metadata sysmeta, nova.instances inst instance_ uuid
WHERE inst.uuid = sysmeta.
AND sysmeta.key = 'instance_type_id'
AND sysmeta.deleted != sysmeta.id
AND inst.deleted != inst.id;
https:/ /github. com/openstack/ nova/blob/ stable/ liberty/ nova/db/ sqlalchemy/ migrate_ repo/versions/ 291_enforce_ flavors_ migrated. py#L24- L28
Haven't been able to track down exactly what's causing this, maybe a VM delete that didn't completely propagate everything it needed to. system_ metadata. deleted to the same value as nova.instances.id.
Fixed by setting nova.instance_