Hi,
I reproduced this bug, and it is easy only to avoid this bug by the following change:
--- a/nova/compute/resource_tracker.py
+++ b/nova/compute/resource_tracker.py
@@ -164,8 +164,6 @@ class ResourceTracker(object):
# info that is needed via rpc so db access isn't required
# here. old_instance_type_id = instance['instance_type_id']
- old_instance_type = instance_types.get_instance_type(
- old_instance_type_id)
Hi,
I reproduced this bug, and it is easy only to avoid this bug by the following change:
--- a/nova/ compute/ resource_ tracker. py compute/ resource_ tracker. py (object) :
old_instance_ type_id = instance[ 'instance_ type_id' ] types.get_ instance_ type( type_id)
+++ b/nova/
@@ -164,8 +164,6 @@ class ResourceTracker
# info that is needed via rpc so db access isn't required
# here.
- old_instance_type = instance_
- old_instance_
return db.migration_ create( context. elevated( ),
{'instance_ uuid': instance['uuid'], (object) :
'dest_ compute' : self.host,
'dest_ node': self.nodename,
'dest_ host': self.driver. get_host_ ip_addr( ), type_id' : old_instance_ type['id' ], type_id' : old_instance_ type_id,
'new_ instance_ type_id' : instance_ type['id' ],
'status' : 'pre-migrating'})
@@ -174,7 +172,7 @@ class ResourceTracker
- 'old_instance_
+ 'old_instance_
but the above change is not complete, because old_instance_type is
necessary when 'nova resize-revert' command runs.
So I feel the original problem is that we can delete a flavor in use by 'nova flavor-delete'.