Hi all,

I have implemented this feature and it is fully functional now. I had to
upgrade Jclouds version to 1.8.1 in order to implement it using neutron
networking API.

Let me explain how it works now. I will past network interfaces section of
cartridge definition and explain each features implemented here.

"networkInterfaces":[
    {
        "name":"eth0",
        "networkUuid":"512e1f54-1e85-4dac-b2e6-f0b30fc552cf",
        "floatingNetworks":[
            {
                "name":"externalOne",
                "networkUuid":"ba667f72-7ba8-4b24-b360-b74a0211c83c"
            }
        ]
    },

// eth0 will get a fixed IP and a floating IP from floating network externalOne

    {
        "name":"eth1",
        "networkUuid":"68aab21d-fc9a-4c2f-8d15-b1e41f6f7bb8"
    },

// eth1 will get a fixed IP

    {
        "name":"eth2",
        "networkUuid":"b55f009a-1cc6-4b17-924f-4ae0ee18db5e",
        "floatingNetworks":[
            {
                "name":"externalThree",
                "floatingIP" : "192.168.17.227"
            }
        ]
    },

// eth2 will get a fixed IP and a predefined floating IP 192.168.17.227

// if predefined IP is not available, an exception will be thrown

    {
        "name":"eth3",
        "networkUuid":"d343d343-1cc6-4b17-924f-4ae0ee18db5e",
        "floatingNetworks":[
            {
                "name":"externalThree",
                "networkUuid":"ba667f72-7ba8-4b24-b360-b74a0211c83c",
                "floatingIP" : "192.168.17.227"
            }
        ]
    },

// eth3 will get a fixed IP and a floating IP from the floating
network externalThree

// point here is that we are giving priority to networkUuid to floatingIP

    {
        "name":"eth4",
        "portUuid":"d343d343-1cc6-4b17-924f-4ae0ee18db5e",
        "fixedIp":"10.5.62.3",
        "floatingNetworks":[
            {
                "name":"external",
                "networkUuid":"ba667f72-7ba8-4b24-b360-b74a0211c83c",
                "floatingIP" : "192.168.17.227"
            }
        ]
    },

// eth4 will get a predefined private IP 10.5.62.3 and a floating IP
from network external

    {
        "name":"eth5",
        "networkUuid":"d343d343-1cc6-4b17-924f-4ae0ee18db5e",
        "floatingNetworks":[
            {
                "name":"externalOne",
                "networkUuid":"ba667f72-7ba8-4b24-b360-b74a0211c83c",
                "floatingIP" : "192.168.17.227"
            },
            {
                "name":"externalTwo",
                "networkUuid":"sddsdsd-7ba8-4b24-b360-b74a0211c83c",
            }
        ]
    }

// eth5 will get a fixed IP and a predefined floating IP 192.168.17.227

// and a floating IP from the floating network externalTwo as well

// I couldn't test whether it is supported by openstack

// if openstack supports this, you can also achieve it in stratos

]


Please have look at the comments given in each network interfaces
definition.

And if you define multiple network interfaces and floating networks, if
even one IP allocation goes wrong, I am throwing exception and kill the
instance.

Having this implemented, now I am in the process of doing changes to some
topology events to incorporate multiple private/public IP addresses.

Please feel free to share your concerns.

Thanks.

On Fri, Nov 14, 2014 at 7:14 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
wrote:

