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

unicell unicell at gmail.com
Mon Aug 27 06:10:26 UTC 2012


Zhiteng,

Sorry for the late reply. To me, I think it (API) should provide some
message indicating user is querying against public flavor type. There's two
reasons for doing this, as I mentioned before, mainly to differentiate
private flavor with no associated projects.

In the latest patchset, I chose 'ALL TENANTS' string to deliver this
message. Since this message is replied under 'tenant_id' section in the
following format, and should be self-explanatory as well. I think 'ALL
TENANTS' should be a reasonable choice.

>> {'flavor_access': [{'flavor_id': '1', 'tenant_id': 'ALL TENANTS'}]}

Long sentence, as you suggested, could make it more self-explanatory, but
in the other way it could be harmful to the semantics of 'tenant_id'
section.

So far, I'd like to keep the way it is, if no other better choice.

Best Regards,
--
Qiu Yu
http://www.unicell.info

On Sat, Aug 25, 2012 at 3:59 PM, Huang Zhiteng <winston.d at gmail.com> wrote:

> 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
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120827/0451e814/attachment.html>


More information about the OpenStack-dev mailing list