delete a resize instance change quota_usages incorrectly

Bug #1747582 reported by guolidong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
guolidong

Bug Description

Description
===========
After a resize instance in finish_resize step fault, the quota rollback but instance has changed to new flavor, then delete the instance use new flavor to reduce quota usage.

Steps to reproduce
==================
1、execute 'nova limits --tenant <tenant>' to show quota usages.
2、create an instance with m1.tiny flavor.
3、create a new flavor with same config to m1.tiny, except add vcpus to 2.
4、make finish resize error, like port binding failed, and use new flavor to resize instance.
5、after delete the instance, use 'nova limits --tenant <tenant>' to show quota usages.

Expected result
===============
The second quota_usages cores used as same as the first.

Actual result
=============
The second quota_usages cores used less than the first.

Environment
===========
Newton
libvirt & KVM

Logs & Configs
==============
resize error:
2018-01-30 16:19:37.137 8378 INFO nova.compute.manager [req-9e11622b-66b5-4c7a-8443-e9ba3b847aa2 - - - - -] [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] Migrating
2018-01-30 16:19:37.255 8378 INFO nova_patch.compute.manager [req-9e11622b-66b5-4c7a-8443-e9ba3b847aa2 - - - - -] Report alarm notice for resize.prep instance end. Details: alarm_notice_instance_operation, instance_name: ldf_vm, instance_id: a97d7530-d6b7-48f9-bb88-4635b5e14fdc,result: True
2018-01-30 16:19:46.994 8378 WARNING nova.context [req-9e11622b-66b5-4c7a-8443-e9ba3b847aa2 - - - - -] Arguments dropped when creating context: {u'is_admin_project': True}
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [req-9e11622b-66b5-4c7a-8443-e9ba3b847aa2 - - - - -] [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] Setting instance vm_state to ERROR
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] Traceback (most recent call last):
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 4348, in finish_resize
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] disk_info, image_meta)
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 4282, in _finish_resize
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] migration_p)
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 1654, in migrate_instance_finish
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] migration=migration)
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 2060, in _update_port_binding_for_instance
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] self._ensure_no_port_binding_failure(port)
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] File "/usr/lib/python2.7/site-packages/nova_patch/network/neutronv2/api.py", line 82, in _ensure_no_port_binding_failure
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] raise exception.PortBindingFailed(port_id=port['id'])
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc] PortBindingFailed: Binding failed for port d6748c8d-9935-45d5-95bb-9d4eecbe45a7, please check neutron logs for more information.
2018-01-30 16:19:47.890 8378 ERROR nova.compute.manager [instance: a97d7530-d6b7-48f9-bb88-4635b5e14fdc]

quota_usages:
[root@NAIL2SHELVE3SLOT ~(keystone_admin)]# nova limits
+------+-----+-------+--------+------+----------------+
| Verb | URI | Value | Remain | Unit | Next_Available |
+------+-----+-------+--------+------+----------------+
+------+-----+-------+--------+------+----------------+
+--------------------+------+-------+
| Name | Used | Max |
+--------------------+------+-------+
| Cores | -1 | 20 |
| FloatingIps | 0 | 10 |
| ImageMeta | - | 128 |
| Instances | 0 | 10 |
| Keypairs | - | 100 |
| Personality | - | 5 |
| Personality Size | - | 10240 |
| RAM | 0 | 51200 |
| SecurityGroupRules | - | 20 |
| SecurityGroups | 1 | 10 |
| Server Meta | - | 128 |
| ServerGroupMembers | - | 10 |
| ServerGroups | 2 | 10 |
+--------------------+------+-------+

Tags: quotas
guolidong (guolidong)
Changed in nova:
assignee: nobody → guolidong (guolidong)
tags: added: openstack-version.newton quotas resize
Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :

Quotas had big changes since Newton and now it's hard to know whether the problem you identified is still present. Could you please try to spin a devstack install and reproduce your scenario against the master branch ?

Thanks.

Changed in nova:
status: New → Incomplete
Revision history for this message
Matt Riedemann (mriedem) wrote :

This is likely not a problem since Pike when we removed the quota commit/rollback way of doing things and just count quota usage based on what the instance is consuming at the time of the query:

https://specs.openstack.org/openstack/nova-specs/specs/pike/implemented/cells-count-resources-to-check-quota-in-api.html

tags: removed: openstack-version.newton resize
Revision history for this message
guolidong (guolidong) wrote :

This problem does not exist in Pike, but still exist before Pike. And we do not need deal with it?

Revision history for this message
melanie witt (melwitt) wrote :

The bug has been fixed as of the Pike release as part of the re-architecting of the quotas code. The re-architecting changes are not backportable and we're not going to fix the legacy quotas code for older versions.

Newton has been EOL since 2017-10-25, so we wouldn't be applying new fixes there anyway.

Changed in nova:
status: Incomplete → Won't Fix
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.