> Update;
>
>
> On Fri, Nov 14, 2014 at 3:44 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
> wrote:
>
>> Update;
>>
>> Currently facing an issue with upstream openstack-neutron-1.8.1.jar.
>>
>> When I see the MANIFEST.MF file of openstack-neutron-1.8.1.jar, it
>> contains ${jclouds.version} in lot of places instead of actual version. Due
>> to this carbon feature installation is failing. Because it is processing
>> MANIFEST.MF and throwing number format exception.
>>
>> I conveyed this in user@jclouds. For workaround, I am going to manually
>> put the jar into /repository/components/lib and continue the work until it
>> is sorted out in upstream.
>>
>
> This is a bug. One sent a PR to solve it
>
> Thanks.
>
>>
>> Thanks.
>>
>> On Wed, Nov 12, 2014 at 4:48 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
>> wrote:
>>
>>>
>>>
>>> On Wed, Nov 12, 2014 at 4:37 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>>
>>>> Hi Raj,
>>>>
>>>> No I did not try since there were no multiple public networks available.
>>>>
>>>
>>> Okay Udara. I am setting up a second external network now. Will run a
>>> test soon.
>>>
>>> Thanks.
>>>
>>>>
>>>> On Wed, Nov 12, 2014 at 2:59 PM, Rajkumar Rajaratnam <
>>>> rajkum...@wso2.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Wed, Nov 12, 2014 at 2:52 PM, Udara Liyanage <ud...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Raj,
>>>>>>
>>>>>> If I remember correctly, we can't assign folating ip to the same port
>>>>>> multiple times even I try with Openstack UI.
>>>>>>
>>>>>
>>>>> Horizon UI doesn't support most of the operations. Yes we can't assign
>>>>> multiple floating IPs from the same external network to the same port. But
>>>>> I guess, we can assign multiple floating IPs from different external
>>>>> network to the same port. Did you try this scenario?
>>>>>
>>>>> Thanks.
>>>>>
>>>>>>
>>>>>> On Wed, Nov 12, 2014 at 2:47 PM, Rajkumar Rajaratnam <
>>>>>> rajkum...@wso2.com> wrote:
>>>>>>
>>>>>>> Hi Devs,
>>>>>>>
>>>>>>> I am working on $Subject. Please find the relevant JIRA at [1]
>>>>>>>
>>>>>>> Currently Stratos will assign a floating IP to eth0 if
>>>>>>> *autoAssignIp* property is set to false in cartridge definition.
>>>>>>> AFAIU, stratos is using jclouds API to query the available floating IPs,
>>>>>>> choose one and assign it to the instance. Correct me if this is not the
>>>>>>> case.
>>>>>>>
>>>>>>> In order to support $Subject, I am proposing the cartridge
>>>>>>> definition as below;
>>>>>>>
>>>>>>> { "type":"mysql", "provider":"data", "host":"apachestratos.org", "
>>>>>>> displayName":"MySQL", "description":"MySQL Cartridge", "version":"
>>>>>>> 5.5", "multiTenant":"false", "portMapping":[ { "protocol":"http", "
>>>>>>> port":"80", "proxyPort":"8280" } ], "deployment":{  }, "iaasProvider
>>>>>>> ":[ { "type":"openstack", "imageId":"
>>>>>>> RegionOne/1cd412c1-54ce-405f-9894-ce1387073c6c", "networkInterfaces":[
>>>>>>> { "name":"netOne", "networkUuid":"
>>>>>>> 84d52a6d-a9e5-472a-9935-a0e195fe5b4a", "fixedIp":"10.0.1.4" }, { "
>>>>>>> name":"netTwo", "networkUuid":"512e1f54-1e85-4dac-b2e6-f0b30fc552cf"
>>>>>>> , "publicNetworkUuids":[ { "name":"externalOne", "networkUuid":"
>>>>>>> 8f08a69d-cb46-43c9-9ebe-b89dcc78dacc", }, { "name":"externalTwo", "
>>>>>>> networkUuid":"b5504321-e7aa-4500-9e00-7bc1b10cb5e9", } ] }, { "name"
>>>>>>> :"netThree", "networkUuid":"b55f009a-1cc6-4b17-924f-4ae0ee18db5e", "
>>>>>>> publicNetworkUuids":[ { "name":"externalThree", "networkUuid":"
>>>>>>> 83d52a6d-a9e5-572a-9935-a0e195fe5b4r", } ] } ], "maxInstanceLimit":"
>>>>>>> 4", "property":[ { "name":"instanceType", "value":"RegionOne/4" },
>>>>>>> { "name":"keyPair", "value":"raj" }, { "name":"autoAssignIp", "value
>>>>>>> ":"false" } ] } ], "loadBalancer":{ "type":"lb", "property":{ "name"
>>>>>>> :"no.load.balancer", "value":"true" } }}
>>>>>>>
>>>>>>>
>>>>>>> So, I have introduced some additional elements here in networks
>>>>>>> section. publicNetworkUuids will hold one or many external network UUIDs
>>>>>>> from where you want to select one IP and assign it the corresponding
>>>>>>> interface. Let list me three behaviors, as of now, I have identified.
>>>>>>>
>>>>>>>    1. If *autoAssignIp* property is *true*, stratos will not do
>>>>>>>    anything regarding floating IPs when creating instances for this 
>>>>>>> cartridge.
>>>>>>>    But openstack will assign a floating IP to the instance.
>>>>>>>    2. If *autoAssignIp* property is *false*, and you *don't *specify
>>>>>>>    any publicNetworkUuids for any interface, then stratos will assign a
>>>>>>>    floating IP to the 1st interface
>>>>>>>    3. If *autoAssignIp* property is *false*, and you
>>>>>>>    specify publicNetworkUuids, then stratos will assign floating IPs per
>>>>>>>    interfaces for which you specified publicNetworkUuids. If you specify
>>>>>>>    two publicNetworkUuids for an interface, it will assign two floating 
>>>>>>> IPs to
>>>>>>>    that interface and so on.
>>>>>>>
>>>>>>>
>>>>>>> However, I tried to assign two floating IP addresses to an interface
>>>>>>> which resulted in the following error.
>>>>>>>
>>>>>>> *Error: *409-{u'NeutronError': {u'message': u'Cannot associate
>>>>>>> floating IP 192.168.17.96 (5691eb81-3153-4ee1-b9d0-31fc84516b03) with 
>>>>>>> port
>>>>>>> 7e9416ce-5077-44c4-97db-b4b14c10dfc9 using fixed IP 10.0.0.167, as that
>>>>>>> fixed IP already has a floating IP on external network
>>>>>>> ba667f72-7ba8-4b24-b360-b74a0211c83c.', u'type':
>>>>>>> u'FloatingIPPortAlreadyAssociated', u'detail': u''}}
>>>>>>>
>>>>>>> I guess we can't assign multiple floating IPs to the same interface
>>>>>>> from same network. We would be able to assign multiple floating IPs to 
>>>>>>> the
>>>>>>> same interface from multiple networks. Since I am having only one 
>>>>>>> external
>>>>>>> network, I couldn't test this. Any idea?
>>>>>>>
>>>>>>> Feel free to share your thoughts.
>>>>>>>
>>>>>>> 1. https://issues.apache.org/jira/browse/STRATOS-698
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> --
>>>>>>> Raj
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Udara Liyanage
>>>>>> Software Engineer
>>>>>> WSO2, Inc.: http://wso2.com
>>>>>> lean. enterprise. middleware
>>>>>>
>>>>>> web: http://udaraliyanage.wordpress.com
>>>>>> phone: +94 71 443 6897
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Raj
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Udara Liyanage
>>>> Software Engineer
>>>> WSO2, Inc.: http://wso2.com
>>>> lean. enterprise. middleware
>>>>
>>>> web: http://udaraliyanage.wordpress.com
>>>> phone: +94 71 443 6897
>>>>
>>>
>>>
>>>
>>> --
>>> Raj
>>>
>>
>>
>>
>> --
>> Raj
>>
>
>
>
> --
> Raj
>



-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Reply via email to