[openstack-dev] Discussion about response value in project-specific-flavor API

Huang Zhiteng winston.d at gmail.com
Sat Aug 25 07:59:56 UTC 2012


On Sat, Aug 25, 2012 at 11:53 AM, unicell <unicell at gmail.com> wrote:
> Hi Folks,
>
> In the review comments of my project-specific-flavor blueprint patch,
> https://review.openstack.org/#/c/11270/
> Kevin raised a question about response value for public flavor access list.
> And I'd like to posted here for discussion.
>
> Sorry for the following long description area, just to illustrate the
> background here.
> Please scroll down and you'll see the question at the end of this email.
>
> Quick Background
> --
> Project specific flavor is meant to give a flavor management choice that,
> some flavor (non-public) types are only accessible for some projects,
> instead of globally visible. And this flavor access list is manageable
> through this API and corresponding nova client bindings.
>
> Quick Demo
> --
> # Adding a new private flavor, and it is not accessible by default
> stack at precise64:~$ nova flavor-create --is_public false m1.special 801 512 0
> 1
> stack at precise64:~$ nova flavor-list
> +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
> | ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor
> | Is_Public |
> +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
> | 1  | m1.tiny   | 512       | 0    | 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      |
> +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
>
> # Adding the current project to flavor 801's access list
> stack at precise64:~$ nova flavor-access-add 801
> 55ea56479a6a48d699acb7afe22f00f7
> +-----------+----------------------------------+
> | Flavor_ID | Tenant_ID                        |
> +-----------+----------------------------------+
> | 801       | 55ea56479a6a48d699acb7afe22f00f7 |
> +-----------+----------------------------------+
>
> # Then this flavor (801) is accessible from this project.
> stack at precise64:~$ nova flavor-list
> +-----+------------+-----------+------+-----------+------+-------+-------------+-----------+
> | ID  | Name       | Memory_MB | Disk | Ephemeral | Swap | VCPUs |
> RXTX_Factor | Is_Public |
> +-----+------------+-----------+------+-----------+------+-------+-------------+-----------+
> | 1   | m1.tiny    | 512       | 0    | 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      |
> | 801 | m1.special | 512       | 0    | 0         |      | 1     | 1.0
> | False     |
> +-----+------------+-----------+------+-----------+------+-------+-------------+-----------+
>
> # Retrieve flavor 801 access information
> stack at precise64:~$ nova flavor-access-list --flavor 801
> +-----------+----------------------------------+
> | Flavor_ID | Tenant_ID                        |
> +-----------+----------------------------------+
> | 801       | 55ea56479a6a48d699acb7afe22f00f7 |
> +-----------+----------------------------------+
>
> # Retrieve public flavor access information
> stack at precise64:~$ nova flavor-access-list --flavor 1
> +-----------+-------------+
> | Flavor_ID | Tenant_ID   |
> +-----------+-------------+
> | 1         | ALL TENANTS |
> +-----------+-------------+
>
> Question
> --
> For the default public flavor types, is this "ALL TENANTS" an acceptable
> solution?  It was intended to provide a human readable message for public
> flaovrs. And, to differentiate from a non-public flavor with no project
> access configured.
>
> Any better way to approach? Or, just leave it as it is?
Well, to me, 'ALL TENANTS' is somewhat better than 'ALL' in your early
patchset.  I once tried to make a non-public flavor public by
'add-flavor-access' to an that flavor to the fake tenant 'ALL',
because I though the name 'ALL' has some magic.  How about a long
sentence to state that target is a public tenant?
>
> Best Regards,
> --
> Qiu Yu
> http://www.unicell.info
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Regards
Huang Zhiteng



More information about the OpenStack-dev mailing list