Adding current project as flavor access is throwing an error

Bug #1286297 reported by Santiago Baldassin
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Santiago Baldassin
OpenStack Dashboard (Horizon)
Invalid
Undecided
Unassigned

Bug Description

Steps to reproduce

1. Create a new flavor, setting and add the current project as flavor access
2. The flavor is created but an error is displayed saying "Unable to set flavor access for project....."

The error is thrown because Horizon creates the flavor and add the access after that. The problem is that once a private flavor is created, nova adds the current project within the flavor accesses so when Horizon tries to add the access, nova throws an "Access already exist for this flavor" exception

Tags: nova
Changed in horizon:
assignee: nobody → Santiago Baldassin (santiago-b-baldassin)
description: updated
summary: - Creating a flavor with access is throwing an error
+ Adding current project as flavor access is throwing an error
description: updated
Changed in nova:
assignee: nobody → Santiago Baldassin (santiago-b-baldassin)
Revision history for this message
Santiago Baldassin (santiago-b-baldassin) wrote :

I see two alternatives to solve the issue.
1. Avoid adding the current project when a non public flavor is created
2. in Horizon, before adding the tenants selected by the user, remove all flavor access that already exist.

Revision history for this message
Meena Pitchiah (meena-pitchiah) wrote :

1. Creating a flavor first without adding any projects and adding current project to the access list after flavor creation throws this error :
"Error: Modified flavor information, but unable to modify flavor access."

2. Creating a flavor with current project added to the access list throws this error :
"Error: Unable to set flavor access for project <project ID>."

3. Creating new flavor with any other project other than current on the access list, is successful.

Revision history for this message
Santiago Baldassin (santiago-b-baldassin) wrote :

1 and 2 have the same root cause. Flavor creation and access list update are two different process, when nova creates the flavor, the current project is added to the flavor access list so when the access list update takes place nova fails saying that the current project was already added

Revision history for this message
Santiago Baldassin (santiago-b-baldassin) wrote :

I've already fix this in my local repo doing the following:
Not adding the tenant to the flavor list if the tenant is the current one
Adding an explanation in the modal saying that the current tenant will be added by default if the flavor is not public.

I just need the bug to be confirmed before I can create the review in gerrit

Revision history for this message
Julie Pichon (jpichon) wrote :

If you have a patch ready, there's no need to wait on the bug status to change in order to propose it.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/79916

Changed in horizon:
status: New → In Progress
Tracy Jones (tjones-i)
tags: added: console
tags: added: compute
removed: console
Revision history for this message
John Garbutt (johngarbutt) wrote :

Not sure why this affects nova? Can you give more details, sounds like the API is being used incorrectly?

Changed in nova:
status: New → Incomplete
Revision history for this message
Santiago Baldassin (santiago-b-baldassin) wrote :

It affects nova because the way, the api is implemented would not let the user create private flavors for other projects than the current one. Let's say I'm an admin and I want to create different private flavors for different projects then I have to switch projects every time I want to create a new flavor

Changed in nova:
status: Incomplete → New
Revision history for this message
Kieran Spear (kspear) wrote :

Agree that this is partly a Nova issue. The behaviour of the create flavor API was changed in a backwards-incompatible way in Icehouse-1.

https://bugs.launchpad.net/nova/+bug/1209101

Commit:
https://github.com/openstack/nova/commit/6ba248635b70860a44e486e7739efa4cc6612ce6#diff-46d9a1430ccd8406e9dae8eee9e1f699R82

I think this was a mistake. The fix should have been in novaclient. This behaviour in Nova makes the API more complicated and harder to work with.

Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/81356

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Santiago Baldassin (santiago-b-baldassin) wrote :

Won't be fixed in nova as it would introduce backward incompatibility

Revision history for this message
Christopher Yeoh (cyeoh-0) wrote :

Yes so it looks we've made a backwards incompatible change in the V2 API. Which we really shouldn't have done, but its been merged since October and given we have CD we probably need to keep it now. Sorry.

Revision history for this message
Julie Pichon (jpichon) wrote :

Link to the openstack-dev thread about backwards-incompatible changes and this one in particular: http://lists.openstack.org/pipermail/openstack-dev/2014-March/030508.html

Revision history for this message
Christopher Yeoh (cyeoh-0) wrote :

I think we have reasonable consensus to proceed with the revert. Just waiting until Wednesday 2014/3/26 to give people on the operators list more time to respond.

Changed in nova:
importance: Undecided → Critical
milestone: none → icehouse-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/81356
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=daedfffd95b375f00deacb43b6de5e02ddde6df4
Submitter: Jenkins
Branch: master

commit daedfffd95b375f00deacb43b6de5e02ddde6df4
Author: Santiago Baldassin <email address hidden>
Date: Tue Mar 18 16:54:26 2014 -0300

    Do not add current tenant to private flavor access

    Avoid adding the current tenant to the flavor access list when
    a private flavor is created. In ordeir to add tenants to the
    flavor access list we should use the add_tenant api.

    Tempest has to be updated accordingly:
    https://review.openstack.org/81551

    Documentation has to be updated as well:
    https://review.openstack.org/82175

    Partially (just for the V2 API rather than V2 and V3)
    reverts commit 6ba248635b70860a44e486e7739efa4cc6612ce6

    Fixes unittest which was added in the original commit so it checks
    for the behaviour we have now rather than the behaviour after the
    backwards incompatible change which is being reverted.

    Change-Id: I731081b6df0d96df1bc1763d214d28c62bbbb51c
    Closes-Bug: #1286297

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Santiago Baldassin (<email address hidden>) on branch: master
Review: https://review.openstack.org/79943

Akihiro Motoki (amotoki)
tags: added: nova
removed: compute
Revision history for this message
Akihiro Motoki (amotoki) wrote :

I checked the master branch of Horizon, and the reported issues no longer occurs.
Nova fix is sufficient and there seems no action in Horizon.

Changed in horizon:
status: In Progress → Confirmed
assignee: Santiago Baldassin (santiago-b-baldassin) → nobody
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.