Bug 1101293
| Summary: | If anyone create private flavor then, it do not appear in "nova flavor-list" command but, it appears if we pass "--all" flag with the command. Also, we cant use flavor name while creating instance but, it accepts the flavor ID. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Pratik Pravin Bandarkar <pbandark> | ||||
| Component: | python-novaclient | Assignee: | Daniel Berrangé <berrange> | ||||
| Status: | CLOSED ERRATA | QA Contact: | nlevinki <nlevinki> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 4.0 | CC: | calba, jruzicka, lyarwood, ndipanov, sclewis, sgordon, slong, yeylon | ||||
| Target Milestone: | z3 | Keywords: | TestOnly, ZStream | ||||
| Target Release: | 6.0 (Juno) | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | python-novaclient-2.20.0-1.el7ost | Doc Type: | Bug Fix | ||||
| Doc Text: |
Previously, only public flavours were considered when looking up a flavour based on name. It was therefore not possible to boot an image using a private flavour's name, even if it was accessible to the tenant user. The user had to boot the image using the flavour ID instead of its name.
With this update, the flavour name lookup has been changed to consider all accessible flavours, not just public ones. The name of any flavour to which the tenant user has permission to access can now be used when booting an instance.
|
Story Points: | --- | ||||
| Clone Of: | |||||||
| : | 1212608 1212609 (view as bug list) | Environment: | |||||
| Last Closed: | 2015-05-05 13:29:47 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: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1212608, 1212609 | ||||||
| Attachments: |
|
||||||
|
Description
Pratik Pravin Bandarkar
2014-05-26 16:20:15 UTC
Created attachment 899330 [details]
nova with debug output
The following change to nova client would fix both these problems, however, it is a change in semantics of the default client behaviour. Given the semantic change, I need to take this upstream first to get agreement before we can change it in RHOS
$ git diff
diff --git a/novaclient/v1_1/flavors.py b/novaclient/v1_1/flavors.py
index c47c476..b1e7d59 100644
--- a/novaclient/v1_1/flavors.py
+++ b/novaclient/v1_1/flavors.py
@@ -101,7 +101,7 @@ class FlavorManager(base.ManagerWithFind):
resource_class = Flavor
is_alphanum_id_allowed = True
- def list(self, detailed=True, is_public=True):
+ def list(self, detailed=True, is_public=None):
"""
Get a list of all flavors.
Upstream fix is
commit d17253b29a5b7b422538c6496239cf713be627a3
Author: Daniel P. Berrange <berrange>
Date: Fri Jun 6 14:23:17 2014 +0100
Look for all accessible flavors by default, not just public ones
The Nova server will restrict unprivileged user accounts to just
public images, while allowing administrator accounts access to
all. The Nova client shouldn't force the flavor name lookup to
be restricted to just public images, since that breaks the ability
to the flavor name when booting an instance
Fixes bug #1327212
Change-Id: I949aec52660242249b8cba51d77bfdc1acaf31d2
NB, this only fixes the 2nd part of the reporters problem.
ie it makes it possible to use the name of a private image with nova boot & similar commands. eg
# nova boot --flavor test1234 --image cb272dd7-a9a8-41ab-bf25-5f791acc60e7 test_vm
should now work.
Nova flavor-list will *still* require the --all flag to be passed to see private flags. The need for this --all flag was an explicit decision upstream, not a bug.
This fix is included upstream novaclient 2.18.0 and it's going to be included in next Juno novalcient update. Nova flavor-list will *still* require the --all flag to be passed to see private flags. The need for this --all flag was an explicit decision upstream, not a bug.
nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
[root@dhcp-2-211 ~(keystone_admin)]# nova flavor-create --is-public False test1234 21 2048 20 1
+----+----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+----------+-----------+------+-----------+------+-------+-------------+-----------+
| 21 | test1234 | 2048 | 20 | 0 | | 1 | 1.0 | False |
+----+----------+-----------+------+-----------+------+-------+-------------+-----------+
[root@dhcp-2-211 ~(keystone_admin)]# nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
[root@dhcp-2-211 ~(keystone_admin)]# nova flavor-list --all
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 21 | test1234 | 2048 | 20 | 0 | | 1 | 1.0 | False |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
[root@dhcp-2-211 ~(keystone_admin)]# glance image-list
+--------------------------------------+--------+-------------+------------------+----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------+-------------+------------------+----------+--------+
| fc4450fa-82bd-4d56-8087-340103dfe5af | cirros | qcow2 | bare | 13200896 | active |
+--------------------------------------+--------+-------------+------------------+----------+--------+
[root@dhcp-2-211 ~(keystone_admin)]# nova boot --flavor test1234 --image fc4450fa-82bd-4d56-8087-340103dfe5af nati1
+--------------------------------------+-----------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | |
| OS-EXT-SRV-ATTR:host | - |
| OS-EXT-SRV-ATTR:hypervisor_hostname | - |
| OS-EXT-SRV-ATTR:instance_name | instance-00000001 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | dpT4agiP5b4u |
| config_drive | |
| created | 2015-04-26T13:20:30Z |
| flavor | test1234 (21) |
| hostId | |
| id | f6f2ed4d-82cc-4934-8d2f-6a1ee63e6fa9 |
| image | cirros (fc4450fa-82bd-4d56-8087-340103dfe5af) |
| key_name | - |
| metadata | {} |
| name | nati1 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | 8d08c9e81401414291a04d978fa355c8 |
| updated | 2015-04-26T13:20:30Z |
| user_id | 04fe018bd8bb428c8edb732ae3fdd704 |
+--------------------------------------+-----------------------------------------------+
[root@dhcp-2-211 ~(keystone_admin)]# nova list
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| f6f2ed4d-82cc-4934-8d2f-6a1ee63e6fa9 | nati1 | BUILD | spawning | NOSTATE | public=172.24.4.227 |
+--------------------------------------+-------+--------+------------+-------------+---------------------+
[root@dhcp-2-211 ~(keystone_admin)]# nova list
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| f6f2ed4d-82cc-4934-8d2f-6a1ee63e6fa9 | nati1 | ACTIVE | - | Running | public=172.24.4.227 |
+--------------------------------------+-------+--------+------------+-------------+---------------------+
[root@dhcp-2-211 ~(keystone_admin)]#
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0931.html |