Add exception handler for previous deleted flavor.
An exception happens if a previous flavor is deleted and
'nova resize-revert' run, because 'nova resize-revert' does
not handle the deleted flavor.
And also we have the same problem in _update_usage_from_migration().
This patch fixes the problems.
How to reproduce the problem on DevStack:
$ nova flavor-create sample 10 512 0 2
$ nova boot --image cirros-0.3.0-x86_64-uec --flavor sample test01
$ nova resize test01 m1.tiny
$ nova flavor-delete 10
$ nova resize-revert test01
Before applying this patch:
$ nova resize-revert test01
ERROR: The server could not comply with the request since it is
either malformed or otherwise incorrect. (HTTP 400) (Request-ID:
req-b0d3e016-9608-4a87-a0cc-44dfe00b25a1)
$
After applying this patch:
$ nova resize-revert test01
ERROR: Flavor used by the instance could not be found. (HTTP 400)
(Request-ID: req-ed4ce174-33f2-4258-b522-674a1023ea74)
$
Reviewed: https:/ /review. openstack. org/18284 github. com/openstack/ nova/commit/ 4e02fa1964f5de3 a6ba345d858623f 35b24beafd
Committed: http://
Submitter: Jenkins
Branch: master
commit 4e02fa1964f5de3 a6ba345d858623f 35b24beafd
Author: Ken'ichi Ohmichi <email address hidden>
Date: Tue Jan 8 05:08:17 2013 +0900
Add exception handler for previous deleted flavor.
An exception happens if a previous flavor is deleted and usage_from_ migration( ).
'nova resize-revert' run, because 'nova resize-revert' does
not handle the deleted flavor.
And also we have the same problem in _update_
This patch fixes the problems.
How to reproduce the problem on DevStack: 0.3.0-x86_ 64-uec --flavor sample test01
$ nova flavor-create sample 10 512 0 2
$ nova boot --image cirros-
$ nova resize test01 m1.tiny
$ nova flavor-delete 10
$ nova resize-revert test01
Before applying this patch: b0d3e016- 9608-4a87- a0cc-44dfe00b25 a1)
$ nova resize-revert test01
ERROR: The server could not comply with the request since it is
either malformed or otherwise incorrect. (HTTP 400) (Request-ID:
req-
$
After applying this patch: 33f2-4258- b522-674a1023ea 74)
$ nova resize-revert test01
ERROR: Flavor used by the instance could not be found. (HTTP 400)
(Request-ID: req-ed4ce174-
$
Fixes bug 1091490
Change-Id: I39dd23a7565ae6 6544e8bc2aa7ad3 299eb61bfcc