← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1570748] [NEW] Bug: resize instance after edit flavor with horizon

 

Public bug reported:

Error occured when resize instance after edit flavor with horizon (and
also delete flavor used by instance)

Reproduce step :

1. create flavor A
2. boot instance using flavor A
3. edit flavor with horizon (or delete flavor A)
    -> the result is same to edit or to delelet flavor because edit flavor means delete/recreate flavor)
4. resize or migrate instance
5. Error occured

Log : 
nova-compute.log
   File "/opt/openstack/src/nova/nova/conductor/manager.py", line 422, in _object_dispatch
     return getattr(target, method)(*args, **kwargs)

   File "/opt/openstack/src/nova/nova/objects/base.py", line 163, in wrapper
     result = fn(cls, context, *args, **kwargs)

   File "/opt/openstack/src/nova/nova/objects/flavor.py", line 132, in get_by_id
     db_flavor = db.flavor_get(context, id)

   File "/opt/openstack/src/nova/nova/db/api.py", line 1479, in flavor_get
     return IMPL.flavor_get(context, id)

   File "/opt/openstack/src/nova/nova/db/sqlalchemy/api.py", line 233, in wrapper
     return f(*args, **kwargs)

   File "/opt/openstack/src/nova/nova/db/sqlalchemy/api.py", line 4732, in flavor_get
     raise exception.FlavorNotFound(flavor_id=id)

 FlavorNotFound: Flavor 7 could not be found.


This Error is occured because of below code:
/opt/openstack/src/nova/nova/compute/manager.py

    def resize_instance(self, context, instance, image,
                        reservations, migration, instance_type,
                        clean_shutdown=True):
....
            if (not instance_type or
                not isinstance(instance_type, objects.Flavor)):
                instance_type = objects.Flavor.get_by_id(
                    context, migration['new_instance_type_id'])
....

I think that deleted flavor should be taken when resize instance. 
I tested this in stable/kilo, but I think stable/liberty and stable/mitaka has same bug because source code is not changed.

thanks.

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: migrate nova resize

** Summary changed:

- Bug: Error resize instance after edit flavor with horizon 
+ Bug: resize instance after edit flavor with horizon

** Tags added: nova

** Tags added: migrate resize

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1570748

Title:
  Bug: resize instance after edit flavor with horizon

Status in OpenStack Compute (nova):
  New

Bug description:
  Error occured when resize instance after edit flavor with horizon (and
  also delete flavor used by instance)

  Reproduce step :

  1. create flavor A
  2. boot instance using flavor A
  3. edit flavor with horizon (or delete flavor A)
      -> the result is same to edit or to delelet flavor because edit flavor means delete/recreate flavor)
  4. resize or migrate instance
  5. Error occured

  Log : 
  nova-compute.log
     File "/opt/openstack/src/nova/nova/conductor/manager.py", line 422, in _object_dispatch
       return getattr(target, method)(*args, **kwargs)

     File "/opt/openstack/src/nova/nova/objects/base.py", line 163, in wrapper
       result = fn(cls, context, *args, **kwargs)

     File "/opt/openstack/src/nova/nova/objects/flavor.py", line 132, in get_by_id
       db_flavor = db.flavor_get(context, id)

     File "/opt/openstack/src/nova/nova/db/api.py", line 1479, in flavor_get
       return IMPL.flavor_get(context, id)

     File "/opt/openstack/src/nova/nova/db/sqlalchemy/api.py", line 233, in wrapper
       return f(*args, **kwargs)

     File "/opt/openstack/src/nova/nova/db/sqlalchemy/api.py", line 4732, in flavor_get
       raise exception.FlavorNotFound(flavor_id=id)

   FlavorNotFound: Flavor 7 could not be found.

  
  This Error is occured because of below code:
  /opt/openstack/src/nova/nova/compute/manager.py

      def resize_instance(self, context, instance, image,
                          reservations, migration, instance_type,
                          clean_shutdown=True):
  ....
              if (not instance_type or
                  not isinstance(instance_type, objects.Flavor)):
                  instance_type = objects.Flavor.get_by_id(
                      context, migration['new_instance_type_id'])
  ....

  I think that deleted flavor should be taken when resize instance. 
  I tested this in stable/kilo, but I think stable/liberty and stable/mitaka has same bug because source code is not changed.

  thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1570748/+subscriptions


Follow ups