Migrate will change instance_type_id of instance

Bug #809570 reported by Johannes Erdfelt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Johannes Erdfelt

Bug Description

When migrating an instance to another host, the instance_type_id of the instance changes.

This is because instance_type.id is used in place of flavorid when calling prep_resize(). As a result, the instance_type loaded in prep_resize() is (usually, depending on database) different than the instance_type in resize().

Related branches

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

It's not exactly obvious why there are two different unique ids for an instance_type, but it's probably related to why the code is confused on which one to use.

Ideally, removing one and using one unique id would be the best solution.

Alternatively, changing the code to use either id or flavor_id consistently internally (keeping the API unchanged for compatibility reasons) to avoid this kind of problem in the future.

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

As an example of how inconsistent the code is internally, the instances table uses instance_type_id, but the migrations table uses flavor_id.

Revision history for this message
Matt Dietz (cerberus) wrote :

I suspect this is now fixed with my lp808949 branch

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

I don't see any changes in your lp808939 branch that would fix this. It's still using the instance_type.id instead of instance_type.flavorid.

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Changed in nova:
assignee: nobody → Johannes Erdfelt (johannes.erdfelt)
Thierry Carrez (ttx)
Changed in nova:
status: Confirmed → In Progress
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-4
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-4 → 2011.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.