Thanks Yunhong,<div><br></div><div>I picked your changes for flavors.py from your review to give it a try in my setup. I wrote a little python script to create a flavor id and set_key using the new RESTful apis that you defined. After creating the flavor, when I try to set the key I am getting error message from the nova side. </div>
<div>Do I need pick to any changes from nova side to make it work? I can send you my sample code and error message privately or put it on the mailing list if that helps. </div><div><br></div><div>Vinay<br><br><div class="gmail_quote">
On Sat, Sep 8, 2012 at 6:42 AM, Jiang, Yunhong <span dir="ltr"><<a href="mailto:yunhong.jiang@intel.com" target="_blank">yunhong.jiang@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div lang="ZH-CN" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">The extra_specs do have the RESTful interface as “/flavors/flavor_type/os-extra_specs”. You can refer to
<a href="https://review.openstack.org/#/c/10768/" target="_blank"><span style="color:#1f497d;text-decoration:none">https://review.openstack.org/#/c/10768/</span></a> for some changes. (I didn’t update the patch because I’m recently busy on another task, and will restore that
 patch when I finish current task).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">--jyh<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Dugger, Donald D
<br>
<b>Sent:</b> Saturday, September 08, 2012 4:28 AM<br>
<b>To:</b> Vinay Bannai; Patrick Petit; Jiang, Yunhong<br>
<b>Cc:</b> <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a> (<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>)<br>
<b>Subject:</b> RE: [Openstack] [Nova] Instance Type Extra Specs clarifications<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Well, Yunhong added the API to allow you to update the extra specs table so he should be able to give you the details on that (he’s in China, he
 might not get back to you until next week).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Also, make sure you add a scope (where scope is a string followed by a `:’ at the beginning of the key) to whatever key you are adding to the extra
 specs table, otherwise your key will create problems with some of the scheduler filters.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">--<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">Don Dugger<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">"Censeo Toto nos in Kansa esse decisse." - D. Gale<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">Ph: <a href="tel:303%2F443-3786" value="+13034433786" target="_blank">303/443-3786</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Vinay Bannai
<a href="mailto:[mailto:vbannai@gmail.com]" target="_blank">[mailto:vbannai@gmail.com]</a> <br>
<b>Sent:</b> Friday, September 07, 2012 2:20 PM<br>
<b>To:</b> Patrick Petit<br>
<b>Cc:</b> Dugger, Donald D; <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a> (<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>)<br>

<b>Subject:</b> Re: [Openstack] [Nova] Instance Type Extra Specs clarifications<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Hello all,<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I am part of the SF south bay meetup group and trying to add a Disk I/O QoS feature which is based on the blkiotune in libvirt. <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">We would like to add flavor types in which we specify the blkiotune in the create flavor screen. After reviewing the discussions and some emails it appears that it makes sense to use the "instance_type_extra_specs" to
 add the blkiotune as a key/value pair instead of extending the "instance_type" table in nova db. <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I am able to use nova-manage to create instance type and use "set_key" to add extra specs. The set_key seems to make a direct call to the db to insert the keys whereas the instance_type create takes the more traditional
 path through the flavomanage controller. However I notice that there is no documentation on how to add the extra_specs keys using a RESTful api. Is this something still in discussions? <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Thanks<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Vinay<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On Tue, Aug 28, 2012 at 8:02 AM, Patrick Petit <<a href="mailto:patrick.michel.petit@gmail.com" target="_blank">patrick.michel.petit@gmail.com</a>> wrote:<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">Hi Don,<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I added a comment in <a href="https://bugs.launchpad.net/nova/+bug/1039386" target="_blank">https://bugs.launchpad.net/nova/+bug/1039386</a> regarding your point.<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Patrick<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">2012/8/24 Dugger, Donald D <<a href="mailto:donald.d.dugger@intel.com" target="_blank">donald.d.dugger@intel.com</a>><u></u><u></u></span></p>
<div>
<div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Patrick-</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">We’ve enhanced `nova-manage’ to manipulate the `extra_specs’ entries, c.f.
<a href="https://blueprints.launchpad.net/nova/+spec/update-flavor-key-value" target="_blank">
https://blueprints.launchpad.net/nova/+spec/update-flavor-key-value</a>,   You can add an `extra_specs’ key/value pair to a flavor with the command:</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">                nova-manage instance_type add_key m1.humongous cpu_type itanium</span><span lang="EN-US"><u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">And delete a key/value pair with the command:</span><span lang="EN-US"><u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">                nova-manage instance_type del_key m1.humongous cpu_type</span><span lang="EN-US"><u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">We’re in the process of enhancing `python-novaclient’ and Horizon with similar capabilities
 and hope to have them ready for the Folsom release.</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Currently, there’s no hook to set `extra_specs’ through the `nova.conf’ file, the mechanism
 is to dynamically add the `extra_specs’ key/values after the administrator has created a flavor.</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Currently, the keys are completely free form but there are some issues with that so
 that should change.  Checkout the bug:</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">               
<a href="https://bugs.launchpad.net/nova/+bug/1039386" target="_blank">https://bugs.launchpad.net/nova/+bug/1039386</a></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Based upon that bug we need to put some sort of scope on the keys to indicate which
 components a key applies to. I’m in favor of adding a new column to the `extra_specs’ table that would explicitly set the scope but an alternative would be to encode the scope into the key itself, something like `TrustedFilter:trust’ to indicate that  the
 `trust’ key only applies to the `TrustedFilter’ scheduler component.  Feel free to chime in on the BZ entry on how to specify the scope, once we decide on how to deal with this I’ll create a patch to handle it.</span><span lang="EN-US"><u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">--</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">Don Dugger</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">"Censeo Toto nos in Kansa esse decisse." - D. Gale</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Consolas;color:#1f497d">Ph:
<a href="tel:303%2F443-3786" target="_blank">303/443-3786</a></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><span lang="EN-US"><u></u><u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> openstack-bounces+donald.d.dugger=<a href="mailto:intel.com@lists.launchpad.net" target="_blank">intel.com@lists.launchpad.net</a>
 [mailto:<a href="mailto:openstack-bounces%2Bdonald.d.dugger" target="_blank">openstack-bounces+donald.d.dugger</a>=<a href="mailto:intel.com@lists.launchpad.net" target="_blank">intel.com@lists.launchpad.net</a>]
<b>On Behalf Of </b>Patrick Petit<br>
<b>Sent:</b> Friday, August 24, 2012 7:13 AM<br>
<b>To:</b> <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a> (<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>)<br>
<b>Subject:</b> [Openstack] [Nova] Instance Type Extra Specs clarifications</span><span lang="EN-US"><u></u><u></u></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Could someone give a practical overview of how configuring and using the instance type extra specs extension capability introduced in Folsom?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">If how extending an instance type is relatively clear.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Eg.: #nova-manage instance_type set_key --name=<my.instancetype> --key <cpu_arch> --value <'s== x86_64'> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">The principles of capability advertising is less clearer. Is it assumed that the key/value pairs are always declared statically as flags in nova.conf of the compute
 node, or can they be generated dynamically and if so, who would that be? And also, are the keys completely free form strings or strings that are known (reserved) by Nova?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance for clarifying this.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Patrick<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US" style="color:#888888"><br>
<br clear="all">
<span><u></u><u></u></span></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal"><span><span lang="EN-US" style="color:#888888">--
</span></span><span lang="EN-US" style="color:#888888"><br>
<span><i>"Give me a place to stand, and I shall move the earth with a lever"</i></span></span><span lang="EN-US"><u></u><u></u></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><br>
<br clear="all">
<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">-- <br>
Vinay Bannai<br>
Email: <a href="mailto:vbannai@gmail.com" target="_blank">vbannai@gmail.com</a><br>
Google Voice: <a href="tel:415%20938%207576" value="+14159387576" target="_blank">415 938 7576</a><u></u><u></u></span></p>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br>Vinay Bannai<br>Email: <a href="mailto:vbannai@gmail.com">vbannai@gmail.com</a><br>Google Voice: 415 938 7576<br><br>
</div>