Non-public flavor cannot be used in created tenant

Bug #1209101 reported by fujioka yuuichi
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Sumanth Nagadavalli

Bug Description

Non-public flavor cannot use in created tenant.
If user run "nova flavor-access-add", It becomes available.

The following message is written to the OpenStack Compute Administration Guide
"Is_Public: Boolean value, whether flavor is available to all users or private to the
tenant it was created in. Defaults to True."

Actual:

$ OS_USERNAME=admin OS_TENANT_NAME=demo nova flavor-create --is-public false secret.1 auto 512 0 1
+--------------------------------------+----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+----------+-----------+------+-----------+------+-------+-------------+-----------+
| 47d227f2-8942-451c-b73b-90adcc8985d0 | secret.1 | 512 | 0 | 0 | | 1 | 1.0 | False |
+--------------------------------------+----------+-----------+------+-----------+------+-------+-------------+-----------+
$
$ OS_USERNAME=demo OS_TENANT_NAME=demo nova boot --flavor 47d227f2-8942-451c-b73b-90adcc8985d0 --image cirros-0.3.1-x86_64-uec foo
ERROR: No flavor with a name or ID of '47d227f2-8942-451c-b73b-90adcc8985d0' exists.
$
$ OS_USERNAME=admin nova flavor-access-add 47d227f2-8942-451c-b73b-90adcc8985d0 89fc2fa5c447419b8a6b3d8426154b6b
+--------------------------------------+----------------------------------+
| Flavor_ID | Tenant_ID |
+--------------------------------------+----------------------------------+
| 47d227f2-8942-451c-b73b-90adcc8985d0 | 89fc2fa5c447419b8a6b3d8426154b6b |
+--------------------------------------+----------------------------------+
$
$ OS_USERNAME=demo OS_TENANT_NAME=demo nova boot --flavor 47d227f2-8942-451c-b73b-90adcc8985d0 --image cirros-0.3.1-x86_64-uec foo
+--------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------+--------------------------------------+
| image | cirros-0.3.1-x86_64-uec |
| flavor | secret.1 |
| id | 34698740-cd43-4bf8-82a8-8674347d57d5 |
| security_groups | [{u'name': u'default'}] |
| user_id | a8f7158ae59a4d4ab2aafbe5de63dff6 |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| config_drive | |
| status | BUILD |
| updated | 2013-08-07T05:59:23Z |
| hostId | |
| key_name | None |
| name | foo |
| adminPass | 48gRi7qspeUL |
| tenant_id | 89fc2fa5c447419b8a6b3d8426154b6b |
| created | 2013-08-07T05:59:23Z |
| os-extended-volumes:volumes_attached | [] |
| metadata | {} |
+--------------------------------------+--------------------------------------+
$

Expected:

$ OS_USERNAME=admin OS_TENANT_NAME=demo nova flavor-create --is-public false secret.1 auto 512 0 1
+--------------------------------------+----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+----------+-----------+------+-----------+------+-------+-------------+-----------+
| 47d227f2-8942-451c-b73b-90adcc8985d0 | secret.1 | 512 | 0 | 0 | | 1 | 1.0 | False |
+--------------------------------------+----------+-----------+------+-----------+------+-------+-------------+-----------+
$
$ OS_USERNAME=demo OS_TENANT_NAME=demo nova boot --flavor 47d227f2-8942-451c-b73b-90adcc8985d0 --image cirros-0.3.1-x86_64-uec foo
+--------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------+--------------------------------------+
| image | cirros-0.3.1-x86_64-uec |
| flavor | secret.1 |
| id | 34698740-cd43-4bf8-82a8-8674347d57d5 |
| security_groups | [{u'name': u'default'}] |
| user_id | a8f7158ae59a4d4ab2aafbe5de63dff6 |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| config_drive | |
| status | BUILD |
| updated | 2013-08-07T05:59:23Z |
| hostId | |
| key_name | None |
| name | foo |
| adminPass | 48gRi7qspeUL |
| tenant_id | 89fc2fa5c447419b8a6b3d8426154b6b |
| created | 2013-08-07T05:59:23Z |
| os-extended-volumes:volumes_attached | [] |
| metadata | {} |
+--------------------------------------+--------------------------------------+
$

Changed in nova:
assignee: nobody → Sumanth Nagadavalli (sumanth-nagadavalli)
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/40811

Changed in nova:
status: New → In Progress
Alex Xu (xuhj)
Changed in nova:
importance: Undecided → Critical
status: In Progress → Won't Fix
status: Won't Fix → In Progress
importance: Critical → Undecided
Mathew Odden (locke105)
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/40811
Committed: http://github.com/openstack/nova/commit/6ba248635b70860a44e486e7739efa4cc6612ce6
Submitter: Jenkins
Branch: master

commit 6ba248635b70860a44e486e7739efa4cc6612ce6
Author: Sumanth Nagadavalli <email address hidden>
Date: Thu Aug 8 11:45:42 2013 +0530

    Create flavor-access for the tenant when creating
    a private flavor

    In FlavorManage extension, a change has been made to
    create flavor-access for a corresponding tenant on
    creating a private flavor

    This also requires the api-samples for flavor-access
    to be changed, since there will be a flavor-access created
    by default on creating a private flavor

    This commit has a DocImpact

    Change-Id: I7795fbd04ae9fc8b1ea6fb27203dfa5217d310ce
    Fixes: bug 1209101

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
Revision history for this message
s10 (vlad-esten) wrote :

Since kilo release nova is again affected by this problem. Somehow solution was removed for backward compatibility: https://github.com/openstack/nova/commit/2a81337a#diff-46d9a1430ccd8406e9dae8eee9e1f699L77

s10 (vlad-esten)
no longer affects: nova (Ubuntu)
Revision history for this message
s10 (vlad-esten) wrote :

This issue still exists in nova.
How to reproduce:
1. Set non-default policy.yaml, so user will be able to create private flavor, but it will never be able to add tenant access:
"os_compute_api:os-flavor-manage": "rule:admin_or_owner"
"os_compute_api:os-flavor-manage:create": "rule:os_compute_api:os-flavor-manage"
"os_compute_api:os-flavor-manage:delete": "rule:os_compute_api:os-flavor-manage"
"os_compute_api:os-flavor-access:add_tenant_access": "rule:admin_api"
"os_compute_api:os-flavor-access:remove_tenant_access": "rule:admin_api"
2. Create private flavor within tenant's project.
3. See, that there is no flavor access at all for this flavor.

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.