<br><br><div class="gmail_quote">On Tue, Jul 31, 2012 at 12:30 AM, Nati Ueno <span dir="ltr"><<a href="mailto:nati.ueno@gmail.com" target="_blank">nati.ueno@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Dan<br>
<div class="im"><br>
>> > Matt<br>
>> Thank you for your comment in launchpad<br>
>> <a href="https://bugs.launchpad.net/nova/+bug/1031096" target="_blank">https://bugs.launchpad.net/nova/+bug/1031096</a><br>
>><br>
>><br>
>> Quantum team get consensus in a Netstack meeting today to propose<br>
>> port-id for requested networks. I took the job.<br>
>> At first, i thought i can write extension for this. But as you say<br>
>> we should add port-id for the core API which is only used for quantum API<br>
>> 2.0.<br>
><br>
><br>
> Hi Nachi, why is it that we can't implement this as an API extension (even<br>
> if passing in a network-id is in fact part of the core API)?<br>
<br>
</div>I can write extension implemented in core API code.<br>
My understanding of definition of extension was "the code is in<br>
extension directory".<br>
However , the implementation for extensions are also in outside of<br>
extension directory as you mentioned in bug report.<br>
# I could see no clear policy for this.<br>
<br>
IMO, the key concept of extension is let users to select the function<br>
to use. ( User can turn off the extension. )<br>
So if we enable port_id when we use quantumV2 only, the concept will<br>
be satisfied.<br></blockquote><div><br></div><div>I tend to agree with that definition, assuming the nova folks do not have issues with it.</div><div><br></div><div>Dan</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Nachi<br>
<div class="HOEnZb"><div class="h5"><br>
> dan<br>
><br>
><br>
>><br>
>> My WIP code is like [1]. This change keep backward compatibility.<br>
>><br>
>> > Yong, Dan<br>
>> Matt said "you'd be breaking API compatibility and thus the API spec."<br>
>><br>
>> This work will change API, so some consensus in community is needed to<br>
>> add port_id.<br>
>> I wanna discuss about the spec in this thread.<br>
>> If the community rejects this addition, I'll implement fixed_ip one<br>
>> ( see previous my message )<br>
>><br>
>> [1] WIP code for adding port_id ( Not tested)<br>
>><br>
>> + def _get_port(self, port_id):<br>
>> + if FLAGS.network_api_class !=<br>
>> + "nova.network.quantumv2.api.API":<br>
>> + msg = _("Unknown argment : port_id")<br>
>> + raise exc.HTTPBadRequest(explanation=msg)<br>
>> +<br>
>> + if port_id and not utils.is_uuid_like(port_id):<br>
>> + msg = _("Bad port format: port uuid is "<br>
>> + "not in proper format "<br>
>> + "(%s)") % port_id<br>
>> + raise exc.HTTPBadRequest(explanation=msg)<br>
>> + try:<br>
>> + port =<br>
>> quantumv2.get_client(context).list_networks(**search_opts)<br>
>> + if port.device_id:<br>
>> + raise Exception("Port id %s is already used" % port_id)<br>
>> + return port<br>
>> + except Exception as e:<br>
>> + msg = _("This port_id can't used "<br>
>> + "(%s)") % port_id<br>
>> + raise exc.HTTPBadRequest(explanation=msg)<br>
>> +<br>
>> def _get_requested_networks(self, requested_networks):<br>
>> """Create a list of requested networks from the networks<br>
>> attribute."""<br>
>> networks = []<br>
>> for network in requested_networks:<br>
>> try:<br>
>> + port_id = network.get('port_id', None)<br>
>> + if port_id:<br>
>> + port = self._get_port()<br>
>> + network['uuid'] = port.network_id<br>
>> + network['fixed_ip'] = port.fixed_ip<br>
>> +<br>
>><br>
>> Thank you in advance<br>
>> Nachi Ueno<br>
>><br>
>> >> Hi Nachi,<br>
>> >> It is seemingly a way to make it work, but I think we are thinking to<br>
>> >> provide 'port-id' or just 'port' to specify the top resource in quantum<br>
>> >> API.<br>
>> >> fix ip is not one.<br>
>> >><br>
>> >> Besides, Port can be assigned to more than one fixed IP.<br>
>> ><br>
>> >Ah, It it true.<br>
>> >OK I'll implement port id version.<br>
>> ><br>
>> >> Imagine in horizon, we created many networks, ports and subnets, but<br>
>> >> when<br>
>> >> booting a VM, we use a fixed_ip to specify our resource indirectly.<br>
>> ><br>
>> >> By the way, we should use <a href="mailto:openstack-dev@list.openstack.org">openstack-dev@list.openstack.org</a><br>
>> ><br>
>> >Sorry, I changed my mail address recently. But launchpad rejects new<br>
>> >mail to receive.<br>
>> >I'll find way to fix this.<br>
>> ><br>
>> >Thanks<br>
>> ><br>
>> ><br>
>> >Nachi<br>
>> ><br>
>> >> Thanks<br>
>> >> Yong Sheng Gong<br>
>> >><br>
>> >> -----netstack-bounces+gongysh=<a href="mailto:cn.ibm.com@lists.launchpad.net">cn.ibm.com@lists.launchpad.net</a> wrote:<br>
>> >> -----<br>
>> >> To: <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a>, <a href="mailto:netstack@lists.launchpad.net">netstack@lists.launchpad.net</a><br>
>> >> From: Nachi Ueno<br>
>> >> Sent by: netstack-bounces+gongysh=<a href="mailto:cn.ibm.com@lists.launchpad.net">cn.ibm.com@lists.launchpad.net</a><br>
>> >> Date: 07/31/2012 08:33AM<br>
>> >> Subject: [Netstack] [Quantum][Nova] requested_id and port spec<br>
>> >><br>
>> >> Hi Dan,folks<br>
>> >><br>
>> >> As we talked in netstack IRC meetins, I submit this as bug.<br>
>> >> <a href="https://bugs.launchpad.net/nova/+bug/1031096" target="_blank">https://bugs.launchpad.net/nova/+bug/1031096</a><br>
>> >><br>
>> >> I tried to write this, but the code looks very ugly in order to keep<br>
>> >> backward compatibility.<br>
>> >> So I wanna propose an alternative design.<br>
>> >> In this design, we will use fixed_ip as a temporary identifier of the<br>
>> >> port.<br>
>> >><br>
>> >> 1. create port<br>
>> >> fixed_ip assigned<br>
>> >><br>
>> >> 2. specify the fixed_ip in nova boot<br>
>> >><br>
>> >> 3. If the fixed_ip is specified,<br>
>> >> nova.network.quantumv2.api.API will check existing port who use the<br>
>> >> fixed_ip.<br>
>> >><br>
>> >> if there are existing port and device_id is None<br>
>> >> use the port_id.<br>
>> >><br>
>> >> if there are no existing port.<br>
>> >> create new port with the fixed_ip<br>
>> >><br>
>> >> This approach needs no client side change.<br>
>> >><br>
>> >> Thank you in advance<br>
>> >> Nachi Ueno<br>
>> >><br>
>> >> --<br>
>> >> Mailing list: <a href="https://launchpad.net/~netstack" target="_blank">https://launchpad.net/~netstack</a><br>
>> >> Post to : <a href="mailto:netstack@lists.launchpad.net">netstack@lists.launchpad.net</a><br>
>> >> Unsubscribe : <a href="https://launchpad.net/~netstack" target="_blank">https://launchpad.net/~netstack</a><br>
>> >> More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
>> >><br>
>> >--<br>
>> >Nachi Ueno<br>
>> ><a href="mailto:email%3Anati.ueno@gmail.com">email:nati.ueno@gmail.com</a><br>
>> >twitter:<a href="http://twitter.com/nati" target="_blank">http://twitter.com/nati</a><br>
>><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">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><br>
><br>
><br>
><br>
><br>
> --<br>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
> Dan Wendlandt<br>
> Nicira, Inc: <a href="http://www.nicira.com" target="_blank">www.nicira.com</a><br>
> twitter: danwendlandt<br>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
><br>
<br>
<br>
<br>
--<br>
Nachi Ueno<br>
<a href="mailto:email%3Anati.ueno@gmail.com">email:nati.ueno@gmail.com</a><br>
twitter:<a href="http://twitter.com/nati" target="_blank">http://twitter.com/nati</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Dan Wendlandt <div>Nicira, Inc: <a href="http://www.nicira.com" target="_blank">www.nicira.com</a><br><div>twitter: danwendlandt<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~<br></div></div><br>