Bug 1326625

Summary: Nova client should not fail when displaying instances with deleted private flavors
Product: Red Hat OpenStack Reporter: Michal Pryc <mpryc>
Component: openstack-novaAssignee: melanie witt <mwitt>
Status: CLOSED WONTFIX QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0 (Liberty)CC: berrange, charcrou, cstpierr, dasmith, eglynn, jdonohue, kchamart, mpryc, nlevinki, sbauza, sferdjao, sgordon, srevivo, vromanso
Target Milestone: ---Keywords: ZStream
Target Release: 8.0 (Liberty)Flags: mwitt: needinfo?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1314866 Environment:
Last Closed: 2016-05-13 15:44:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1194008    

Comment 1 Michal Pryc 2016-04-13 08:43:46 UTC
*** Bug 1314866 has been marked as a duplicate of this bug. ***

Comment 2 melanie witt 2016-05-05 18:14:41 UTC
There was a fix in novaclient merged upstream that prevents failure when showing instances with unavailable flavors: https://review.openstack.org/#/c/170839/

That is, instead of failing, the CLI will say, "Flavor not found" in the situation. This doesn't affect Horizon. Horizon shows it as "Not available" today already.

For the nova patch upstream, it's in -2 state, so I don't think it's a good idea to backport. While the deleted private flavor makes some sense to show on the instance, I don't think the modified flavor makes sense to show. If it's been modified, then it's not accurately describing the attributes of the instance. For example, if the flavor at boot time had 1 VCPU and the flavor is later changed to 2 VCPU, we don't want the display of the instance to say 2 VCPU because it has only 1 VCPU.

So, I think we could backport the novaclient CLI patch if it would be helpful, and we could revisit the nova patch upstream to see if it could be reconsidered in the deleted flavor case as the modified flavor case doesn't make sense, IMHO. Note there is other work in progress to make flavors hard-delete only, so showing a deleted flavor will be impossible in the future.

Comment 3 melanie witt 2016-05-06 16:23:31 UTC
(In reply to melanie witt from comment #2)
> There was a fix in novaclient merged upstream that prevents failure when
> showing instances with unavailable flavors:
> https://review.openstack.org/#/c/170839/
> 
> That is, instead of failing, the CLI will say, "Flavor not found" in the
> situation. This doesn't affect Horizon. Horizon shows it as "Not available"
> today already.
> 
> For the nova patch upstream, it's in -2 state, so I don't think it's a good
> idea to backport. While the deleted private flavor makes some sense to show
> on the instance, I don't think the modified flavor makes sense to show. If
> it's been modified, then it's not accurately describing the attributes of
> the instance. For example, if the flavor at boot time had 1 VCPU and the
> flavor is later changed to 2 VCPU, we don't want the display of the instance
> to say 2 VCPU because it has only 1 VCPU.
> 
> So, I think we could backport the novaclient CLI patch if it would be
> helpful, and we could revisit the nova patch upstream to see if it could be
> reconsidered in the deleted flavor case as the modified flavor case doesn't
> make sense, IMHO. Note there is other work in progress to make flavors
> hard-delete only, so showing a deleted flavor will be impossible in the
> future.

Correction: Nova API has only flavor create and delete. Horizon presents a "Edit Flavor" button, which does a delete of the old flavor and a create of a new one with the edits. So the upstream nova patch would indeed work in both cases because both cases are about the original flavor at boot time is in deleted state. It's a matter of whether or not we want to backport something which has not merged upstream, combined with the fact that in the future showing of deleted flavors won't be possible as they will be hard-deleted.

Comment 4 melanie witt 2016-05-10 17:19:22 UTC
I found the novaclient patch that prevents failing when displaying deleted flavors [1] is already part of novaclient rhos-8.0-rhel-7 (upstream novaclient 3.1.0). So it appears there is nothing to do here. Please let me know if that's not the case.

[1] https://review.openstack.org/#/c/170839/

Comment 5 melanie witt 2016-05-13 15:44:54 UTC
Upstream, the work [1] that moved flavors to the API database was completed and soft-delete capability was removed. So, it's not possible to show deleted flavors today.

However, a copy of flavor attributes for an instance is stored alongside the instance, but is not yet accessible via any API. There is a spec [2] that proposes to add an API for querying flavor information from an instance. If this work is done, it will enable the flavor of an instance to be shown throughout the life of the instance.


[1] https://blueprints.launchpad.net/nova/+spec/flavor-cell-api
[2] https://review.openstack.org/#/c/265282/